
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function setTips(page) {
	switch(page) {
		case 'new': 
			new Tip('skin-perfectingProdImgLeft', 'NEW Skin Perfecting Wash gently cleanses and exfoliates with moisturizing ingredients to help maintain soft and clear skin.  Easy-to-use pump. ', { offset:{x:-28, y:-95 } });
			new Tip('oil-free-gelProdImgRight', 'NEW Oil-Free Gel Wash has a gentle formula to cleanse and help clear and prevent breakouts.  Easy-to-use pump. ', { offset:{x:-28, y:-95 } }); 
			new Tip('a', 'NEW StayClear&reg; Daily Facial Scrub, gentle enough for everday use, cleanses and exfoliates with tiny microbeads. ', { offset:{x:-28, y:-95 } });
			break;
		case 'cleansers': 
			new Tip('StayClear3in1Cleanser', 'This creamy formula with micro-beads help treat blemishes and prevent new ones from occurring. ', { offset:{x:-28, y:-95 } });
			new Tip('StayClear3in1CleanserSensitive', 'NEW StayClear&reg; 3 in 1 Cleanser Sensitive is specially developed for everyday use for sensitive skin. ', { offset:{x:-28, y:-95 } }); 
			new Tip('DailyDeepCleansingFoamingWash', 'StayClear&reg; Daily Cleansing Foaming Wash gives you visibly clearer skin. Gentle cleanser cleans pores without overdrying skin. ', { offset:{x:-28, y:-95 } }); 
			new Tip('StayClearOilFreeGelWash', 'NEW StayClear&reg; Oil Free Gel Wash gives you a refreshing and purifying action to clear and prevent breakouts. ', { offset:{x:-28, y:-95 } });
			new Tip('UltraCleansingCreamWash', 'Get clear fast with Ultra Cleansing Cream Wash, a medicated formula that starts working instantly to help eliminate pimples and oil. ', { offset:{x:-28, y:-95 } });
			new Tip('UltraCleansingGelWash', 'Ultra Acne Cleansing Gel Wash starts working instantly. Cleans and exfoliates to help prevent acne. ', { offset:{x:-28, y:-95 } });
			break;
		case 'scrubs':
			new Tip('DailyExfoliatingScrub', 'NEW StayClear&reg; Daily Exfoliating Scrub gently exfoliates for smooth even toned skin.', { offset:{x:-28, y:-95 } });
			new Tip('UltraExfoliatingScrub', 'Ultra Exfoliating Scrub exfoliates skin and fights acne fast. Medicated formula starts working instantly.', { offset:{x:-28, y:-95 } });
			new Tip('BlackheadControlScrub', 'Blackhead Control Scrub for blackhead-prone skin. Purifying Sea Salt helps clear blackheads and purify skin.', { offset:{x:-28, y:-95 } });
			break;	
		case 'creams':
			new Tip('UVATC', 'Ultra Vanishing Acne Treatment Cream helps fight pimples fast. ', { offset:{x:-28, y:-95 } });
			new Tip('VATCBP', 'This extra strength formula has been developed to fight acne bacteria on contact and works invisibly while it clears. ', { offset:{x:-28, y:-95 } });
			new Tip('VATC', 'StayClear&reg; Vanishing Acne Treatment Cream has been developed to treat pimples and help fight acne. ', { offset:{x:-28, y:-95 } });
			new Tip('STATC', 'StayClear&reg; Skin Tone Acne Treatment Cream provides instant cover and has been developed to treat acne pimples and to help keep skin clear. ', { offset:{x:-28, y:-95 } });
			break;	
		case 'kits':
			new Tip('dailyProdImgLeft', 'Ultra Acne Solution System helps you get clear fast and stay clear. Get a skin care routine in 3 easy steps. ', { offset:{x:-28, y:-95 } });
			break;
		case 'astringents':
			new Tip('dailyProdImgLeft', 'Ultra Acne Clearing Astringent exfoliates and deep cleans to treat and prevent acne. ', { offset:{x:-28, y:-95 } });
			new Tip('dailyProdImgRight', 'Blackhead Control Astringent has purifying sea salt and acne medication for blackhead-prone skin. ', { offset:{x:-28, y:-95 } });
			break;
		case 'pads':
			new Tip('DeepCleansingPads', 'StayClear&reg; Deep Cleansing Pads for a deep clean on-the-go. Gentle enough to use throughout the day. ', { offset:{x:-28, y:-95 } });
			new Tip('UltraDeepPoreCleansingPads', 'Ultra Deep Pore Cleansing Pads start working instantly to fight pimples fast. Helps prevent acne on the go. ', { offset:{x:-28, y:-95 } });
			new Tip('BlackheadClearingPads', 'Blackhead Clearing Pads have purifying sea salts to tighten pores and cleans to help prevent blackheads. ', { offset:{x:-28, y:-95 } });
			break;
	}
}

function openGuarantee() {
	document.getElementById('guaranteeBox').className = "guaranteeBox";
}

function closeGuarantee() {
	document.getElementById('guaranteeBox').className = "hidden";
}

function dropDown(id) {
	switch(id) {
		case 'topnav_products': id = 'topNavDropDown_products'; break;
	}
	
	content = new Array("check out our products", "Cleansers", "Scrubs", "Transparent Creams", "Pads and Wipes", "Kits", "Astringents", "Men's");
	
	html = "<div><div class=\"dropdown_title\" id=\"dropdown_title\">" + content[0] + "</div>";
	
	
	for (i = 1; i < content.length; i++) {
		html += "<div class=\"dropdown_content\" onmouseover=\"ddover(this.id);\" onmouseout=\"ddout(this.id);\" id=\"maindrop_" + i + "\">" + content[i] + "</div>";
	}	

	html += "</div>";
	
	elem = document.getElementById(id);
	elem.className = "topNavDropDown";
	elem.style.height = "" + (content.length * 31 - 1) + "px";
	elem.innerHTML = html;
}

function ddover(id) {
	document.getElementById(id).className = "dropdown_content_over";
}

function ddout(id) {
	document.getElementById(id).className = "dropdown_content";
}
