/*
function addBookMark() {
 alert('in');
 	if (window.sidebar && window.sidebar.addPanel) {
			window.sidebar.addPanel('Solestruck - A Passion for Shoes', 'http://www.solestruck.com','');
	} else {
			window.external.AddFavorite('http://www.solestruck.com','Solestruck - A Passion for Shoes');
	}
	
	
}
*/ 
function addBookMark() {
     var ua=navigator.userAgent.toLowerCase();
     var isSafari=(ua.indexOf('webkit')!=-1);
     var isMac=(ua.indexOf('mac')!=-1);
     var buttonStr=isMac?'Command/Cmd':'CTRL';
        if (window.sidebar && window.sidebar.addPanel){
            window.sidebar.addPanel('Solestruck - A Passion for Shoes', 'http://www.solestruck.com','');
        } 
        else if(window.home || isSafari) { // Firefox, Netscape, Safari, iCab
        alert('You need to press '+buttonStr+' + D to bookmark our site.');
       }
       else if(!window.print || isMac) { // IE5/Mac and Safari 1.0
        alert('You need to press Command/Cmd + D to bookmark our site.');
       }
        else{
            window.external.AddFavorite('http://www.solestruck.com','Solestruck - A Passion for Shoes');
        }        
    }
	
function clearMe(field) {
	if (field.value == "register for sales events.") {
		field.value= "";
	}
}

function addBookMarkForHttps() {
   
	if (window.sidebar && window.sidebar.addPanel) {
		window.sidebar.addPanel('Solestruck - A Passion for Shoes', 'https://www.solestruck.com','');
	} else {
		window.external.AddFavorite('https://www.solestruck.com','Solestruck - A Passion for Shoes');
	}
}

var i=0;  

function launchRunway() {            
	window.open('/runway.do','runway','height=665,width=590');
}

function sdbQuickHackRollover(callerId, newSrc) {            
	document.getElementById(callerId).src = newSrc;
}  

function changeTo(callerId,newSrc) {
	document.getElementById(callerId).src = newSrc;
}

function showmenu(id) {
   showBox(id); 
}

function showBox(id){
   var div = document.getElementById(id);
   if (!div) return;	       
   div.style.display = 'block';
   div.style.position = 'absolute';
   div.style.padding = '0';
}

function hidemenu(id){
   hideBox(id);  
}
function hideBox(id){
   var div = document.getElementById(id);
   if (!div) return;
   div.style.display = 'none';
   div.style.position = 'absolute';
}

function linkLocation(location){
		window.location.href=location;
	}

function linkHTML(callerId, shoesizeLink){
   window.location.href = shoesizeLink+callerId+"/";
}

function registerSaleEvent(){
   var email=document.getElementById("registerInput").value;
   UserRegister = window.open("/registersave.do?method=emailOnly&email="+email+"&utm_source=solestruck&utm_medium=web%2Bpage&utm_campaign=footer%2Bregistration",'registerSave','height=190,width=380, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
   document.getElementById("registerInput").value="";
   UserRegister.focus();
}

function handleWithEnterKeyInEmailText(evt){
    if ((evt.which && evt.which == 13) || (evt.keyCode && evt.keyCode == 13)){
       registerSaleEvent();
    }
   
}

function changeSize(callerId) {	
	var div = document.getElementById(callerId);
	div.style.fontWeight = 'bold';
	div.style.color = '#000000';
	document.getElementById(callerId+"_arrow").src = "http://images2.solestruck.com/images/leftarrowred.gif";
}

function rechangeSize(callerId) {
	var div = document.getElementById(callerId);
	div.style.fontWeight = 'normal';
	div.style.color = '#666666';
	document.getElementById(callerId+"_arrow").src = "http://images2.solestruck.com/images/leftarrowgray.gif";
}

function saleLinkHTML(callerId, shoesizeLink){
	var text = callerId.substring(5);
	window.location.href = shoesizeLink+text+"/";
}

function registerSaleEventPopUp(){
   var email=document.getElementById("registerInputPopUp").value;
   UserRegister = window.open("/registersave.do?method=emailOnly&email="+email+"&utm_source=solestruck&utm_medium=web%2Bpage&utm_campaign=footer%2Bregistration",'registerSave','height=200,width=400, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
   document.getElementById("registerInputPopUp").value="";
   UserRegister.focus();
}

function handleWithEnterKeyInEmailTextPopUp(evt){
    if ((evt.which && evt.which == 13) || (evt.keyCode && evt.keyCode == 13)){
       registerSaleEventPopUp();
    }   
}

function createCookie(name,value,days) {	
	if (days){
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function getCookie(cookieName) {
	var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function userReviewSuccess(){
	
  window.open (url+'/pages/userreviewsuccess.jsp','UserReview', 'height=725,width=575');
}

function userReviewSuccessFromEmail(popUp){
  window.open (url+'/pages/subscriptionSuccess.jsp?linkFrom='+popUp,'UserReview', 'height=725,width=575');
}