// wsi_core_functions.js



function MM_findObj(n, d) { //v4.0

		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 && document.getElementById) x=document.getElementById(n); 

		if(!x && document.getElementsByName) x=document.getElementsByName(n)[0];

		return 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_reloadPage(init) {  //reloads the window if Nav4 resized

		if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

		else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

	}

	MM_reloadPage(true);

	// -->

	

	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];}

	}

	

	function MM_showHideLayers() { //v3.0

		var i,p,v,obj,args=MM_showHideLayers.arguments;

		for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }

			obj.visibility=v; }

	}

	

	function MM_setTextOfTextfield(objName,x,newText) { //v3.0

		var obj = MM_findObj(objName); if (obj) obj.value = newText;

	}

		

	var tidicon=null;



	function WS_initialize() {

		WS_hideall ();

		MM_swapImgRestore();

	}

	function doinicon(subcat,switchOn,iconOn) {

		MM_swapImgRestore();

		MM_swapImage('subcatname' + subcat,'',switchOn,1);

		MM_swapImage('subcaticon','',iconOn,1);

		if (tidicon != null) {window.clearTimeout(tidicon);}

	}

	

	function doouticon(subcat,switchOff) {

		MM_swapImage('subcatname' + subcat,'',switchOff,1);

		if (tidicon != null) {window.clearTimeout(tidicon);}

		tidicon=window.setTimeout('reseticon()',500);

	}

	

	function WS_hideall() {

		MM_showHideLayers('subcatlayer1','','hide');

		MM_showHideLayers('subcatlayer2','','hide');

		MM_showHideLayers('subcatlayer3','','hide');

		MM_showHideLayers('subcatlayer4','','hide');

		MM_showHideLayers('subcatlayer5','','hide');

		MM_showHideLayers('subcatlayer6','','hide');

		MM_showHideLayers('subcatlayer7','','hide');

		MM_showHideLayers('subcatlayer8','','hide');

		MM_showHideLayers('subcatlayer9','','hide');

		MM_showHideLayers('subcatlayer10','','hide');



	}

	

	var WS_menu=null;

	

	function WS_doinSubCat(num,switchOn) {

		MM_swapImgRestore();

		MM_swapImage('subcat' + num,'',switchOn,1);

		MM_showHideLayers('subcatlayer' + num,'','show');

		MM_showHideLayers('catlayer' + num,'','show');

		if (WS_menu != null) {window.clearTimeout(WS_menu);}

	}

	

	function WS_dooutSubCat(num) {

		if (WS_menu != null) {window.clearTimeout(WS_menu);}

		WS_menu=window.setTimeout('WS_initialize()',500);

	}



	var agt  = navigator.userAgent.toLowerCase();

	var nav4 = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)

	         && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)

					 && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)

					 && (parseInt(navigator.appVersion) == 4));



	function hovering(object,value) {

  	if(!nav4) with(object.style)

		backgroundColor = (value) ? "E2E2E2" : "";

	}

	

	function openWindow(url,width,height,xPos,yPos,target){

	  var screenWidth = parseInt(screen.width);

	  var screenHeight = parseInt(screen.height);

	  if (xPos=='c') xPos=(screenWidth-parseInt(width))/2;		// Place window on screen center with regard to x-component

	  if (yPos=='c') yPos=(screenHeight-parseInt(height))/2;	// Place window on screen center with regard to y-component

	  if (target==null) {target=''}



	  var w = window.showModalDialog(url,target,'dialogWidth:'+width+'px;dialogHeight:'+height+'px;dialogTop:'+yPos+'px;dialogLeft:'+xPos+'px;help:no;status:no;resizable:yes;scrollbars:no');

	}

	

		function createPopUp(url, name, optionString) {			

			if (name.length == 0){

				var name = "newwnd";

			}

			if (optionString.length == 0){

				var optionString = "toolbar=no,location=no,directories=no,scrollbars=yes,resizable=yes,height=520,width=620,screenX=4,screenY=4,top=4,left=4";

			}		

			win = window.open(url, name, optionString);

			win.focus();

		}
		
		
		/*Code for no copy images*/
		
function nocopy() 
{if (event.button==2) {alert ("Sorry! You can't copy this picture. For aditional information on how to obtain a copy of this image, Please contact Dr. Andy Erlich at drandy@andyerlich.com"); }
} 
/*Code for no copy images end*/


