/* Header functions*/
// Tog More for Search
// Tog More for Search
function togMore(sShow)
{
	if (sShow == "hide")
	{
		document.getElementById("srchMoreId").style.display = "none";
	}
	else
	{
		document.getElementById("srchMoreId").style.display = "block";
	}
	return false;
}

function togFootMore(sShow)
{
	if (sShow == "hide")
	{
		document.getElementById("srchFootMoreId").style.display = "none";
	}
	else
	{
		document.getElementById("srchFootMoreId").style.display = "block";
	}
	return false;
}

// Begin : Headers 2 code
function p_o(o){return getEl(o);}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function srchSub(ref){
  var frm=p_o("search");
  var queryval = frm.topquery.value.trim();
  queryval = queryval.replace( /\+/, " ");
  newurl = ref.href + queryval;
  window.location = newurl;
  return false;
}

function searchTarget(url, newWindow, newTarget) {
    // Set the target for the form
    document.bb_topform.action = url;
    if (newWindow) {
        document.bb_topform.target = '_blank';
    } else {
        document.bb_topform.target = '';
    }
    // Update the tabs classes to allow highlighting of the selected
    var arrElements = ["search-tab-Stylelist","search-tab-Web","search-tab-Blog","search-tab-Video","search-tab-News","search-tab-Images","search-tab-Local"];
    for (var i=0; i<arrElements.length; i++) {
        getEl(arrElements[i]).className = '';
    }
    getEl(newTarget).className = 'searchCatBg';


    return false;
}

function searchTarget2(url, newWindow, newTarget) {
    // Set the target for the form

    document.bb_bottomform.action = url;
    if (newWindow) {
        document.bb_bottomform.target = '_blank';
    } else {
        document.bb_bottomform.target = '';
    }
    // Update the tabs classes to allow highlighting of the selected
    var arrElements = ["search-tab-Stylelist2","search-tab-Web2","search-tab-Blog2","search-tab-Video2","search-tab-News2","search-tab-Images2","search-tab-Local2"];
    for (var i=0; i<arrElements.length; i++) {
        getEl(arrElements[i]).className = '';
    }
    getEl(newTarget).className = 'searchCatBg';


    return false;
}

function eventIsEnterKey(event) {
    if (event && event.which == 13 || window.event && window.event.keyCode == 13 || event && event.which == 3 || window.event && window.event.keyCode == 3) {
        return true;
    }
    return false;
}

function submitHeaderSearch(event) {
    if (event == "onclick" || eventIsEnterKey(event)) {
        return srchSub2();        
    } else {
        return true;
    }
}

function srchSub2() {
    var frm=p_o("search");
    var queryval = frm.topquery.value.trim();
    queryval = queryval.replace( /\+/, " ");
    var newurl = frm.action + URLEncode(queryval);
    if (frm.target == '_blank') {
        window.open(newurl, '_blank', '');
    } else {
        window.location = newurl;
    }
    return false;
}

function submitFooterSearch(event) {
    if (event == "onclick" || eventIsEnterKey(event)) {
        return srchSub4();        
    } else {
        return true;
    }
}

function srchSub4() {
    var frm=p_o("search2");
    var queryval = frm.Bottomquery.value.trim();
    queryval = queryval.replace( /\+/, " ");
    var newurl = frm.action + URLEncode(queryval);
    if (frm.target == '_blank') {
        window.open(newurl, '_blank', '');
    } else {
        window.location = newurl;
    }
    return false;
}


//Prevent IE flickr
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

function hideHeaderMore(e) {
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;

	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
	if(targ.id != 'srchMoreAnc' && targ.id != 'srchMoreAnc2') {
 		document.getElementById("srchMoreId").style.display = 'none';
		document.getElementById("srchFootMoreId").style.display = 'none';
	}
}


