//======================================================			// Setting expiredate			var ThreeDays = 3 * 24 * 60  * 60 * 1000;			var expDate = new Date();			expDate.setTime (expDate.getTime() + ThreeDays);		function sumIt(strUnId)		{			if(document.pSum.prodSum.value != '' && document.pSum.prodSum.value >= 0)			{				var daOldBoxAntal = parseInt(getCountForId(strUnId));				//daOldBoxAntal is how many products there are in "kaka" of StrUnId				//daPrevAntal (total) is extracted at start in LS webshop.productInfo.ls				//daPrevSum (total) is extracted at start in LS webshop.productInfo.ls				//is what shoppingBasket contains at the moment							//we need listprice!!				var intListPrice = document.pSum.lPrice.value;							var oldSum = daOldBoxAntal * intListPrice;				//add new total sum				var intdaNewSum = daPrevSum - oldSum + (document.pSum.prodSum.value * intListPrice);				//ad new total antal				var intdaNewAntal = daPrevAntal - daOldBoxAntal + parseInt(document.pSum.prodSum.value);							if(intdaNewAntal > 0)					document.pSum.antal.value = intdaNewAntal + " " + pcs; //' st';				else					document.pSum.antal.value = 0 + " " + pcs;							if(intdaNewSum > 0)				{					document.pSum.sum.value = dotMaker(intdaNewSum) + currSymbol;				}else{					intdaNewSum = 0;					intdaNewAntal = 0;					document.pSum.sum.value = '0' + currSymbol;				}							document.cookie ="shoppingBasket=" + escape(intdaNewAntal + ':' + intdaNewSum) + ";expires=" + expDate.toGMTString();				daPrevSum = intdaNewSum;				daPrevAntal = intdaNewAntal;							intdaNewSum = 0;				intdaNewAntal = 0;							cookieMaker(strUnId);			}			else document.pSum.prodSum.value = 0;								}						/*   OLD!!!!!!!		function sumIt(daField){					for(var i=1;i<=postCounter;i++){				tempA = ('a'+i);				tempP = ('p'+i);				tempU = ('u'+i);				daValue = parseInt(document.shop[tempA].value,10);				if((isNaN(daValue)==false) && (daValue != 0)){					daAntal = daAntal+daValue;					daSum = daSum+(daValue*document.shop[tempP].value);					daUid = document.shop[tempU].value;				}else{					document.shop[tempA].value = '0';				}			}									var daOldBoxAntal = getCountForId(strUnId);					daAntal = daPrevAntal - daOldBoxAntal + daAntal;			daSum = daPrevSum - daOldBoxSum + daSum;						document.pSum.antal.value = daAntal + " " + pcs //' st';						if(daSum > 0){				document.pSum.sum.value = dotMaker(daSum) + currSymbol; 			}else{				document.pSum.sum.value = '0' + currSymbol;			}					document.cookie="shoppingBasket=" + escape(daAntal + ':' + daSum) + ";expires=" + expDate.toGMTString();						daAntal = 0;			daSum = 0;						cookieMaker(daField);}*///===================================================			//== Button for adding items ==	function addItem(strUnId){				document.pSum.antal.value = parseInt(document.pSum.antal.value) + 1				sumIt(strUnId);			}	function IncreaseProduct(strUnId)	{		if(document.pSum.prodSum.value == '' || document.pSum.prodSum.value < 0)			document.pSum.prodSum.value = 0;		document.pSum.prodSum.value = parseInt(document.pSum.prodSum.value) + 1		sumIt(strUnId);	}		function DecreaseProduct(strUnId)	{		if(document.pSum.prodSum.value != '' && parseInt(document.pSum.prodSum.value) > 0)		{			document.pSum.prodSum.value = parseInt(document.pSum.prodSum.value) - 1;		}		else			document.pSum.prodSum.value = 0;					sumIt(strUnId);	}	//===================================================				//== Button for deleting items ==	function deleteItem(strUnId){	/*				var tempA = 'a' + daField				// --Checking the field for empty value				if(document.shop[tempA].value == ''){					document.shop[tempA].value = 0				}				document.shop[tempA].value = parseInt(document.shop[tempA].value) - 1;				//-- Checking for negative value				if(document.shop[tempA].value <= 0){					document.shop[tempA].value = 0;				}	*/				if(document.pSum.antal.value > 0)					document.pSum.antal.value = parseInt(document.pSum.antal.value) + 1				sumIt(strUnId);			}//===================================================	function resetShop(){		if(confirm(basketRemoved)){			document.cookie="kaka=";			document.cookie="shoppingBasket=";			document.location.href='?open&id=2'; //assign/replace?		}	}	//===================================================	function changePgrp(grpId){		if (grpId.options[grpId.selectedIndex].value != ''){ 			self.window.location='?open&id=2&grpid=' + (grpId.options[grpId.selectedIndex].value); //assign/replace?		}		else		{			self.window.location='?open&id=2';		}	}//===================================================	function getCountForId(strUnId)	{		var findText = strUnId;		var originalString = getCookie('kaka');		if(originalString == null)		{			originalString = '';		}		var originalLen = originalString.length;		var pos = originalString.indexOf(findText);		if(pos != -1)		{			//var preString = originalString.substring(0,pos);			var tempString = originalString.substring(pos,originalLen);			var splitPos = tempString.indexOf('#');			var replaceString = tempString.substring(0,splitPos);			return replaceString.split(':')[1];		}		else		{			return 0;		}	}	function cookieMaker(strUnId){		//var uField = 'u'+daField;		//var aField = 'a'+daField;		//var findText = document.shop[uField].value;		var findText = strUnId;		var originalString = getCookie('kaka');		if(originalString == null){			originalString = '';		}		var originalLen = originalString.length;		var pos = originalString.indexOf(findText);		if(pos != -1){			var preString = originalString.substring(0,pos);			var tempString = originalString.substring(pos,originalLen);			var splitPos = tempString.indexOf('#');			var replaceString = tempString.substring(0,splitPos);			var postString = tempString.substring(splitPos+1,tempString.length)			//var newString = preString + findText + ':' + document.shop[aField].value + '#' + postString;			var newString = preString + findText + ':' + document.pSum.prodSum.value + '#' + postString;				if((document.pSum.prodSum.value == 0) || (document.pSum.prodSum.value == null)){					newString = preString + postString;				}			document.cookie="kaka=" + escape(newString) + ";expires=" + expDate.toGMTString();		}else{			if((document.pSum.prodSum.value != 0) && (document.pSum.prodSum.value != null)){				document.cookie="kaka=" + escape(originalString) + escape(findText + ':' + document.pSum.prodSum.value + '#') + ";expires=" + expDate.toGMTString();			}		}	}//===================================================	function chkSearch(){		if(document.shop.searchText.value == ''){			alert(searchWord);			document.shop.searchText.focus();			return false;		}		return true;	}//===================================================	function calcHeight()	{		try {			obj=document.getElementById('inFrame');				obj.style.display = "block";			obj.height = obj.contentWindow.document.body.scrollHeight;						}		catch(e) {					}			}
