function img_popup(url,alt) {
	name = url.split("/");
	name = name[2];
	new_window=open("",'Image','width=400,height=400,scrollbars'); 
	new_window.document.write("<HTML><HEAD><TITLE>"+name+"</TITLE></HEAD>"); 
	new_window.document.write("<SCRIPT language='javascript'>function checksize() {if (document.images[0].complete) {if (document.images[0].height > 700) {window.resizeTo((document.images[0].width*700/document.images[0].height)+30,700+80);} else { window.resizeTo(document.images[0].width+30,document.images[0].height+80);}window.focus();} else {setTimeout('checksize()',250);}}</"+"SCRIPT>"); 
	new_window.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
	new_window.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");
	new_window.document.write("<TD valign='middle' align='center'><IMG src='"+url+"' border=0 alt='"+alt+"'>"); 
	new_window.document.write("</TD></TR></TABLE>");
	new_window.document.write("</BODY></HTML>"); 
	new_window.document.close(); 
}

function table_back(x,y) {
	document.getElementById('table_'+x).style.background="#"+y;
}
function menus_back(lvl,x,color,font) {
	document.getElementById('table_'+lvl+'0'+x).style.background='#'+menus_design[lvl][color];
	document.getElementById('table_'+lvl+'0'+x).className=menus_design[lvl][font];
}
function menus_link(lvl,x) {
	document.location.href=menus[lvl][x][1];
}
function swap_img(x,y) {
	document.getElementById(x).src=y;
}


var wait=0;
var waiting_div='';
function showhide_list(x,y) {
		if (y==1) {
			if (waiting_div!='') { 
				if (waiting_div!=x) { document.getElementById(waiting_div).style.visibility='hidden'; }
				waiting_div=''; }
			if (x!='') {
			document.getElementById(x).style.visibility='visible'; 
			}
		}
		if (y==0) {
			wait=2;
			waiting_div=x;
		}
}
function change_visibility() {
	if ((wait!=0)&&(waiting_div!='')) {
		wait--;
		if (wait==1) {
			document.getElementById(waiting_div).style.visibility='hidden';
			waiting_div='';
			wait=0;
		} 
	}
}
window.setInterval('change_visibility()',1000);

function change_lang(lang_request) {
	new_url=document.location.href;
	new_url = new_url.replace(".htm",".cfm");	
	if (new_url.indexOf('I=')>-1) new_url = new_url.substring(0,new_url.indexOf('&I='));
	if (new_url.indexOf('lang=')>-1) {
		new_url=new_url.substring(0,new_url.indexOf('lang=')+5) + lang_request + new_url.substring(new_url.indexOf('lang=')+7,new_url.length);
	} else {
		if (new_url.indexOf('?')>-1) {
			new_url+='&lang='+lang_request;
		} else {
			if(new_url.indexOf('index.cfm')>-1) {
				new_url+='?lang='+lang_request;
			} else {
				new_url+='index.cfm?lang='+lang_request;		
			}
		}
	}
	document.location.href=new_url;
}

function open_doc(x) {
	window.open(x,'','');
}
function page(x) {
	//window.alert(x);
	document.location.href=x;
}



	columns_asked=new Array();
	columns_asked[0]=0;
	
	allow_col=0;
	function to_columns() {
		if (columns_asked.length>0) {
			allow_col=1;
			//columns();
		}
	}
	
	var allowed_lvl=0;
	function allow_create_lvl() {
		allowed_lvl=1;
	}
	function call_create_lvl() {
		if (allowed_lvl!=0) {
			allowed_lvl=3;
		}
	}
	function wait_till_create_lvl() {
		if (allowed_lvl>1) {
			allowed_lvl--;
			if (allowed_lvl==1) { 
				create_lvl('page');
			}
		}
		new additional_body();
		if ((allow_col>0)&&(allow_col<2)) {allow_col++;} 
		if (allow_col==2) {allow_col++;columns();}
	}
	window.setInterval('wait_till_create_lvl()',500);
	function stop_waiting() {
		allowed_lvl=1;
	}
	function additional_in() { this[1]=stop_waiting(); this[2]=showhide_list('',1); }
	function additional_out() {}
	function additional_body() {}

	//variable that will increment through the images
	var step=1
	function slideit(){
		var nrImages = parseInt(document.getElementById('nrImages').value);
		var gloveName = document.getElementById('gloveName').value;
		if(nrImages == 1) {return;}
        
		/*document.getElementById('gloveimage').src="/industrial/img/gloves/"+gloveName+"_"+step+".jpg";
		if (step<nrImages)
			step++
		else
			step=1*/
		
		//call function "slideit()" every 2.5 seconds
		//setTimeout("slideit()",2500)
		var imageFiles = "/industrial/img/gloves/"+gloveName+"_1.jpg";
		for(var i=2;i<=nrImages;i=i+1) 
		{
			imageFiles = imageFiles + ";/industrial/img/gloves/"+gloveName+"_"+i+".jpg";
		}
		RunSlideShow('gloveimage',imageFiles,5);
	}
	var slideCache = new Array();
	function RunSlideShow(pictureName,imageFiles,displaySecs)
	{
	  var imageSeparator = imageFiles.indexOf(";");
	  var nextImage = imageFiles.substring(0,imageSeparator);
	  if (document.all)
	  {
		document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
		document.getElementById(pictureName).filters.blendTrans.Apply();
	  }
	  document.getElementById(pictureName).src = nextImage;
	  if (document.all)
	  {
		document.getElementById(pictureName).filters.blendTrans.Play();
	  }
	  var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
		+ ';' + nextImage;
	  setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
		displaySecs*1000);
	  // Cache the next image to improve performance.
	  imageSeparator = futureImages.indexOf(";");
	  nextImage = futureImages.substring(0,imageSeparator);
	  if (slideCache[nextImage] == null) {
		slideCache[nextImage] = new Image;
		slideCache[nextImage].src = nextImage;
	  }
	}

function showVideo(movie,top,left) { 
  var newdiv = document.createElement('div');
  newdiv.setAttribute('id','videoDiv');
  newdiv.style.position = "absolute";
  newdiv.style.top = top+"px";
  newdiv.style.left = left+"px";
  var closediv = document.createElement('div');
  closediv.setAttribute('id','closediv');
  closediv.innerHTML = '<a href="javascript:hideVideo();">X</a>';
  newdiv.appendChild(closediv);
  var flashdiv = document.createElement('div');
  flashdiv.setAttribute('id','flashdiv');
  newdiv.appendChild(flashdiv);
  document.body.appendChild(newdiv);
  var so = new SWFObject("video/"+movie+".swf", "Movie", "400", "265", "8", "#EF413E");
  so.addParam("quality","high");
  //so.addParam("scale","noscale");
  so.write("flashdiv");
}

function hideVideo() {
  var videodiv = document.getElementById('videoDiv');
  document.body.removeChild(videodiv);
}