
  


function zoom(factor) {
	var emap=floater.document.getElementById('the_image');
	
	
	
	var mapHeight = emap.height
	var mapWidth = emap.width
	
	var slope = mapHeight/mapWidth
	
	var newWidth = mapWidth + factor
	var newHeight=mapHeight+(factor*slope)
	
	var diffHeight =  newHeight - mapHeight
	
	
	
	//if ((emap.offsetTop+Math.floor(diffHeight/2))<300){
	emap.style.top=Math.round(emap.offsetTop-(diffHeight/2))+'px'
	//}
	//if ((emap.offsetLeft+Math.floor(diffWidth/2))<500){
	emap.style.left=Math.round(emap.offsetLeft-(factor/2))+'px'
	//}
	//document.getElementById('the_results').innerHTML = document.getElementById('the_results').innerHTML + '<br>' + Math.round(emap.offsetTop-(diffHeight/2))+'px' + '|' + Math.round(emap.offsetLeft-(factor/2))+'px'
	//document.getElementById('the_results2').innerHTML = document.getElementById('the_results2').innerHTML + '<br>' + Math.round(newWidth)+'px' + '|' + Math.round(newHeight)+'px'
	emap.style.width=Math.round(newWidth)+'px';
	emap.style.height=Math.round(newHeight)+'px';
}


function zoomin(fact,i,x,num_frames){
	var msg;
	var x ;
	var the_timeout = 1;
	
	
	if (x<num_frames) {
		if(x==1){
			
			
			if(((document.getElementById('zoom_level').value)>0)&&((document.getElementById('zoom_level').value)<5)){
				document.getElementById('zoom_level').value = parseInt(document.getElementById('zoom_level').value)+i
				}
			if(document.getElementById('zoom_level').value==5 && i==-1){
				document.getElementById('zoom_level').value = 3
			
			}
			if(document.getElementById('zoom_level').value==0 && i==1){
				document.getElementById('zoom_level').value = 2
			
			}
			
			
		
		
		}
		if(((document.getElementById('zoom_level').value)>0)&&((document.getElementById('zoom_level').value)<5)){
		
		if((document.getElementById('zoom_level').value)>3||(document.getElementById('zoom_level').value)>2&&fact<0){ 
			zoom(fact*3);
			num_frames = 15
			the_timeout = 1
		}
		else{
			zoom(fact);
		}
		//zoom(fact);
		}
		
		x+=1
		setTimeout('zoomin('+fact+','+i+','+x+','+num_frames+');',the_timeout)
		}
}
function zoomout(fact,i){
	var msg;
	if (i>fact) {
		zoom(i);
		i=i-.001
		setTimeout('zoomout('+fact+','+i+');',30)
		}
}


function slideback(){
if (inc<bgslides.length-1)
inc++
else
inc=0
document.getElementById('home_table').style.backgroundImage="url('"+processed[inc].src+"')"
document.getElementById('rotating_url').href=""+processed2[inc]+""
//alert(processed[inc].src)
}

function change_image(the_image){
document.getElementById('product_image').src="pop.asp?load_image=1&imgname="+the_image
document.getElementById('the_zoom_image').src=the_image
}



function  email_form(){
document.getElementById('email_form').style.display="block"
}



function clear_field(the_text,the_element){
if (document.getElementById(the_element).value==the_text)
{
document.getElementById(the_element).value=''
}

}


function switch_class(the_element,the_action)
{

if(the_action=="on"){
document.getElementById(the_element).className ='main_left_over'
}
else
{
document.getElementById(the_element).className ='main_left'
}

}

function display_subs(the_element,the_dept,parent_id)
{

document.getElementById('sbb').style.backgroundColor=''
document.getElementById('sbc').style.backgroundColor=''
document.getElementById('sbz').style.backgroundColor=''

document.getElementById('sbb_depts').style.display='none'
document.getElementById('sbc_depts').style.display='none'
document.getElementById('sbz_depts').style.display='none'

document.getElementById(the_element).style.backgroundColor='#C32033'
document.getElementById(the_element+'_depts').style.display='block'

document.getElementById('dept_gopher').src="create_nav.asp?dept_id="+the_dept+"&el="+the_element+"&parent_id="+parent_id

}



function display_subs_new(the_element,the_dept,parent_id)
{

var total_depts = document.getElementById('total_depts').value
var mySplitResult = total_depts.split(",");

for (i=0;i<mySplitResult.length-1;i++){
the_element1 = "depts_"+(mySplitResult[i])
the_element2 = "main_"+(mySplitResult[i])


document.getElementById(the_element2).style.backgroundColor=''
document.getElementById(the_element1).style.display='none'
}


document.getElementById("main_"+the_element).style.backgroundColor='#C32033'
document.getElementById("depts_"+the_element).style.display='block'

document.getElementById('dept_gopher').src="create_nav.asp?dept_id="+the_dept+"&el="+the_element+"&parent_id="+parent_id

}



