/* cookies global var  */
var expDate= new Date(2050,11,11);


/* left nav script - used for IE only - all others are pure css and don't need javascript */
/* script not supported by ie5 Mac */

//disable script for ie5mac
var isMac;
isMac = navigator.userAgent.toLowerCase().indexOf("mac") !=-1;
//replicate nav hover effect for IE win
startList = function() {
	if (document.all&&document.getElementById&&!isMac) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
			
				node.onmouseover=function() {
							this.className+=" over";
							//alert (this.className);
							
							}
	 					node.onmouseout=function() {this.className=this.className.replace(" over", "");
					//alert(this.className);
					}
				}
	
		
				/* removed redundant branch that was here when class=current was used instead of id. */
			/*
				currentNode = document.getElementById("current1")
					for (j=0; j<currentNode.childNodes.length; j++){
						subNode = currentNode.childNodes[j];
							if (subNode.nodeName =="UL"){
								for (k=0; k<subNode.childNodes.length; k++){
										subSubNode = subNode.childNodes[k];
											if (subSubNode.nodeName =="LI"){
								subSubNode.onmouseover=function() {
								this.className+=" over";
								
								}
								subSubNode.onmouseout=function() {this.className=this.className.replace(" over", "");}
							}
							
						}
					}	
				}
			
			*/

			/*end of current node branch */
					
 		}
	}
}
window.onload=startList;



function setCookie(name, value, expires, path, domain, secure){
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}  

function getCookie(name){
	    var dc = document.cookie;
	    var prefix = name + "=";
	    var begin = dc.indexOf("; " + prefix);
	    if (begin == -1)
	    {
	        begin = dc.indexOf(prefix);
	        if (begin != 0) return null;
	    }
	    else
	    {
	        begin += 2;
	    }
	    var end = document.cookie.indexOf(";", begin);
	    if (end == -1)
	    {
	        end = dc.length;
	    }
	    return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain){
	if (getCookie(name)){document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";}
}
	


function printPage() {
   if (window.print)
     window.print();
   else
     alert("Sorry, this feature is not supported by your browser. Please use your browser's print button."); 
	 }
	 
function right_answer(url) {
	window.open(url);
}

function right_answer2(url) {
	var agt = navigator.userAgent.toLowerCase();
 	var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	/* mozilla */
	/*if(!is_ie){
		history.back();
		window.open(url);
		}*/
	/* IE */
	/*else if(is_ie){*/
	
		window.open(url);
		history.back(-1);
	/*}*/
}


/* open Flash popup. parameters for width and height of the flash movie are optional. */
function openFlash(theMovie,theWidth,theHeight){
var fw, fh, w, h; 

/* dimensions of flash movie */
if (theWidth) {fw = theWidth;} else {fw = 428;}
if (theHeight) {fh = theHeight;} else {fh = 260;}

/* popup dimensions */
w = fw;
h = fh + 50;

flashPopup = window.open("/utils/flashpopup/index.jsp?mov="+theMovie+"&w="+fw+"&h="+fh, "flashWin","status=no,toolbar=no,resizable=no,location=no,width="+w+",height="+h+",top=20,left=20");
flashPopup.focus();
}

function openAcroFlash(theMovie,theWidth,theHeight){
var fw, fh, w, h;

/* dimensions of flash movie */
if (theWidth) {fw = theWidth;} else {fw = 428;}
if (theHeight) {fh = theHeight;} else {fh = 260;}

/* popup dimensions */
w = fw;
h = fh + 50;

flashPopup = window.open("http://www.acromegalyinfo.com/utils/flashpopup/index.jsp?mov="+theMovie+"&w="+fw+"&h="+fh, "flashWin","status=no,toolbar=no,resizable=no,location=no,width="+w+",height="+h+",top=20,left=20");
flashPopup.focus();
}
