// Site functionality
// Requires: prototype.js + tuksi.js
// Author: Andreas Mailand, ama@dwarf.dk




// aktiver javascript - inden indhold er loadet ind
Tuksi.prototype.preInit = function(){

}

// aktiver javascript - efter indhold er loadet ind
Tuksi.prototype.postInit = function(){
	// sIFR activation
	// Replacement calls. Please see documentation for more information.
  
  if(document.getElementsByClassName("mFashionImageBoxContent").length > 0) {
    document.getElementsByClassName("mFashionImageBoxContent").each(function(elm) {
      Event.observe(elm, 'mouseover', function() {
        elm.addClassName('mFashionImageBoxHover');
      });
      Event.observe(elm, 'mouseout', function() {
        elm.removeClassName('mFashionImageBoxHover');
      });      
    });
  }
  
	if(typeof sIFR == "function"){
	
		/* mainSubMenu
		sIFR.replaceElement(named({
			sSelector:".mainSubMenu ul li span",
			sFlashSrc:"/flash/helvetica_neue_medium_condensed.swf",
			sColor:"#4b5e77",
			sWmode:"transparent",
			sFlashVars:"textalign=left",
			sCase:"upper"
		}));*/
		
		// header1
		if (document.getElementsByClassName("layout1").length || document.getElementsByClassName("layout2").length || document.getElementsByClassName("layout7").length || document.getElementsByClassName("layout71").length || document.getElementsByClassName("layout8").length || document.getElementsByClassName("layout10").length){
			sIFR.replaceElement(named({
				sSelector:".layout1 h2 span.header1, .layout2 h2 span.header1, .layout7 h2 span.header1, .layout71 h2 span.header1, .layout8 h2 span.header1, .layout10 h2 span.header1",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#947cdb",
				sWmode:"transparent",
				sFlashVars:"textalign=center",
				sCase:"upper"
			}));

			// header2
			sIFR.replaceElement(named({
				sSelector:".layout1 h2 span.header2, .layout2 h2 span.header2, .layout7 h2 span.header2, .layout71 h2 span.header2, .layout8 h2 span.header2, .layout10 h2 span.header2",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#1f1f1f",
				sWmode:"transparent",
				sFlashVars:"textalign=center",
				sCase:"upper"
			}));
		}
		// Club mClubLinkBox
		if (document.getElementsByClassName("mClubLinkBox").length){
			//mClubLinkBox header1
			sIFR.replaceElement(named({
				sSelector:".mClubLinkBox .bigLink h2 .header1",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#947cdb",
				sWmode:"transparent",
				sFlashVars:"textalign=left",
				sCase:"upper"
			}));

			// mClubLinkBox header2
			sIFR.replaceElement(named({
				sSelector:".mClubLinkBox .bigLink h2 .header2",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#1f1f1f",
				sWmode:"transparent",
				sFlashVars:"textalign=left",
				sCase:"upper"
			}));
		}
		// newsarchive month and year
		if (document.getElementsByClassName("m7").length){
			sIFR.replaceElement(named({
				sSelector:".m7 .newsTitle span",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed_cyrillic.swf",
				sColor:"#505577",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// news titles
		if (document.getElementsByClassName("m6").length){
			sIFR.replaceElement(named({
				sSelector:".m6 h3",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed_cyrillic.swf",
				sColor:"#9f9aac",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// jobs title
		if (document.getElementsByClassName("m5").length){
			sIFR.replaceElement(named({
				sSelector:".m5 h3",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed_cyrillic.swf",
				sColor:"#9f9aac",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}

		// newsarchive listed headers
		if (document.getElementsByClassName("m7").length){
			/* sIFR.replaceElement(named({
				sSelector:".m7 .newsSummaryTitleInner2",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed.swf",
				sColor:"#74717a",
				sWmode:"transparent",
				sCase:"upper",
				sFlashVars:"offsetTop=3"
			})); */

			// newsarchive news headers
			sIFR.replaceElement(named({
				sSelector:".m7 h3",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed_cyrillic.swf",
				sColor:"#6e74a6",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		
		// newsarchive news blockquotes
		if (document.getElementsByClassName("m7").length || document.getElementsByClassName("m47").length){
			sIFR.replaceElement(named({
				sSelector:".m7 blockquote div, .m47 blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#4e50a1",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		
		// m4 blockquotes
		if (document.getElementsByClassName("m4").length || document.getElementsByClassName("m46").length){
			sIFR.replaceElement(named({
				sSelector:".m4 blockquote div, .m46 blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#6a6b88",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// m42 blockquoutes
		if (document.getElementsByClassName("m42").length){
			sIFR.replaceElement(named({
				sSelector:".m42 blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#48cd3a",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// m42 contentInner
		if (document.getElementsByClassName("m42").length || document.getElementsByClassName("m51").length || document.getElementsByClassName("mClubEventPage").length){
			sIFR.replaceElement(named({
				sSelector:".m42 .contentInner div, .m51 .contentInner div, .mClubEventPage .eventImage h4",
				sFlashSrc:"/flash/gabriel_weiss.swf",
				sColor:"#757575",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// m43 blockquoutes style when no color
		if (document.getElementsByClassName("m43").length || document.getElementsByClassName("m45").length){
			sIFR.replaceElement(named({
				sSelector:".m43 .tst blockquote div, .m45 .tst blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#c3c4c5",
				sWmode:"transparent",
				sCase:"upper"
			}));
			// m43 & 45 blockquoutes style when no color
			sIFR.replaceElement(named({
				sSelector:".m43 .tst0 blockquote div, .m45 .tst0 blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#c3c4c5",
				sWmode:"transparent",
				sCase:"upper"
			}));
			// m43 & 45 blockquoutes style 1
			sIFR.replaceElement(named({
				sSelector:".m43 .tstBlue blockquote div, .m45 .tstBlue blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#2134c3",
				sWmode:"transparent",
				sCase:"upper"
			}));
			// m43 blockquoutes style 2
			sIFR.replaceElement(named({
				sSelector:".m43 .tstGray blockquote div, .m43 .tstGrey blockquote div, .m45 .tstGray blockquote div, .m45 .tstGrey blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#c3c4c5",
				sWmode:"transparent",
				sCase:"upper"
			}));
			// m43 blockquoutes style 3 (Club)
			sIFR.replaceElement(named({
				sSelector:".layout71 .m43 .tstPurple blockquote div, .layout71 .m45 .tstPurple blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#a881b9",
				sWmode:"transparent",
				sCase:"upper"
			}));
			// m43 blockquoutes style 3
			sIFR.replaceElement(named({
				sSelector:".m43 .tstPurple blockquote div, .m45 .tstPurple blockquote div",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#6434a7",
				sWmode:"transparent",
				sCase:"upper"
			}));
			
		}
		
		// m43 blockquoutes style 3
		if (document.getElementsByClassName("m43").length || document.getElementsByClassName("m44").length){
			sIFR.replaceElement(named({
				sSelector:".m43 .caption, .m44 .caption",
				sFlashSrc:"/flash/gabriel_weiss.swf",
				sColor:"#757575",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// franchise headers
		if (document.getElementsByClassName("m47").length || document.getElementsByClassName("m48").length){
			sIFR.replaceElement(named({
				sSelector:".m47 h3, .m48 h3",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed_cyrillic.swf",
				sColor:"#636068",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// productitems headers
		if (document.getElementsByClassName("m11").length || document.getElementsByClassName("m12").length || document.getElementsByClassName("m80").length){
			sIFR.replaceElement(named({
				sSelector:".m11 h2, .m12 h2, .m80 h2",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed_cyrillic.swf",
				sColor:"#251a54",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// m15 textExtra2 - not possible to show, because of display error in browsers
/* 		sIFR.replaceElement(named({
			sSelector:".m15 .textExtra2 span",
			sFlashSrc:"/flash/helvetica_neue_light.swf",
			sColor:"#48cd3a",
			sWmode:"transparent",
			sCase:"upper"
		})); */

		// .m15 .latestEntry .photo div.fText
		if (document.getElementsByClassName("m15").length){
	 		sIFR.replaceElement(named({
				sSelector:".m15 .latestEntry .photo div.fText",
				sFlashSrc:"/flash/gabriel_weiss.swf",
				sColor:"#757575",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		// fashion frontpage h2 headers
		if (document.getElementsByClassName("m16").length || document.getElementsByClassName("m17").length || document.getElementsByClassName("m18").length){
			sIFR.replaceElement(named({
				sSelector:".m16 h2 span, .m17 h2 span, .m18 h2 span",
				sFlashSrc:"/flash/helvetica_neue_medium_condensed_cyrillic.swf",
				sColor:"#969696",
				sWmode:"transparent",
				sCase:"upper",
				nPaddingBottom: "5"
			}));
		}
		if (document.getElementsByClassName("m17").length || document.getElementsByClassName("m18").length){
			sIFR.replaceElement(named({
				sSelector:".m17 h3 span, .m18 h3 span",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#969696",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		if (document.getElementsByClassName("chooseCountry").length){
			sIFR.replaceElement(named({
				sSelector:".chooseCountry ul li",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#646464",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
		if (document.getElementsByClassName("m92").length){
			sIFR.replaceElement(named({
				sSelector:".m92 h1",
				sFlashSrc:"/flash/helvetica_neue_cyrillic_light_condensed.swf",
				sColor:"#4aa745",
				sWmode:"transparent",
				sCase:"upper"
			}));
		}
	}
}


// change url using a selectbox
function changeUrlSelect(oThis){
	
	return false;
	oDestination = oThis.options[oThis.selectedIndex].value;
	if (oDestination) location.href = oDestination;
}

function showColorPicker(oThis,sColor,sName){
	oPicker = $('colorPicker');
	oSquare = $('colouredSquare');
	oColorId = $('colorid');
	if (oPicker.style.top == "-9000px" || oPicker.style.top == "" && oThis)
		oPicker.style.top = (oThis.offsetTop+oThis.parentNode.parentNode.offsetTop+ 14) + "px";
	else {
		oPicker.style.top = "-9000px";
		if (oSquare && oColorId && sColor){
			oSquare.style.color = sColor;
			oSquare.style.border = "1px #bfd0e6 solid";
			oSquare.style.backgroundColor = sColor;
			oColorId.value = sName;
		}
	}
}

function infoBox(sBox,oThis){
	var oBox = $("box"+sBox);
	var oContainer = oBox.parentNode;
	var aBoxes = oContainer.getElementsByTagName("div");
	var aA = oContainer.getElementsByTagName("a");
	
	// move on if the environment is correct 
	if (oBox && oContainer && oThis){
	
		// check if the button pressed, is inside the actual infobox
		if (oThis.className == "infoBoxClose"){
			var aList = $("infoBottom").getElementsByTagName("ul")[0].getElementsByTagName("a");
			for(var i=0;i<aList.length;i++){
				if (sBox.toLowerCase() == aList[i].className){
					oThis = aList[i];
				}
			}
		}
		
		// run through all links in list and check them as not open and ignore the one we clicked
		for (i=0;i<aA.length;i++){
			if (aA[i].parentNode.tagName.toLowerCase() == "li" && aA[i] != oThis){
				aA[i].style.backgroundImage = "url(/images/graphics/gx_" + aA[i].className.toLowerCase() + ".gif)";
				aA[i].parentNode.style.backgroundImage = "url(/images/graphics/gx_yellow_blue_arrow_right.gif)";
				aA[i].parentNode.style.backgroundPosition = "100% 0%";
				aA[i].parentNode.style.paddingRight = "13px";
			}
		}

		// if the one we clicked is not activated, activate it
		if (oThis.style.backgroundImage.indexOf("active") < 0){
			oThis.style.backgroundImage = "url(/images/graphics/gx_" + sBox.toLowerCase() + "_active.gif)";
			oThis.parentNode.style.backgroundImage = "url(/images/graphics/gx_yellow_blue_arrow_down.gif)";
			oThis.parentNode.style.backgroundPosition = "100% 20%";
			oThis.parentNode.style.paddingRight = "17px";
		} else { // if it was activated, deactivate it
			oThis.style.backgroundImage = "url(/images/graphics/gx_" + sBox.toLowerCase() + ".gif)";
			oThis.parentNode.style.backgroundImage = "url(/images/graphics/gx_yellow_blue_arrow_right.gif)";
			oThis.parentNode.style.backgroundPosition = "100% 0%";
			oThis.parentNode.style.paddingRight = "13px";
		}
			
		// if the selected box was disabled, disable the other boxes and open only the selected box
		if (oBox.style.visibility == "hidden" || oBox.style.visibility == ""){
			// run through all the boxes and disable them
			for (i=0;i<aBoxes.length;i++){
				if (aBoxes[i].className == "infoExtraBox"){
					aBoxes[i].style.visibility = "hidden"
				}
			}
			oBox.style.visibility = "visible";
		}
		else { // if the selected box was already active, disable it 
			oBox.style.visibility = "hidden";
		}
		// remove focus from link, so there will be no bounding box
		oThis.blur();
	}
}

function askAFriend(iState){
	if (iState){
		$("askAFriend").style.display = "block";
		$("infoBottom").style.display = "none";
	} else {
		$("askAFriend").style.display = "none";
		$("infoBottom").style.display = "block";
	}
}

function deleteFromCart(id,sessionid){
	var url = "/services/ajaxhandler.php?action=deletefromcart&session_id="+sessionid+"&product_id="+id;
	new Ajax.Request(url,{method:'GET',onFailure:function(r){cartFailure(r);},onComplete:function(r){deleteFromCartSuccess(r);}});
}

function deleteFromCartSuccess(r){
	var status = r.responseXML.getElementsByTagName('status').item(0).firstChild.data;
	
	if (status=="ok"){
		
		var id = r.responseXML.getElementsByTagName('id').item(0).firstChild.data;
		var item = $('cartItem'+id);
		if (item){
			Effect.BlindUp('cartItem'+id, {afterFinish: delBox});
		}
	}
}

// gives display = none to the specified object 
function delBox (oObj){
	oObj.element.style.display = "none";
}

function addToCart(id,sessionid){
	
	if (1==1){
		var url = "/services/ajaxhandler.php?action=addtocart&session_id="+sessionid+"&product_id="+id+"&cid="+$('askAFriendPic').value;
		new Ajax.Request(url,{method:'GET',onFailure:function(r){cartFailure(r);},onComplete:function(r){addToCartSuccess(r);}});
		bAddedToCart = true;
	}else{
		Effect.Appear('existInCart');
		new Effect.Highlight('existInCart');
		Effect.Fade('existInCart', {delay: 4});
	}
	return bAddedToCart;
}


function addToCartSuccess(r){
	var status = r.responseXML.getElementsByTagName('status').item(0).firstChild.data;
	if (status=="ok"){
		Effect.Appear('addedToCart');
		new Effect.Highlight('addedToCart');
		Effect.Fade('addedToCart', {delay: 4});
	}
	else if(status=='exist'){
		Effect.Appear('existInCart');
		new Effect.Highlight('existInCart');
		Effect.Fade('existInCart', {delay: 4});
			
	}
}

function askAFriendSend(){
	var arrSend = new Array();
	arrSend[0] = 'askFriendName1';
	arrSend[1] = 'askFriendMail1';
	arrSend[2] = 'askFriendName2';
	arrSend[3] = 'askFriendMail2';
	arrSend[4] = 'mid';
	arrSend[5] = 'askAFriendPic';
	arrSend[6] = 'askFriendMessage';
	//arrSend[4] = 'askFriendProductId';
	
	var strUrl = "";
		
	for(var c=1;c<5;c++){
		if (document.getElementById('askFriendQuest'+c).checked){
			if (document.getElementById('askFriendQuest'+c).value!=0){
				strUrl+= "&askFriendQuest="+escape(document.getElementById('askFriendQuest'+c).value);	
			}else{
				strUrl+= "&askFriendQuest="+escape(document.getElementById('askFriendSpecial').value);
				strUrl+= "&isCustom=1";
			}
			
			break;
		}
	}
	
	
	
	
	for(var c=0;c<arrSend.length;c++){
		if (document.getElementById(arrSend[c]).value){
			strUrl+="&"+arrSend[c]+"="+escape(document.getElementById(arrSend[c]).value);	
		}
		
	}
	var url = "/services/ajaxhandler.php?action=askafriend"+strUrl;
	new Ajax.Request(url,{method:'GET',onFailure:function(r){cartFailure(r);},onComplete:function(r){askAFriendSendSuccess(r);}});
	
}



function lookUpStore(){
	
	var url = "/services/ajaxhandler.php?action=storelookup&cid="+$('CountrySelector').value+"&areaname="+escape($('AreaSelector').value);
	new Ajax.Request(url,{method:'GET',onFailure:function(r){cartFailure(r);},onComplete:function(r){storeLookupSucces(r);}});
	
}

function storeLookupSucces(r){
	$('resultsContainer').style.display="block";
	if (r.responseXML){
		$('resultsContainer').innerHTML = r.responseXML.getElementsByTagName('result').item(0).firstChild.data;	
	}
	
}

function selectStore(storeid){
	var html = ""+$('chosenStoreContent'+storeid).innerHTML;
	$('resultsContainer').style.display="none";
	
	
	//Effect.Fade('chosenStoreContainer', {delay: 0});
	$('myFavouriteShop').addClassName("show");
	$('chosenStoreContainer').addClassName("shopSelected").innerHTML = "<div>"+ html +"</div>";
	$('b_shopid').value=storeid;
	//Effect.Appear('chosenStoreContainer');
	//Effect.Appear('chosenStoreContainer');
	
}

function signUpNewsletter(moduleid){
	
	var objName = $('name'+moduleid);
	var objEmail = $('email'+moduleid);
	var objBoth = $('both'+moduleid);
	
	var name,email;
	if(objName){
		name=objName.value;
	}else{
		name="";
	}
	
	if (objEmail){
		email=objEmail.value;
	}else{
		email="";
	}

	var strUrl="";
	strUrl+= "&name="+name;
	strUrl+= "&email="+email;
	strUrl+= "&moduleid="+moduleid;
	
	
	if (objBoth && objBoth.checked){
		strUrl+= "&both=1";
	}
	
	
	var url = "/services/ajaxhandler.php?action=signupnewsletter"+strUrl;
	new Ajax.Request(url,{method:'GET',onFailure:function(r){cartFailure(r);},onComplete:function(r){signUpNewsletterSuccess(r,moduleid);}});
	
}

function signUpNewsletterSuccess(r,moduleid){
	var status = r.responseXML.getElementsByTagName('status').item(0).firstChild.data;
	if (status=="ok"){
	 new Effect.BlindDown("signUpNewsletter"+moduleid);
	}else{
		
		var intCount = 0;
		while(r.responseXML.getElementsByTagName('noerror').item(intCount)){
			
			var name = r.responseXML.getElementsByTagName('noerror').item(intCount).firstChild.data;
			var currObj = document.getElementById(name+moduleid+"_label");
			if (currObj){
				document.getElementById(name+moduleid+"_label").style.color="#3A3A3A";
			}
			intCount++;
		}
		
		var intCount = 0;
		while(r.responseXML.getElementsByTagName('error').item(intCount)){
			
			var name = r.responseXML.getElementsByTagName('error').item(intCount).firstChild.data;
			var currObj = document.getElementById(name+moduleid+"_label");
			if (currObj){
				document.getElementById(name+moduleid+"_label").style.color="red";
			}
			intCount++;
		}
		
		
		
	}
}



function askAFriendSendSuccess(r){
	var status = r.responseXML.getElementsByTagName('status').item(0).firstChild.data;
	if (status=="ok"){
		
		Effect.Appear('askAFriendSendSucces');
		new Effect.Highlight('askAFriendSendSucces');
		
		
		Effect.Fade('askAFriend', {delay: 3});
		Effect.Appear('infoBottom', {delay:3});
		
		$('formAskAFriend').reset();
		Effect.Fade('askAFriendSendSucces', {delay: 2});
		
	}else{
		
		var intCount = 0;
		while(r.responseXML.getElementsByTagName('noerror').item(intCount)){
			
			var name = r.responseXML.getElementsByTagName('noerror').item(intCount).firstChild.data;
			var currObj = document.getElementById(name+"_label");
			if (currObj){
				document.getElementById(name+"_label").style.color="#3A3A3A";
			}
			intCount++;
		}
		
		var intCount = 0;
		while(r.responseXML.getElementsByTagName('error').item(intCount)){
			
			var name = r.responseXML.getElementsByTagName('error').item(intCount).firstChild.data;
			var currObj = document.getElementById(name+"_label");
			if (currObj){
				document.getElementById(name+"_label").style.color="red";
			}
			intCount++;
		}
		
		
		
	}
}


function cartFailure(r){
	
}

// show or hide the latest blog entry on fashion frontpage
function showBlogEntry(oThis){
	oEntry = $("latestEntry");
	oEntryText = $("latestEntryText");
	oEntryLetter = $("latestEntryLetter");
	if (oEntry.style.display == "none"){
		Effect.BlindDown(oEntry);
		oThis.style.backgroundImage = "url(/images/graphics/gx_read_the_fashion_blog_active.png)";
		
	} else {
		Effect.BlindUp(oEntry);
		oThis.style.backgroundImage = "url(/images/graphics/gx_read_the_fashion_blog.png)";
	}
}

// shop locator functionality for showing or hiding extended info
function shopLocator(oThis){
	oExtended = oThis.nextSibling;

	// run through the elements to jump over the text tags
	while (oExtended.nodeName == ("#text")){
		oExtended = oExtended.nextSibling;
	}
	
	if (oExtended.style.display == "block"){
		oThis.style.background = "url(/images/graphics/gx_arrow_right_gray.gif) no-repeat 100% 98%";
//		Effect.BlindUp(oExtended);
		oExtended.style.display = "none";
		oThis.blur();
	} else {
		oThis.style.background = "url(/images/graphics/gx_arrow_down_gray.gif) no-repeat 100% 98%";
//		Effect.BlindDown(oExtended);
		oExtended.style.display = "block";
		oThis.blur();
	}
}

// collection products - change between different product colors
function shiftPicture(iId,iColorId){
	
	var oImg = $("prodImg"+iId);
	var oBox = $("productImage");
	if (oBox && oImg){ // if both elements exists
		var oBoxImgs = oBox.getElementsByTagName("img");
	
		for (i=0; i<oBoxImgs.length; i++){
			if (oBoxImgs[i] == oImg)
				oBoxImgs[i].style.display = "block";
			else
				if (oBoxImgs[i].id != "noveltyFlag"){
					oBoxImgs[i].style.display = "none"
				}
		}
		$("askAFriendPic").value = iColorId;
	}
	var oImg = $("prodImg2"+iId);
	var oBox = $("askAFriend");
	if (oBox && oImg){ // if both elements exists
		var oBoxImgs = oBox.getElementsByTagName("img");
	
		for (i=0; i<oBoxImgs.length; i++){
			if (oBoxImgs[i] == oImg)
				oBoxImgs[i].style.display = "block";
			else
				oBoxImgs[i].style.display = "none"
		}

	}
}

function gotoCampaign(){
	
	var obj = $('campaignchooserselect');
	for(i=obj.options.length-1;i>=0;i--){
		if (i==$('campaignchooserselect').selectedIndex){
			window.location = ('/'+obj.options[i].value);
			break;
		}
	}
	return false;

}

function setCampaignSelect(id){
	$('year'+id).toggle();
	$('year'+$F('cctoggle')).toggle();
	$('cctoggle').value = id;
	
//	$('link').href="/"+$('year'+id).value;
}

//

function jobDisplay(sObj){
	oObj = $(sObj);
	oObj2 = $(sObj+"_2");
	if (oObj2.style.display == "none" || !oObj2.style.display){
		oObj.style.display = "none";
		oObj2.style.display = "block";
	} else {
		oObj.style.display = "block";
		oObj2.style.display = "none";
	}
}

function PopShoecare(){
	
	window.open('/shoecare/', 'pop', 'width=730,height=530,status=no,toolbar=no,scrollbars=0,menubar=no,screenX=0,screenY=0,resizable=0');
}

function setCatalogOption(obj){
	
	if ((obj.options.length-1)==obj.selectedIndex){
		Element.hide('showcatalog');		
		Element.hide('address');
	}else{
		Element.show('showcatalog');
		if ($('catalog').checked){
			Element.show('address');	
		}else{
			Element.hide('address');
		}
	}
	
}