// ====================================================================
//       URLEncode and URLDecode functions
//
// Copyright Albion Research Ltd. 2002
// http://www.albionresearch.com/
//
// You may copy these functions providing that 
// (a) you leave this copyright notice intact, and 
// (b) if you use these functions on a publicly accessible
//     web site you include a credit somewhere on the web site 
//     with a link back to http://www.albionresearch.com/
//
// If you find or fix any bugs, please let us know at albionresearch.com
//
// SpecialThanks to Neelesh Thakur for being the first to
// report a bug in URLDecode() - now fixed 2003-02-19.
// And thanks to everyone else who has provided comments and suggestions.
// ====================================================================

function URLEncode(textToEncode)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +
// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";
// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var plaintext = textToEncode;
	var encoded = '';
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				//x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			 
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for
	return encoded;
};

document.onclick = hideHeaderMore;
/*end header functions*/

/* clear input box */
function enterTxt(id) {
    var txt = document.getElementById(id);   
    if (txt.defaultValue == txt.value) {
        txt.value = '';
    }
}
/* shared module popup */
function shareWin(url) {
    w = window.open(url,'stylelistShared','resizable=yes,height=534,width=770');
    if (window.focus) {
        w.focus()
    }
    return false;
}
/* common */
var ratingFlg = true; // If user login info available, change this to true else false
var usrRate = 0;
var isAvgFlag;
function fn_miniSignIn(obj, parentUrl, hostname) {
    
    alert("fn_miniSignIn");
    var parDiv = document.createElement("div");
    parDiv.style.position="absolute";
    parDiv.style.zIndex="100";
    parDiv.style.display="inline";
    parDiv.style.margin="22 -17";
    var innerHtml = ajaxCall("miniSignIn.jsp?parentUrl="+encodeURL(parentUrl)+"&hostname="+hostname);
    parDiv.innerHTML= "<div id='snsMiniUI' style='left: 0px; top: -49px; position: relative; z-index: 5000; display: block;'>"+innerHtml+"</div>";
    obj.appendChild(parDiv);
}

function ajaxCall(url) {
    var page_request = false;
    
    if (window.ActiveXObject){ // if IE
        try {
            page_request = new ActiveXObject("Msxml2.XMLHTTP")
        }
        catch (e){
            try{
                page_request = new ActiveXObject("Microsoft.XMLHTTP")
            }
            catch (e){}
        }
    }
    else if (window.XMLHttpRequest) // if Mozilla, Safari etc
        page_request = new XMLHttpRequest()
    else
        return false
    page_request.open('GET', url, false) //get page synchronously
    page_request.send(null);
    return page_request.responseText;
    
}

var channelURN = '';
var galId = '';
var user = '';

function getEl( id ){ return document.getElementById( id ); }

function selCatAsset(navName) {
 var sblog = 'http://www.stylelist.com/blog';
 if (sblog != location.href) {
  if (document.getElementById(navName) !=null) {
   var ulObjARR = document.getElementById(navName).getElementsByTagName('a');
   for (i=0;i<ulObjARR.length;i++) {
    if (ulObjARR[i].href.match(window.location)) {
     ulObjARR[i].className = 'selected';
     i = ulObjARR.length;
    }
   }
  } 
 }
}
window.onload = function() {
 selCatAsset('categories');
}

/* SNS Login Verification */
function loginCheck() {
    var sitedomain1 = 'sitedomain='+sitedomain;
	var url="siteState="+encodeURIComponent("OrigUrl="+encodeURIComponent(window.location));
	if(_sns_isLoggedIn) {
		getEl("userspan").innerHTML="Logged In: "+_sns_current_user;
		getEl("loginlink").href="https://my.screenname.aol.com/_cqr/logout/mcLogout.psp?"+sitedomain1+"&"+url;
		getEl("loginlink").title="Sign Out";  
		getEl("loginlink").innerHTML="Sign Out";
	} else {
		getEl("loginlink").href="https://my.screenname.aol.com/_cqr/login/login.psp?"+sitedomain1+"&"+url;
		getEl("loginlink").title="Sign In";        	
		getEl("loginlink").innerHTML="Sign In";
	 }
}

