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=''; }
			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 MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3) {
   if ((x=MM_findObj(a[i]))!=null){
	   document.MM_sr[j++]=x; 
	   if(!x.oSrc) x.oSrc=x.src; 
	   x.src=a[i+2];
	}
  }
}

