var goodToGo = false;


PDF_g = new Image();
PDF_g.src = "/images/common/pai_btn_takeonePDF_gray.gif";
PDF_g_hi = new Image();
PDF_g_hi.src = "/images/common/pai_btn_takeonePDF_gray_hi.gif";

PDF_r = new Image();
PDF_r.src = "/images/common/pai_btn_takeonePDF_red.gif";
PDF_r_hi = new Image();
PDF_r_hi.src = "/images/common/pai_btn_takeonePDF_red_hi.gif";


PDF = new Image();
PDF.src = "/images/common/pai_btn_takeonePDF.gif";
PDF_hi = new Image();
PDF_hi.src = "/images/common/pai_btn_takeonePDF_hi.gif";

btn_email = new Image();
btn_email.src = "/images/common/pai_ftr_email.gif";
btn_email_hi = new Image();
btn_email_hi.src = "/images/common/pai_ftr_email_hi.gif";

btn_terms = new Image();
btn_terms.src = "/images/common/pai_ftr_terms.gif";
btn_terms_hi = new Image();
btn_terms_hi.src = "/images/common/pai_ftr_terms_hi.gif";



// STYLE CHANGING
function changeStyle(id, newClass) {
	identity=document.getElementById(id);	
	identity.className=newClass;	
}	


// IMAGE ROLLOVER FUNCTION 

function flash(img1, img2) {
	// alert(img1 + " to " + img2);
	if (document.images) eval('document.images[img1].src = '+img2+'.src');
}


// CSS COMPLIANT EXTERNAL LINK FUNCTION (OPEN NEW POP-UP) 

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
 }
}


// POP UP WINDOW
function popIt(url,name,height,width,resize,scrolling) {
	// alert("Pop Recipe: " + url);
	
	features = "menubar=0, tollbar=0, scrollbars=" + scrolling + ", resizable=" + resize + ", width=" + width + ", height=" + height + ",dependent=yes";
	
	if (window.thePopper && !window.thePopper.closed) {
		
		thePopper.resizeTo(width,height);
		thePopper.innerwidth=width;
		thePopper.height=height;
		thePopper.location.href = url;
		thePopper.focus();
		
	} else {

		var winl = Math.floor((screen.width - width) / 2);
		var wint = Math.floor((screen.height - height) / 2);
					
		thePopper = window.open(url,name,'top='+wint+',left='+winl+','+features);
		thePopper.innerwidth=width;
		thePopper.height=height;
	
	}
	 
}


// POP UP WINDOW FOR EXTERNAL LINKS
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
 }
}

// FOR CSS MENU
	startList = function() {
	if (document.all&&document.getElementById) {
	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";
	  }
	  node.onmouseout=function() {
	  this.className=this.className.replace
			(" over", "");
	   }
	   }
	  }
	 }
	}
	// window.onload=startList;
		
function init() {
	externalLinks();
	startList;
}

window.onload=init;