/* Start code for top DL module Added by Raja J */
var fadeSpeed = 50;
var fadeInterval = 5000;
var isPlaying;

var livingDL = function() {
	var currInx = 0;
	var playTimer;
	var playControl;
	dlListObj = new Array();

	this.init = function(dlCurrInx) {
		var dlList = document.getElementById("dl");
		dlList.style.display="block";
		currInx = 0;
		playControl = document.getElementById("dlControls").getElementsByTagName("a")[1];
		dlList = document.getElementById("dl").getElementsByTagName("div");
		for(i=0;i<dlList.length;i++) {
			if(dlList[i].className=="dlSlide") {
				dlListObj[dlListObj.length] = dlList[i];
				dlList[i].style.opacity = 0;
				dlList[i].style.filter = "alpha(opacity=0)";
			}
		}
		play();
	}
	showNext = function() {
		    	if(dlListObj[currInx]) {
			fadeIn(currInx);
			setTimeout("chgOpacity("+(currInx-1)+")",1000);
		} else {
		currInx=0;
		myDL = new livingDL();
		myDL.init();
		}
	}
	showPrev = function() {
	if(dlListObj[currInx]) {
			chgOpacity(currInx+1);
			snap(currInx);
		} else currInx++;
	}
	chgOpacity = function(inx) {
		if(dlListObj[inx]) {
			dlListObj[inx].style.zIndex = 0;
			dlListObj[inx].style.opacity = 0;
			dlListObj[inx].style.filter = "alpha(opacity=0)";
			dlListObj[inx].getElementsByTagName("div")[0].style.marginTop = "0px";
		}
	}
	snap = function(inx) {
		if(dlListObj[inx]&&dlListObj[inx].style.opacity<1) {
			document.getElementById("dlControls").style.marginRight = "-100px";
			dlListObj[inx].style.zIndex = 1000;
			dlListObj[inx].style.opacity = 1;
			dlListObj[inx].style.filter = "alpha(opacity=100)";
			if(dlListObj[inx].style.opacity<.7) {
				dlListObj[inx].getElementsByTagName("div")[0].style.marginTop = "-"+(dlListObj[inx].style.opacity*100)+"px";
			}
			setTimeout("fadeIn("+inx+")",1);
		} else {
			document.getElementById("dlControls").style.marginRight = "0px";
		}
	}
	fadeIn = function(inx) {
		if(dlListObj[inx]&&dlListObj[inx].style.opacity<1) {
			document.getElementById("dlControls").style.marginRight = "-100px";
			dlListObj[inx].style.zIndex = 1000;
			dlListObj[inx].style.opacity = eval(dlListObj[inx].style.opacity) + .1;
			dlListObj[inx].style.filter = "alpha(opacity="+(dlListObj[inx].style.opacity*100)+")";
			if(dlListObj[inx].style.opacity<.7) {
				dlListObj[inx].getElementsByTagName("div")[0].style.marginTop = "-"+(dlListObj[inx].style.opacity*100)+"px";
			}
			setTimeout("fadeIn("+inx+")",fadeSpeed);
		} else {
			document.getElementById("dlControls").style.marginRight = "0px";
		}
	}
	play = function() {
		if(currInx != 3) {
		document.getElementById('next').style.opacity = "1";
		document.getElementById('next').style.filter = "alpha(opacity=100)";
		document.getElementById('next').href = "javascript:myDL.next();";
		}
		else {
		document.getElementById('next').style.opacity = ".2";
		document.getElementById('next').style.filter = "alpha(opacity=20)";
		document.getElementById('next').href = "javascript:nothing();";
		}
		if(currInx != 1 && currInx != 0) {
		document.getElementById('previous').style.opacity = "1";
		document.getElementById('previous').style.filter = "alpha(opacity=100)";
		document.getElementById('previous').href = "javascript:myDL.prev();";
		}
		if(currInx==0 || currInx==4) {
		document.getElementById('previous').style.opacity = ".2";
		document.getElementById('previous').style.filter = "alpha(opacity=20)";
		}
		else {
		document.getElementById('previous').style.opacity = "1";
		document.getElementById('previous').style.filter = "alpha(opacity=100)";
		}
		playControl.href="javascript:myDL.pause();";
		playControl.className="pause";
		if(currInx==dlListObj.length) {
			chgOpacity(currInx-1);
			currInx = 0;
		}
		showNext();
		playTimer = setTimeout("play()",fadeInterval);
		currInx++; 
		isPlaying = true;
	}
	pause = function() {
		clearTimeout(playTimer);
		playControl.href="javascript:myDL.play();";
		playControl.className="play";
		isPlaying = false;
	}
	this.next = function() {
		if(isPlaying)currInx--;
		pause();
		document.getElementById('previous').style.opacity = '1';
		document.getElementById('previous').style.filter = "alpha(opacity=100)";
		document.getElementById('previous').href = "javascript:myDL.prev();";
		currInx++;
		if(currInx==4){
		currInx=1;}
		if(currInx==3){
		document.getElementById('next').style.opacity = '.2';
		document.getElementById('next').style.filter = "alpha(opacity=20)";
		document.getElementById('next').href = "javascript:nothing();";
		}
		if (currInx !=4) {
		showNext(); 
		}
	}
	this.prev = function() {
		pause();
		document.getElementById('next').style.opacity = '1';
		document.getElementById('next').style.filter = "alpha(opacity=100)";
		document.getElementById('next').href = "javascript:myDL.next();";
		if (currInx==1) {
		document.getElementById('previous').style.opacity = '.2';
		document.getElementById('previous').style.filter = "alpha(opacity=20)";
		document.getElementById('previous').href = "javascript:nothing();";
		}
		currInx--;
		showPrev();
	}
	this.play = function() {
		play();
	}
	this.pause = function() {
		pause();
	}
}
/* End code for top DL module */
function showHatNav(obj) {
    document.getElementById(obj).style.display="block";
}
function hideHatNav(obj) {
    document.getElementById(obj).style.display="none";
}
function selNavTab() {
 
 var links = document.getElementById("LocalNav").getElementsByTagName("ul")[0];
 links = links.getElementsByTagName("a");
 for(i=0;i<links.length;i++) {
  var loc = window.location.toString().toLowerCase();
   var temp=links[i].href;
   if (loc.indexOf(temp)>-1)
   {
	links[i].className="selected";
	
   }
  }
}
function showsubcat() {
 var pvalue=document.getElementById("parentcategory").innerHTML;
 if (pvalue=="Fashion")
 {
   document.getElementById("fashionnav").style.display="block";
 }
 else if(pvalue=="Celebs")
 {
   document.getElementById("celebsnav").style.display="block";
 }
else if(pvalue=="Beauty")
 {
   document.getElementById("beautynav").style.display="block";
 }
 else if(pvalue=="Hair")
 {
   document.getElementById("hairnav").style.display="block";
 }
}

