/***********************************************
* Preload Images
***********************************************/

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];}}
}

MM_preloadImages('bg-full.jpg','logo.gif','call.gif','login-on.gif','lotion-on.gif','parts-on.gif','tanningequip-on.gif','register-on.gif','password-on.gif','continue-on.gif','deletecart-on.gif','checkout-on.gif','order-on.gif')

/***********************************************
* Calling external link instead of target="_blank"
***********************************************/


function externalLinks() { 

if (!document.getElementsByTagName) return; 

var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
var anchor = anchors[i]; 
var relvalue = anchor.getAttribute("rel");

if (anchor.getAttribute("href")) {
var external = /external/;
var relvalue = anchor.getAttribute("rel");
if (external.test(relvalue)) { anchor.target = "_blank"; }
} 
}
} 
window.onload = externalLinks;



/***********************************************
* Dropdown Fix for IE
***********************************************/

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);



/***********************************************
* Popup Pic Script
***********************************************/

function PopupPic() {
 if (arguments[1] == null || arguments[1].length == 0 || arguments[2] == null || arguments[2].length == 0) {
  window.open( "popup.asp?" + arguments[0], "", "resizable=1,HEIGHT=200,WIDTH=200"); 
 }
 else {
  window.open( "popup.asp?" + arguments[0], "", "resizable=1,HEIGHT=" + arguments[2] + ",WIDTH=" + arguments[1] + ""); 
 }
} 


/***********************************************
* Popup URL Script
***********************************************/


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/***********************************************
* ShowandHide Script
***********************************************/

//<!--
function viewinfo(id) {
	box = document.getElementById(id);
	box.className = "visible";

	//Now hide all other divs that are visible
	var oDivs = document.getElementsByTagName("div")

	for (var i=0; i<oDivs.length; i++)
		if (oDivs[i].className=="visible" && oDivs[i].id != id)
			oDivs[i].className = "hidden";
}
//-->
