	var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	function myFlash_DoFSCommand(command, args)                {
	  var myFlashObj = InternetExplorer ? myFlash : document.myFlash;
	  if(args == "over"){
	  	document.getElementById("menu").style.zIndex = 3;
	  }else{
	  	document.getElementById("menu").style.zIndex = 1;
	  }
	}
	if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") 
	!= -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	  document.write('on error resume next \n');
	  document.write('Sub myFlash_FSCommand(ByVal command, ByVal args)\n');
	  document.write(' call myFlash_DoFSCommand(command, args)\n');
	  document.write('end sub\n');
	  document.write('</SCRIPT\> \n');
	} 
    
	function setOver(){
		document.getElementById("menu").style.zIndex = 1;
	}
	
	/*function changeUpZ(){
		document.getElementById("menu").style.zIndex = 6;
	}
	
	function changeDownZ(){
		document.getElementById("menu").style.zIndex = -1;
	}*/
	
	function showKit(kitNum){
		document.getElementById(kitNum).style.zIndex = 6;	
	}
	function hideKit(kitNum){
		document.getElementById(kitNum).style.zIndex = -1;	
	}
	
	
	function yellowBorder(name){
		document.getElementById(name).style.border = "solid 1px";
		document.getElementById(name).style.borderColor = "#EEC32B";
	}

	function noBorder(name){
		document.getElementById(name).style.border = "solid 1px";
		document.getElementById(name).style.borderColor = "#999999";
	}
	
	function noBorderKassa(name){
		document.getElementById(name).style.border = "solid 1px";
		document.getElementById(name).style.borderColor = "#D5D5D4";
	}
	function changeKannforst(){
		document.images["kann"].src = "/images/kannforst_2.gif";
	}
	function changeKannforst2(){
		document.images["kann"].src = "/images/transp.gif";
	}
	
	function changePic(){
		document.images["lagg"].src = "/images/lagg_kundvagn.gif";
	}
	
	function changePic2(){
		document.images["lagg"].src = "/images/lagg_kundvagn2.gif";
	}
	
	function changeAltPic(num){
		var checkStr = document.images["alt" + num].src;
		var startStr = checkStr.length-9;
		var stopStr = checkStr.length-8;
		checkStr = checkStr.substring(startStr, stopStr);
		if(checkStr != "R"){
			document.images["alt" + num].src = "/images/altW_nr"+ num +".gif"
		}
	}
	
	function changeAltPic2(num){
		var checkStr = document.images["alt" + num].src;
		var startStr = checkStr.length-9;
		var stopStr = checkStr.length-8;
		checkStr = checkStr.substring(startStr, stopStr);
		if(checkStr != "R"){
			document.images["alt" + num].src = "/images/altY_nr"+ num +".gif"
		}
	}




	function yellowB(prodid, colorid){
		var name = prodid + '' + colorid;
		document.getElementById(name).style.border = "solid 2px";
		document.getElementById(name).style.borderColor = "#EEC32B";		
		//document.getElementById(strName).style.visibility = "visible";
	}
	
	function yellowB(prodid){
		var name = prodid;
		document.getElementById(name).style.border = "solid 2px";
		document.getElementById(name).style.borderColor = "#EEC32B";		
	}


	function yellow(prodid, colorid){
		var name = prodid + '' + colorid;
		document.getElementById(name).style.border = "solid 0px";
		document.getElementById(name).style.borderColor = "#EEC32B";
		var url = '/get_storage.php';
		var strName = name + 'div';
		var params = 'prodid=' + prodid + '&colorid=' + colorid;
		//new Ajax.Updater(strName, url, { method: 'get', parameters: params });
		document.getElementById(strName).style.visibility = "visible";
	}
	
	
	/*
	
			new Ajax.Request('/get_storage.php',   {     method:'get', parameters: {prodid: 20, colorid: 12},     
						 
		onSuccess: function(transport){  var response = transport.responseText || "no response text";       alert("Success! \n\n" + response);     },     
		onFailure: function(){  }   }); 
	
	*/
	
	function reportError(){
		alert("error");
	}
	
	function white(name){
		document.getElementById(name).style.border = "solid 0px";
		document.getElementById(name).style.borderColor = "#EEC32B";
		var strName = name + 'div';
		document.getElementById(strName).style.visibility = "hidden";
	}


	function AddToCart(formName) {
		if ($('#inslagning').attr('checked')) {
				//alert('Inslagning är vald');
				$('input.inslagningField').val('YES');
		} else {

				//alert('Inslagning är inte vald');
		}

	document.getElementById(formName).submit();
	}
	function search(){
		var form = document.searchForm;
		form.submit();
	}
	function search_bottom(){
		var form = document.searchForm_bottom;
		form.submit();
	}
	
	function Empty_cart(){
		alert('Shoppingvagnen är tom');
	}
	function No_link(){
		alert('Denna sida kommer snart');
	}
	
	function CenterWindow(){

  		var myWidth = 0
  		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ){
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;

		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		
		
		}
	//document.getElementById('content').style.left = (myWidth*0.5) -459;
	}
	 
	
	
	function changeValueTemp(iElement)
{
	if(iElement.value==iElement.defaultValue)
		iElement.value='';
	else if(iElement.value=='')
		iElement.value=iElement.defaultValue;
}
function urlencode(s) {
  s = encodeURIComponent(s);
  return s.replace(/~/g,'%7E').replace(/%20/g,'+');
 }