/* Begin: Code for video promo module*/

var vpObject = function() {
    this.totalImg = 0;
    this.vpTimer = 0;
    this.currImg = 0;
    this.imgSrcArray = new Array();
    this.imgCrdArray = new Array();
    this.ovrArray = new Array();
    this.vpOpTimer = 0;
    this.rotInt = 5;
    this.fadeSpeed = 50;
}

function vpClass() {
    var setOpacity = function(mId,id,value) {
        var object = ge(id).style;
        //beat the IE bug
        if(document.all)
            object.zoom=1;
        object.opacity = (value / 10);
    	object.MozOpacity = (value / 10);
    	object.KhtmlOpacity = (value / 10);
    	object.filter = "alpha(opacity=" + value*10 + ")";
    }

    var ovrlayDomCreate = function(mId){
        var mI = window['vpMod_'+mId];
        var d = window.document;
        var pLnk = ge('vpImgLnk_'+mId);
        var imgCnt = ge('vpImgCnt_'+mId);

        a = d.createElement('a');
        a.className = 'ovrLay';
        a.id = 'vpOvrLnk_'+mId;
        a.href = pLnk.href;
        a.innerHTML = '&nbsp;';
        
        wd = d.createElement('div');
        wd.className = 'overLayWrp';
        wd.appendChild(a);
        imgCnt.appendChild(wd);
        pLnk.onclick = ge('lkLst'+mId+'_'+mI.currImg).onclick;
    }

    var next = function(mId) {
        var ovrlayDiv = '<div class="overLayWrp"><a href="http://food.aol.com/tyler-florence?video=3" class="ovrLay" id="vpOvrLnk_12190">&nbsp;</a></div>';
        var objId = 'vpMod_'+mId;
        var mI = window[objId];
        var fadeInt = 0;// fading speed
        //it is necessary to clear the previous timer as the user's next click may break the sequence
        clearTimeout(mI.vpTimer);
        setOpacity(mId,'vpImgCnt_'+mId,10);
        
        //current highlighted list item
        var curlkLst = 'lkLst'+mId+'_'+mI.currImg;
        //fade out the current image
        for(var i=10;i>=0;i--) {
            fn = "vpClassObj.setOpac('"+mId+"','vpImgCnt_" + mId + "','" + i + "')";
            setTimeout(fn,fadeInt);
            fadeInt+=mI.fadeSpeed;;
        }

        //remove the highlight from current list item
        fn = "document.getElementById('"+curlkLst+"').className=''";
        setTimeout(fn,fadeInt);
        
        fn = "window.vpClassObj.showNextWrap('"+mId+"')";
        mI.vpTimer = setTimeout(fn,fadeInt);
    }

    var showNext = function(mId) {
        var objId = 'vpMod_'+mId;
        var mI = window[objId];

            var fadeInt = 0;//fading speed

            if(++mI.currImg >= mI.totalImg) {
                mI.currImg = 0;
            }

            //remove highlight from the current link and add to next link
            var curlkLst = 'lkLst'+mId+'_'+mI.currImg;
            ge(curlkLst).className = "highlight";

            //update credit text , image and the overlay image
            ge('ptCredit_'+mId).innerHTML = mI.imgCrdArray[mI.currImg];
            ge('vpImgCnt_'+mId).innerHTML = mI.imgSrcArray[mI.currImg];
            if(mI.ovrArray[mI.currImg] == 1) {
                ovrlayDomCreate(mId);
            }
            //fade in the new image
            for(var i=0;i<=10;i++) {
                fn = "vpClassObj.setOpac('"+mId+"','vpImgCnt_" + mId + "','" + i + "')";
                mI.vpTimer=setTimeout(fn,fadeInt);
                fadeInt+=mI.fadeSpeed;
            }
            scroll(mId,(mI.rotInt-(mI.fadeSpeed/1000)));
    }

    var prev = function(mId) {
        var objId = 'vpMod_'+mId;
        var mI = window[objId];
        var fadeInt = 0;// fading interval
        //it is necessary to clear the previous timer as the user's next click may break the sequence
        clearTimeout(mI.vpTimer);
        setOpacity(mId,'vpImgCnt_'+mId,10);
        
        //current highlighted list item
        var curlkLst = 'lkLst'+mId+'_'+mI.currImg;
        //fade out the current image
        for(var i=10;i>=0;i--) {
            fn = "vpClassObj.setOpac('"+mId+"','vpImgCnt_" + mId + "','" + i + "')";
            setTimeout(fn,fadeInt);
            fadeInt+=mI.fadeSpeed;;
        }

        //remove the highlight from current list item
        fn = "document.getElementById('"+curlkLst+"').className=''";
        setTimeout(fn,fadeInt);
        
        fn = "window.vpClassObj.showPrevWrap('"+mId+"')";
        mI.vpTimer = setTimeout(fn,fadeInt);
    }
    
    var showPrev = function(mId) {
        var objId = 'vpMod_'+mId;
        var mI = window[objId];

        var fadeInt = 0;//fading speed
            
        if(--mI.currImg < 0) {
            mI.currImg = parseInt(mI.totalImg-1);
        }

		//remove highlight from the current link and add to next link
		var curlkLst = 'lkLst'+mId+'_'+mI.currImg;
		ge(curlkLst).className = "highlight";

		//update credit text and image
		ge('ptCredit_'+mId).innerHTML = mI.imgCrdArray[mI.currImg];
		ge('vpImgCnt_'+mId).innerHTML = mI.imgSrcArray[mI.currImg];
		if(mI.ovrArray[mI.currImg] == 1) {
			ovrlayDomCreate(mId);
		}
		//fade in the new image
		for(var i=0;i<=10;i++) {
			fn = "vpClassObj.setOpac('"+mId+"','vpImgCnt_" + mId + "','" + i + "')";
			mI.vpTimer=setTimeout(fn,fadeInt);
			fadeInt+=mI.fadeSpeed;
		}
		scroll(mId,(mI.rotInt-(mI.fadeSpeed/1000)));
    }
    
    var scroll = function(mId,time) {
        var objId = 'vpMod_'+mId;
        mI = window[objId];
        var fn = "window.vpClassObj.vpNextImg('"+mId+"')";
        mI.vpTimer = setTimeout(fn,1000*time);
    }

    var ge = function(id){return document.getElementById(id);}
    
    return {
    
        vpNextImg : function(mId) {
            next(mId);
        },
        
        vpPrevImg : function(mId) {
            prev(mId);
        },
        
        autoScroll : function(mId,time) {
            scroll(mId,time);
        },
        
        stopScroll : function(mId) {
            var objId = 'vpMod_'+mId;
            mI = window[objId];
            clearTimeout(mI.vpTimer);
        },
        
        setOpac : function(mId,objId,value) {
            setOpacity(mId,objId,value);
        },
        
        showNextWrap: function(mId) {
            showNext(mId);
        },
        
        showPrevWrap: function(mId) {
            showPrev(mId);
        }
    };
}

