<!--
//    
// --------------------  **whmg.net JavaScript **  ----------------->
//     


defaultStatus = "Women's Health Medical Group, P.A.";

// --------------------  ** 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)
		}
}

function formHandler(form) {
var windowprops = "height=500,width=500,location=no,"
+ "scrollbars=no,menubars=no,toolbars=no,resizable=yes";

var URL = form.site.options[form.site.selectedIndex].value;
popup = window.open(URL,"MenuPopup",windowprops);
}
         
// --------------------  ** Change Background Image Function ** -----------------> 


function changeSty(classpassed){
	document.getElementById('cornerimage').className=classpassed;
}


// --------------------  ** Rollover hover menu ** -----------------> 
// declare menu array
menuData = new Array()
for (i=0; i < 7; i++) {
	menuData[i] = new Array(40)
	for (j=0; j < 20; j++) {
		menuData[i][j] = new Array(2)}}


// who we are Menu
menuData[0][0][0]="Dr. Carrington";
menuData[0][0][1]="whoweare_carrington.asp,NEWWINDOW";
menuData[0][1][0]="Dr. Butler";
menuData[0][1][1]="whoweare_butler.asp,NEWWINDOW";
menuData[0][2][0]="Dr. Deem";
menuData[0][2][1]="whoweare_deem.asp,NEWWINDOW";
menuData[0][3][0]="Dr. Howell";
menuData[0][3][1]="whoweare_howell.asp,NEWWINDOW";
menuData[0][4][0]="Dr. Neville";
menuData[0][4][1]="whoweare_neville.asp,NEWWINDOW";
menuData[0][5][0]="Dr. Ryan";
menuData[0][5][1]="whoweare_ryan.asp,NEWWINDOW";
menuData[0][6][0]="Dr. Suba";
menuData[0][6][1]="whoweare_suba.asp,NEWWINDOW";
menuData[0][7][0]="Marlys Spikes";
menuData[0][7][1]="whoweare_spikes.asp,NEWWINDOW";


// what we do Menu
menuData[1][0][0]="wellness";
menuData[1][0][1]="whatwedo_wellness.asp";target="blank"
menuData[1][1][0]="gynecology";
menuData[1][1][1]="whatwedo_gynecology.asp";
menuData[1][2][0]="infertility";
menuData[1][2][1]="whatwedo_infertility.asp";
menuData[1][3][0]="obstetrics";
menuData[1][3][1]="whatwedo_obstetrics.asp";


// where we are Menu
menuData[2][0][0]="fort worth";
menuData[2][0][1]="whereweare_fw.asp,NEWWINDOW";
menuData[2][1][0]="burleson";
menuData[2][1][1]="whereweare_burleson.asp,NEWWINDOW";
menuData[2][2][0]="granbury";
menuData[2][2][1]="whereweare_granbury.asp,NEWWINDOW";
menuData[2][3][0]="lake worth";
menuData[2][3][1]="whereweare_lw.asp,NEWWINDOW";


// patient info Menu
menuData[3][0][0]="appointments";
menuData[3][0][1]="resources_appts.asp";
menuData[3][1][0]="insurance";
menuData[3][1][1]="resources_ins.asp";
menuData[3][2][0]="privacy policy";
menuData[3][2][1]="resources_privacy.asp";
menuData[3][3][0]="online forms";
menuData[3][3][1]="resources_forms.asp";
menuData[3][4][0]="helpful links";
menuData[3][4][1]="resources_links.asp";


// --------------------  ** Begin Menu Functions **  ----------------->

// choose colors for menu

menuColor="#ffffff"

// USMD
menuColorOn="#ffffff"

fontColorOn="#8683A4"
fontColorOff="#000000"
lineColor = "#8683A4"

separator="<img src=images/spacer.gif height=2 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;
	
	//alert('strPos is' + strPos);

	if (strPos != -1){
		strURL = tempStr.slice(0,strPos)
		myStr =  tempStr.slice(strPos +1 , myLen)
	}else{
		strURL = tempStr
		myStr  = -1
	}
	
	//alert(strURL);
	//alert(myStr);

	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);
			openWin(strURL,'bios',700,800,'yes');
		}

	 }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:100px; z-index:2; top:"+ divTop +"px; left: " + divLeft + "; background-color: #8683A4; border:1 solid #8683A4; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\"  onMouseout=\"hideMenu(\'" + divID + "\');\">"
       	objDiv += "<div id=\"spacer\" style=\"position:relative; height:2px; width:100px; 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:100px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
            	objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:"+ menuColor +";  height:15px; width:100px; 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:1; width:100px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
	objDiv += "<div id=\"spacer\" style=\"position:relative; height:1px; width:100px; z-index:3; left: 0; font-size:1;\"></div></div>"
		
	document.write(objDiv);  
        //alert(objDiv);
        
        }else{
        
		objDiv = "<div id=\"" + divID + "\" style=\"position:absolute; width:100px; z-index:2; top:"+ divTop +"px; left: " + divLeft + "; background-color: #8683A4; border:1 solid #8683A4; visibility: hidden;\" onMouseover=\"showMenu(\'"+ divID +"\');\"  onMouseout=\"hideMenu(\'" + divID + "\');\">"
	       	objDiv += "<div id=\"spacer\" style=\"position:relative; height:2px; width:100px; 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:100px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
				objDiv += "<div id=\"x" + tdID + "\" style=\"position:relative; background-color:"+ menuColor +"; height:15px; width:100px; 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:1; width:99px; z-index:3; left: 0; background-color:" + lineColor + ";\">" + separator + "</div>"
		objDiv += "<div id=\"spacer\" style=\"position:relative; height:1px; width:99px; z-index:3; left: 1; 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=\""+ "#8683A4" +"\"  width=95 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=95  HEIGHT=1 Z-INDEX=2 TOP="+ nestTop +">"+ separator +"</layer>"
		objDiv +="<layer id=\"lineEnd\" BGCOLOR=\""+ "#8683A4" +"\" width=95 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('whowearemenu',0,160,259);
	doDiv('whatwedomenu',1,160,292);
	doDiv('wherewearemenu',2,160,325);
	doDiv('resourcesmenu',3,160,358);


	
	//alert("WC3");
}

else if(b=="N"){

	doDiv('whowearemenu',0,160,259);
	doDiv('whatwedomenu',1,160,292);
	doDiv('wherewearemenu',2,160,325);
	doDiv('resourcesmenu',3,160,358);


	//alert("N");
}



//-->
