
function searchby_occasion_dd() {
 // alert (  document.getElementById("searchby_occasion").value  );	
window.document.location.href = '/Product.aspx?query=Keyword%1F' + document.getElementById("searchby_occasion").value;
return false;
}

function searchby_price_dd() {
 // alert (  document.getElementById("searchby_price").value  );
  window.document.location.href = '/Product.aspx?query=PriceRange%1F' + document.getElementById("searchby_price").value;  
return false;
}



function searchby_maintext() {
 // alert (  document.getElementById("searchby_price").value  );
  window.document.location.href = '/Product.aspx?query=' + document.getElementById("maintext_search").value;  
return false;
}


function searchClick()
{
	  if(document.getElementById("searchby_price").value.length > 0)
	  {
			//var queryURLEncoded = encodeURIComponent(document.forms[0].{0}.value);
			//document.location = '{1}' + '?query=' + queryURLEncoded;
			//alert("test");
			window.document.location.href = '/Product.aspx?query=' + document.getElementById("maintext_search").value; 
	  }
}

function txtSearchQueryKeyPress(evt)
{
	  if(evt.keyCode == 13)
	  {
			searchClick()
			return false; // cancel submit
	  }
	  
	  return true;
}






/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
      window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
      var elem = document.createElement('a');
      elem.setAttribute('href',url);
      elem.setAttribute('title',title);
      elem.setAttribute('rel','sidebar');
      elem.click();
} 
else if(document.all)// ie
      window.external.AddFavorite(url, title);
}







function getUrlVars(){
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

	for(var i = 0; i < hashes.length; i++)
	{
	hash = hashes[i].split('=');
	vars.push(hash[0]);
	vars[hash[0]] = hash[1];
	}
	return vars;
}
function display_search_choice(){
	var getvars = [];
	getvars =  getUrlVars();

	if(getvars['query']){
		var mySplitResult = getvars['query'].split("%1F");
		if (mySplitResult[0] == 'PriceRange' ) {
		//	alert("price "+ mySplitResult[1]);
			document.getElementById("searchby_price").value  = mySplitResult[1];
		}
		else{
			if (mySplitResult[0] == 'Keyword' ) {
	//			alert("Key "+ mySplitResult[1]);
				mySplitResult[1] = mySplitResult[1].replace(/%20/g,' ');
	//			alert("Key "+ mySplitResult[1]);
				document.getElementById("searchby_occasion").value  = mySplitResult[1];		
			}
		}
	}
}





function extra_checkoutinfo(){

 var where_to= confirm("Please note that this order will not be dispatched until w/c 4th of January. \nPlease click ok to proceed.");
 if (where_to== true)
 {
   document.getElementsByName("pageViwer$content5$ctl00$ctl00$ctl24")[0].click();   
  }
 else
 {
  alert("You cancelled the payment process.\nPurchase not made");
  }


}