var vpClassObj = new vpClass();
/* End code for video promo module */


function selMainNav() {
 
 var pvalue=document.getElementById("parentcategory").innerHTML;
 if(pvalue=="main")
 {
  document.getElementById("maintopnav").className="selected";
 }
 else if(pvalue=="Fashion")
 {
  document.getElementById("fashion").className="selected";
 }
 else if(pvalue=="Hair")
 {
  document.getElementById("hair").className="selected";
 }
 else if(pvalue=="Beauty")
 {
  document.getElementById("beauty").className="selected";
 }
 else if(pvalue=="Celebs")
 {
  document.getElementById("celeb").className="selected";
 }
 else if(pvalue=="Style News")
 {
  document.getElementById("news").className="selected";
 }
 else if(pvalue=="Shopping")
 {
  document.getElementById("shopping").className="selected";
 }
 else if(pvalue=="Contest")
 {
  document.getElementById("contest").className="selected";
 }
}
function showHeadernav(obj) {
    document.getElementById(obj).style.display="block";
    var temp=document.getElementById(obj).parentNode.getElementsByTagName('a');
    temp[0].style.background='#c6d9d9';
}
function hideHeadernav(obj) {
    document.getElementById(obj).style.display="none";
    var temp=document.getElementById(obj).parentNode.getElementsByTagName('a');
    if(temp[0].className!="selected"){
     temp[0].style.background='none';
    }
    else{
     temp[0].style.background='white';
    }
}

