<!--
//    
// --------------------  ** skintherapiesinc.com JavaScript **  ----------------->
//     


defaultStatus = "Skin Therapies, Inc.";

// --------------------  ** Go Menu **  ----------------->
function go(){
	(document.links.gomenu.options[document.links.gomenu.selectedIndex].value != "null") ? location.href=document.links.gomenu.options[document.links.gomenu.selectedIndex].value : alert("Please make a valid selection");
	document.links.gomenu.selectedIndex = 0;
}

// --------------------  ** Browser Detection **  ----------------->

   bName = navigator.appName;
   bVersion = parseFloat(navigator.appVersion);
   r = 'false';

if (bName == "Netscape" && bVersion >= 3.0){
        //alert(bName+bVersion);
	document.write('<link rel=stylesheet type="text/css" href="css/netscape.css">');
        r = 'true';
	}
else if (bName == "Microsoft Internet Explorer" && bVersion >= 3.0)
	{
	document.write('<link rel=stylesheet type="text/css" href="css/default.css">');
	r = 'true';
	}
else
	{
	//alert("Niether");
	r = 'false';
	document.write('<link rel=stylesheet type="text/css" href="css/default.css">');
}
// --------------------  ** DOM Detection **  ----------------->
  	     
var b // Check DOM 

if (document.getElementById) {
        //alert("This browser is WC3 DOM Compliant! IE 5.5 or Netscape 6");
        	if (bName == "Netscape" && bVersion >= 4.0){
        	
        		var NS6 = true; //It is Netscape 6
			b="WC3";
			
  		}else{
  			b="WC3"; 
  			var NS6 = false;
  			
  		}
  	}
else if(document.all){
	//alert("This browser is IE!");
	b="IE";
	}
else if (document.layers) {
  	//alert("This browser is Netscape!");
    	b="N";
}

//alert(b);   


// --------------------  ** Image Rollover Function **  ----------------->

function msover(img,ref){
	if (r == 'true'){
		document.images[img].src = ref;
	}
}

function msout(img,ref){
	if (r == 'true'){
		document.images[img].src = ref;
	}
}
   
// --------------------  ** New Window Function **  ----------------->  
   
function openWin(thepage,winname,iwidth,iheight,scroll) {
   
	if (parseInt(navigator.appVersion) >= 4) {
		var winl = (screen.width - iwidth) / 2;
		var wint = (screen.height - iheight) / 2;
		winargs = 'height='+iheight+',width='+iwidth+',top='+wint+',left='+winl+',scrollbars='+scroll
		win = window.open(thepage,winname,winargs)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } 
		} 
      
		else
      
		{
		winargs = 'height='+iheight+',width='+iwidth+ ', scrollbars='+scroll
		window.open(thepage,winname,winargs)
		}
}
         

// --------------------  ** Begin Menu Functions **  ----------------->

// choose colors for menu

menuColor="#ffffff"

// COT
menuColorOn="#FFFFFF"

fontColorOn="#999999"
fontColorOff="#000000"
lineColor = "#000000"

separator="<img src=images/spacer.gif height=1 width=1>"




// --------------------  ** Show Menu **  -------------------------->
// Show the user the menu depending on browser type.

function showMenu(sMenu){
var theMenuObj;
	
if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.visibility = 'visible';
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.visibility = 'visible';
	}
	
else if(b=="N"){ // Netscape 4 +
	theMenuObj = document.layers[sMenu];
	theMenuObj.visibility = 'show';
	}
}


// --------------------  ** Hide Menu **  ----------------->
// Hide the menu depending on browser type.

function hideMenu(sMenu){
var theMenuObj;
	
if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.visibility = 'hidden';
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.visibility = 'hidden';
	}
	
else if(b=="N"){ // Netscape 4 +
	theMenuObj = document.layers[sMenu];
	theMenuObj.visibility = 'hide';
	}
}



// --------------------  ** Menu Div Over **  ----------------->

