///////// Begin DHTML ///////////


layers = new Object(); layers.EQ=new Array();
hidden=(NS4)?'hide':'hidden'; visible=(NS4)?'show':'visible';
function getLayer(spec,base) { if (!NS4) return getIt(spec); var j=0,temp=null; if (!base) base=document; if (base.layers[spec]) return base.layers[spec]; for (j=0; j<base.layers.length; j++) { temp=getLayer(spec,base.layers[j].document); if (temp) return temp; } return null; }
function equalizeLayers(n) { var k,l; var list=(n==null)?layers.EQ:arguments; for (k=0; k<list.length; k++) {l=getLayer(list[k]); if(l) equalize(l); } if (n==null) layers.EQ=new Array(); }
function getIt(id) { if (IE) return document.all[id]; if (NS6) return document.getElementById(id); }
function equalize(layer) { if (layers[layer.id]) return;
  layer.getTop = new Function("return(parseInt(this.style.top))");
  layer.getLeft = new Function("return(parseInt(this.style.left))");
  layer.getHeight = new Function("if (IE) return this.scrollHeight; if (NS4) return this.document.height; if (NS6) return this.offsetHeight;");
  layer.getWidth = new Function("if (IE) return this.scrollWidth; if (NS4) return this.document.width; if (NS6) return this.offsetWidth;");
  layer.fade = new Function("o","if (IE) {this.style.filter='alpha(opacity='+o+')';} return(this);");
  layer.setClip = new Function ("l","t","r","b","if (NS4) {this.clip.left=l; this.clip.top=t; this.clip.right=r; this.clip.bottom=b;} else { this.style.clip='rect('+t+' '+r+' '+b+' '+l+')'; } /*this.style.overflow='hidden';*/  return(this);");
  layer.rewrite = new Function ("html","if (IE||NS6) this.innerHTML=html; if (NS4) {this.document.write(html); this.document.close();}  return(this);");
  layer.vis = new Function("n","if (n!=null) { this.style.visibility=(n)?visible:hidden; if (NS6) {this.style.zIndex=(n)?this.z:eval(this.z)-1;} } return((this.style.visibility==visible)?1:0);");
  layers[layer.id]=layer; if (NS4)layer.style=layer; if (NS6) { layer.z=layer.style.zIndex; if(layer.style.visibility==hidden)layer.vis(0); } }
function layerTag(id,content,vis,z,l,t,w,h,extra,es) { if (!DHTML) return(''); layers.EQ[layers.EQ.length]=id; if(w==0)w=1; if(!t)t=0; if(!l)l=0; if ((vis==null)||(vis==1))vis=visible; if(vis==0)vis=hidden; if(!z)z=10; if(!extra)extra=''; if(!es)es='';
  if (!NS4) {var stuff = '<DIV ID="'+id+'" STYLE="position:absolute; left:'+l+'px; top:'+t+'px;'+((w)?(' width:'+w+((isNaN(w))?'':'px')+';'):'')+((h)?(' height:'+h+((isNaN(h))?'':'px')+';'):'')+' visibility:'+vis+'; z-index:'+z+'; '+es+'" '+extra+'>'; }
  if (NS4)  {var stuff = '<LAYER NAME="'+id+'" left="'+l+'" top="'+t+'"'+((w)?(' width="'+w+'"'):'')+((h)?(' height="'+h+'"'):'')+' visibility="'+vis+'" z-index="'+z+'" '+extra+'>'; } return (stuff+content+((NS4)?'</LAYER>':'</DIV>')); }
function writeLayer(id,content,vis,z,l,t,w,h,extra,es) { this.writeln(layerTag(id,content,vis,z,l,t,w,h,extra,es)); equalizeLayers(); return(layers[id]); }
if (DHTML) document.newLayer=writeLayer;

var curMenu=null; 
var curMenuA=null; 
var hideTimer=10;
function showMenu(n) { clearTimeout(hideTimer); if (n==curMenu)return; var l=layers['menuLayer'+n]; if (!l)return; if (curMenu!=null){ layers['menuLayer'+curMenu].vis(0); } l.vis(1); curMenu=n; }
function hideMenu(n) { clearTimeout(hideTimer); if (curMenu==null)return; if (n) { layers['menuLayer'+curMenu].vis(0); curMenu=null; } else { hideTimer=setTimeout("hideMenu(1);",500); } }
function showMenuA(n) { clearTimeout(hideTimer); if (n==curMenuA)return; var l=layers['menuLayerA'+n]; if (!l)return; if (curMenuA!=null){ layers['menuLayerA'+curMenuA].vis(0); } l.vis(1); curMenuA=n; }
///////// End DHTML ///////////


///////// Begin Form validation ///////////
/*
var reWS = /^\s+\$/
var reInt = /^\d+\$/
function isEmpty(s) {
	return ((s == null) || (s.length == 0))
}
function isWS(s) {
	return (isEmpty(s) || reWS.test(s));
}
function testEmail(src) {
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
	return regex.test(src);
}
function validate() {
	var errors = '';
	var ferrors = '';
	var finalerrors = 'The following questions or fields are required:\n\n';
	var f = document.sendemail;
	var Strerror = 0;

	if (isWS(f.name.value)) errors += '    - Your Name\n';
	if (isWS(f.email.value)) errors += '    - E-mail\n';
		else if (!testEmail(f.email.value)) ferrors += 'The following field requires a valid value:\n\n    - E-mail\n';
	if (isWS(f.comment.value)) errors += '    - Your comment\n';
	if (errors || ferrors) {
		finalerrors += errors;
		finalerrors += '\n';
		finalerrors += ferrors;
		finalerrors += '\n';
		alert(finalerrors);
	}
	return ((errors == '') && (ferrors == ''));
}
*/
///////// End Form validation ///////////


////////// Begin Popup windows ////////////
function popWin(url,name,w,h,t,s) { 
		var win=window.open(url,name,'toolbar='+t+',location=0,directories=0,menubar=0,resizable=0,status=0,scrollbars='+s+',width='+w+',height='+h+',left=200,top=50'); 
		if (window.focus)win.focus();
}

function popup1(url,name,w,h,t,f,sb,posTop,posLeft) { 
   	  strURL = url;
		var top=(IE)?window.screenTop:window.screenY;
		var left=(IE)?window.screenLeft:window.screenX;
		if(!w)w=600; 
		if(!h)h=500; 
		if(f==null)f=1; 
		sb=(sb!=null)?sb:((f)?1:0); 
		var D=new Date();
		var win=window.open(strURL,name,'toolbar='+t+',location=0,directories=0,menubar=0,resizable=1,status=0,scrollbars='+sb+',width='+w+',height='+h+',screenX='+(left+posLeft)+',screenY='+(top+posTop)+',left='+(left+posLeft)+',top='+(top+posTop)); if (window.focus)win.focus();
}
////////// End Popup windows ////////////