/*form submission*/

function sendFashion(){
var Comments = "Email: " + $('[name=AuthorEmail]').val()+ "\n";
Comments += "Your Question: " + $('[name=yourQuestion]').val()+ "\n";
$('[name=Comments]').val(Comments);
}
function sendBeauty(){
var Comments = "Email: " + $('[name=AuthorEmail]').val()+ "\n";
Comments += "Your Question: " + $('[name=yourQuestion]').val()+ "\n";
$('[name=Comments]').val(Comments);
}
function sendHair(){
var Comments = "Email: " + $('[name=AuthorEmail]').val()+ "\n";
Comments += "Your Question: " + $('[name=yourQuestion]').val()+ "\n";
$('[name=Comments]').val(Comments);
}
function sendCeleb(){
var Comments = "Email: " + $('[name=AuthorEmail]').val()+ "\n";
Comments += "Your Question: " + $('[name=yourQuestion]').val()+ "\n";
$('[name=Comments]').val(Comments);
}

/*color and bgimage swaps */
function swapColor() {  
for (i=1;i<5;i++) {
document.getElementById("slideAction"+i).style.color = '#fff'; 
document.getElementById("dlbg"+i).style.backgroundColor ='#b5025e'; 
 }
}  

function returnColor() {  
for (i=1;i<5;i++) {
document.getElementById("slideAction"+i).style.color = '#A2E2EA'; 
document.getElementById("dlbg"+i).style.backgroundColor ='#172741';  
 } 
}