function divOver(sMenu){

var theMenuObj;

if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.backgroundColor=menuColorOn;
	theMenuObj.style.color=fontColorOn;
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.backgroundColor=menuColorOn;
	theMenuObj.style.color=fontColorOn;
	}
	else{return}
	
}

// --------------------  ** Menu Div Out **  ----------------->

function divOut(sMenu){

var theMenuObj;

if(b=="WC3"){ // Netscape 6  or IE 5.0 +

	theMenuObj = document.getElementById(sMenu);
	theMenuObj.style.backgroundColor=menuColor;
	theMenuObj.style.color=fontColorOff;
	}
	
else if(b=="IE"){ // IE 4
	
	theMenuObj = document.all[sMenu];
	theMenuObj.style.backgroundColor=menuColor;
	theMenuObj.style.color=fontColorOff;
	}
	else{return}
	
}


function menuOver(){
	var args, theMenu;
	args = menuOver.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor=menuColorOn; 
	
}


function menuOut(){
	var args, theMenu;
	args = menuOut.arguments;
	theMenu = eval(args[0]);
	theMenu.bgColor=menuColor; 
	
}

// --------------------  ** Get Url Out **  ----------------->

function gotoUrl(){
var args, tempStr, strURL, strPos, myLen, myStr;
args = gotoUrl.arguments;
tempStr = args[0]
strPos = tempStr.indexOf(",");
myLen = tempStr.length;
if (strPos != -1){
	strURL = tempStr.slice(0,strPos)
	myStr =  tempStr.slice(strPos +1 , myLen)
 }
 else
 {
	strURL = tempStr
	myStr  = -1
}
if ( myStr != -1){
	if (myStr == "TARGETMAIN"){
        	//alert("TARGET MAIN");
        	//alert(strURL);
        	// open page with target of main
      		window.parent.main.location.href=strURL;
         }
      	if (myStr == "NEWWINDOW"){
      		//alert("NEW WINDOW");
      		//alert(strURL);
      		// open page in new window
      		window.open(strURL);
      	}
      	
 }else{
	//alert(strURL);
	// open window with target of _top
	window.parent.top.location.href=strURL;
     }
}


// --------------------  ** Build Divs **  ----------------->

var tdID = 0

function doDiv(){
	args = doDiv.arguments;
	var divID = args[0];
	var x = args[1];
	var divLeft = args[2];
	var divTop = args[3];
	
	if (NS6) {
	
	objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:150px; z-index:2; top:"+ divTop +"px; left: " + divLeft + "; background-color: #000000; border:1 solid #000000; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\"  onMouseout=\"hideMenu(\'" + divID + "\');\">"
       	objDiv += "<div id=\"spacer\" style=\"position:relative; height:5px; width:145px; z-index:0; left: 0; font-size:1;\"></div>"
             
         for (y = 0; y < 15; y++){
               if(menuData[x][y][0]!=null){
           	objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:145px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
            	objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:"+ menuColor +";  height:15px; width:145px; z-index:3; left: 1;\" onMouseover=\"divOver(\'x" + tdID + "\');\" onMouseout=\"divOut(\'x" + tdID + "\');\" class=\"dhtmlNav\" onClick=\"gotoUrl('"+menuData[x][y][1]+"')\">&nbsp;"+ menuData[x][y][0] +"&nbsp;</div>"
         	tdID = tdID +1
         	}
           	}
	
	//objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:145px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
	objDiv += "<div id=\"spacer\" style=\"position:relative; height:5px; width:145px; z-index:3; left: 5; font-size:1;\"></div></div>"
		
	document.write(objDiv);  
        //alert(objDiv);
        
        }else{
        
        objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:145px; z-index:2; top:"+ divTop +"px; left: " + divLeft + "; background-color: #000000; border:1 solid #000000; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\"  onMouseout=\"hideMenu(\'" + divID + "\');\">"
	       	objDiv += "<div id=\"spacer\" style=\"position:relative; height:5px; width:145px; z-index:0; left: 0; font-size:1;\"></div>"
	             
	         for (y = 0; y < 15; y++){
	               if(menuData[x][y][0]!=null){
	           	objDiv += "<div id=\"bar\" style=\"position:relative; height:1; width:145px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
	            	objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:"+ menuColor +"; height:15px; width:145px; z-index:3; left: 0;\" onMouseover=\"divOver(\'x" + tdID + "\');\" onMouseout=\"divOut(\'x" + tdID + "\');\" class=\"dhtmlNav\" onClick=\"gotoUrl('"+menuData[x][y][1]+"');\">&nbsp;"+ menuData[x][y][0] +"&nbsp;</div>"
	         	tdID = tdID +1
	         	}
	           	}
		
		//objDiv += "<div id=\"bar\" style=\"position:relative; height:0; width:145px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
		objDiv += "<div id=\"spacer\" style=\"position:relative; height:5px; width:145px; z-index:3; left: 5; font-size:1;\"></div></div>"
			
		document.write(objDiv);  
        //alert(objDiv);
        
        }

}

