
function toggleMe(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block";
  } else {
    e.style.display="none";
  }
  return true;
}

function toggleMe2(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none" || e.style.display==""){
    e.style.display="block";
    e.style.margin="0 8px 10px 0";
  } else {
    e.style.display="none";
    e.style.margin="0 8px 0 0";
  }
  return true;
}

function toggleMe3(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none" || e.style.display==""){
    e.style.display="block";
    e.style.margin="0 8px 10px 0";
  } 
  return true;
}

function toggleMe4(){	
  	if(document.getElementById("fieldset-price")){
		document.getElementById("fieldset-price").style.display="none";
		document.getElementById("fieldset-price").style.margin="0 8px 0 0";
		document.getElementById("fieldset-designer").style.display="none";
		document.getElementById("fieldset-designer").style.margin="0 8px 0 0";
		document.getElementById("fieldset-style").style.display="none";
		document.getElementById("fieldset-style").style.margin="0 8px 0 0";
		document.getElementById("fieldset-color").style.display="none";
		document.getElementById("fieldset-color").style.margin="0 8px 0 0";
  	}

  return true;
}

function customspacers(){
	//shirt neck
	
	var dataTitle = document.getElementById("customspacers").getElementsByTagName("dt");
	var data = document.getElementById("customspacers").getElementsByTagName("dd");
	var len = dataTitle.length;
	
	if(len<8){
		document.getElementById("customspacers").style.top = "-15px";
	}
	for(var i=4; i<len-1; i++){
		dataTitle[i].style.position = "relative";
		dataTitle[i].style.top = "50px";
		data[i].style.position = "relative";
		data[i].style.top = "50px";
	}
	
	dataTitle[len-1].style.position = "relative";
	dataTitle[len-1].style.top = "460px";	
	data[len-1].style.position = "relative";
	data[len-1].style.top = "460px";	
	
	if(dataTitle[len-2].innerHTML.search("Vest") > -1){
		dataTitle[len-2].style.position = "relative";
		dataTitle[len-2].style.top = "250px";	
		data[len-2].style.position = "relative";
		data[len-2].style.top = "250px";
	}
	
	
}

function changecolors(name){
	if(trim(name) == "100% Silk 4-in Hand Formal Neck Tie (Black)" || trim(name) == "100% Silk Cummerbund & Bow Tie Set"){

					document.getElementById("customspacers").innerHTML = document.getElementById("customspacers").innerHTML.replace('<option value="5059">Black </option><option value="5060">White </option><option value="5061">Red </option><option value="5062">Light Pink </option><option value="5063">Hot Pink </option><option value="5064">Emerald Green </option><option value="5065">Hunter Green </option><option value="5066">Royal Blue </option><option value="5067">Navy Blue </option><option value="5068">Mustard/ Gold </option><option value="5069">Lavendar </option><option value="5070">Purple </option><option value="5071">Light Grey </option><option value="5072">Ivory </option>','<option value="5059">Black </option><option value="5060">White </option><option value="5061">Red </option>');
			
	}else if(trim(name) == "Poly/Satin Cummerbund and Bow Tie Set - Available in Many Colors" ){
								document.getElementById("customspacers").innerHTML = document.getElementById("customspacers").innerHTML.replace('<option value="5059">Black </option><option value="5060">White </option><option value="5061">Red </option>','<option value="5059">Black </option><option value="5060">White </option><option value="5061">Red </option><option value="5062">Light Pink </option><option value="5063">Hot Pink </option><option value="5064">Emerald Green </option><option value="5065">Hunter Green </option><option value="5066">Royal Blue </option><option value="5067">Navy Blue </option><option value="5068">Mustard/ Gold </option><option value="5069">Lavendar </option><option value="5070">Purple </option><option value="5071">Light Grey </option><option value="5072">Ivory </option>');		
	} 
}

function iefix(){
	document.getElementById("product-left-column").style.marginTop="-375px";	
}

//must add  onload="menuexpand()" to 2columns-left.phtml
function menuexpand() {
	var path = location.pathname;
	var styleid = path

	styleid = path.substring(path.indexOf("/",2)+1,path.indexOf("."));
	styleid = path.replace("-","");
	
	//document.getElementById("logo").innerHTML = path + " PATH";
	
	//not working properly apparently if document.getElementById(styleid) doesn't exists it = null
	if(document.getElementById(styleid) != null){
		document.getElementById(styleid).style.display = "block";
	}
		
}