function swapCott() {
  document.getElementById("basebg1").style.backgroundColor = '#b5025e';
  document.getElementById("subhead1").style.color = '#fff';
}
function returnCott() {
  document.getElementById("basebg1").style.backgroundColor = '#172741';
  document.getElementById("subhead1").style.color = '#A2E2EA';
}
function swapCott2() {
  document.getElementById("basebg2").style.backgroundColor = '#b5025e';
  document.getElementById("subhead2").style.color = '#fff';
}
function returnCott2() {
  document.getElementById("basebg2").style.backgroundColor = '#172741';
  document.getElementById("subhead2").style.color = '#A2E2EA';
}
function swapCott3() {
  document.getElementById("basebg3").style.backgroundColor = '#b5025e';
  document.getElementById("subhead3").style.color = '#fff';
}
function returnCott3() {
  document.getElementById("basebg3").style.backgroundColor = '#172741';
  document.getElementById("subhead3").style.color = '#A2E2EA';
}

function swapHubDl() {
document.getElementById("dlbg").style.backgroundColor = '#b5025e';
}
function returnHubDl () {
document.getElementById("dlbg").style.backgroundColor = '#172741';
}

function swapTwoUp() {
document.getElementById("twoupbase").style.backgroundColor = '#b5025e';
}
function returnTwoUp () {
document.getElementById("twoupbase").style.backgroundColor = '#172741';
}

function swapTwoUp2() {
document.getElementById("twoupbase2").style.backgroundColor = '#b5025e';
}
function returnTwoUp2 () {
document.getElementById("twoupbase2").style.backgroundColor = '#172741';
}

function hoveronsearch(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/search_btn_01_hover1023.gif)";
}
function hoveroffsearch(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/piya.sandbox.stylelist.com/blog/media/search_btn_01.gif)";
}
function hoveronrrbutton(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/rr_button_hover_1023.gif)";
}
function hoveroffrrbutton(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/RR_button_1012.gif)";
}
function hoveronvideoprev(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/video_mod_back_hover_1023.gif)";
}
function hoveroffvideoprev(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/video_mod_back.gif)";
}
function hoveronvideonext(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/video_mod_next_hover_1023.gif)";
}
function hoveroffvideonext(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/video_mod_next.gif)";
}
function hoveronfollowbutton(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/follow-us-box-hover1023.gif)";
}
function hoverofffollowbutton(obj){
document.getElementById(obj).style.backgroundImage="url(http://www.blogsmithmedia.com/www.stylelist.com/blog/media/follow-us-box.gif)";
}