// --------------------  ** Build Layers **  ----------------->

function doLayer(){
	args = doLayer.arguments;
	var nestLayerID=0
	var layerID = args[0];
	var x = args[1];
	var layerLeft = args[2];
	var layerTop = args[3];

	if(navigator.platform.indexOf("Win") < 0){layerInc=16;layerStyle="netMenuMac";}
	else{layerInc=15;layerStyle="netMenu";}	
		
	objDiv = "<layer id=\""+ layerID +"\" Z-INDEX=1 BGCOLOR=\""+ "#000000" +"\"  width=145 HEIGHT=4 LEFT="+ layerLeft +" TOP="+ layerTop +" VISIBILITY=HIDE onmouseover=\"showMenu(\'"+ layerID +"\');\" onmouseout=\"hideMenu(\'"+ layerID +"\');\">"
	
	var nestTop=3
		for (y = 0; y < 15; y++){
		    if(menuData[x][y][0]!=null){
			objDiv += "<layer id=\"line2\" BGCOLOR=\""+ lineColor +"\" WIDTH=140 HEIGHT=1 Z-INDEX=4 LEFT=1 TOP="+ nestTop +">"+ separator +"</layer>"
			objDiv += "<layer id=\"x"+nestLayerID+"\" class=\""+ layerStyle +"\" Z-INDEX=3 BGCOLOR=\""+ menuColor +"\" HEIGHT=16 WIDTH=140 LEFT=1 TOP="+ nestTop +" onmouseover=\"menuOver('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onmouseout=\"menuOut('document.layers[\\'"+ layerID +"\\'].document.layers[\\'x"+nestLayerID+"\\']')\" onClick=\"gotoUrl('"+menuData[x][y][1]+"');\"><a id=navstyle  href=javascript:gotoUrl('"+menuData[x][y][1]+"')><font color=" + fontColorOff + ">"+ menuData[x][y][0]
			objDiv +="</font></a></layer>"		
			nestLayerID=nestLayerID+1
			nestTop=nestTop+layerInc+1
			}
		}
		objDiv += "<layer id=\"line2\" BGCOLOR=\""+ lineColor +"\" width=145  HEIGHT=1 Z-INDEX=2 TOP="+ nestTop +">"+ separator +"</layer>"
		objDiv +="<layer id=\"lineEnd\" BGCOLOR=\""+ "#000000" +"\" width=145 HEIGHT=4 Z-INDEX=4 TOP="+ nestTop +"></layer></layer>"

	document.write(objDiv)
	//alert(objDiv);
}


// --------------------  ** Menu Divs and Layers **  ----------------->

//var winA = (screen.width - 700) / 2;

if(b=="WC3" || b=="IE"){

	doDiv('welcomemenu',0,237,65);
	doDiv('servicesmenu',1,307,65);
	doDiv('resourcesmenu',2,372,65);
	doDiv('contactmenu',3,493,65);
	
	//alert("WC3");
}

else if(b=="N"){

	doLayer('welcomemenu',0,237,65);
	doLayer('servicesmenu',1,307,65);
	doLayer('resourcesmenu',2,372,65);
	doLayer('contactmenu',3,493,65);

	//alert("N");
}



// -->