	function phpads_deliverActiveX(content)
	{
		document.write(content);	
	}

	function CheckSmallSearchForm()
	{
		if (document.getElementById('search').value == '')
		{
			alert('%%LANG_hpNoQuery%%');
			document.getElementById('search').focus();
			document.getElementById('search').select();
			return false;
		}
		else
		{
			return true;
		}
	}
	
	function ShowiNews() 
	{
		document.getElementById("iBest").style.display = "none";
		document.getElementById("iNews").style.display = "";
	}

	function ShowiBest() 
	{
		document.getElementById("iNews").style.display = "none";
		document.getElementById("iBest").style.display = "";
	}

	
	function SwitchTabs()
	{
		//checkContent = ContentState;
		if(document.getElementById("iBest").style.display = "none") {
		document.getElementById("iNews").style.display = "";
		} else {
			document.getElementById("iBest").style.display = "";
		}
	}

	function ShowAdvSearchDetails() 
	{
		document.getElementById("AdvSearchShow").style.display = "none";
		document.getElementById("AdvSearchHide").style.display = "";
		document.getElementById("AdvSearch").style.display = "";
	}
	function HideAdvSearchDetails() 
	{
		document.getElementById("AdvSearchHide").style.display = "none";
		document.getElementById("AdvSearchShow").style.display = "";
		document.getElementById("AdvSearch").style.display = "none";
	}
	
	function SHowCatlist(ID) 
	{
		document.getElementById("Cat"+ID).style.display = "";
	}
	
	function UnListCats(ID) 
	{
		var CatList = document.getElementById("Cat"+ID);
			
		if(CatList.value == 0)
			document.getElementById("Cat"+ID).style.display = "none";
		else
			document.getElementById("Cat"+ID).style.display = "";
		
	}

	//UnListCats(46);
	
	function CheckChangePassForm(form,LANG1,LANG2)
	{
		if(form == "fPassForm") { 
	
			var password = document.getElementById('rPassword');
			var passwordc = document.getElementById('rPasswordConfirm');
		
				if(password.value == "")
				{
					alert(LANG1);
					//password.focus();
						password.style.borderColor  = '#da251d';
						password.style.background = '#f9e0df';
		
					return false;
				}
			
				if(password.value != passwordc.value)
				{
					alert(LANG2);
					
						password.style.borderColor  = '#da251d';
						passwordc.style.borderColor  = '#da251d';
							
					return false;
				}		
		
		} else {
			alert("Form Error...")
		}
	
		return true;
	
	}
	
	
	function CheckUserForm(form,eos,LANG1,LANG2,LANG3,LANG4,LANG5,LANG6,LANG7,LANG8)
	{
		if(form == "rform") { 
	
			var username = document.getElementById('rUsername');
			var password = document.getElementById('rPassword');
			var passwordc = document.getElementById('rPasswordConfirm');
			var fname = document.getElementById('rFirstName');
			var sname = document.getElementById('rLastName');
			var email = document.getElementById('rEmail');
	
			var badress = document.getElementById('rbAdress');
			var bcity = document.getElementById('rbCity');
			var bzip = document.getElementById('rbZip');
			
			var eos;
	
			if(eos != 1) {
				if(username.value == "")
				{
					alert(LANG1);
					username.focus();
					username.style.borderColor  = '#da251d';
					username.style.background = '#f9e0df';
					
					return false;
				}
				
				if(password.value == "")
				{
					alert(LANG2);
					//password.focus();
						password.style.borderColor  = '#da251d';
						password.style.background = '#f9e0df';
		
					return false;
				}
			
				if(password.value != passwordc.value)
				{
					alert(LANG3);
					
						password.style.borderColor  = '#da251d';
						passwordc.style.borderColor  = '#da251d';
							
					return false;
				}		
			}
			
	
			if(fname.value == "")
			{
				alert(LANG4);
				//password.focus();
					fname.style.borderColor  = '#da251d';
					fname.style.background = '#f9e0df';
	
				return false;
			}
	
			if(sname.value == "")
			{
				alert(LANG5);
				//password.focus();
					sname.style.borderColor  = '#da251d';
					sname.style.background = '#f9e0df';
					
				return false;
			}
			
			if(email.value == "")
			{
				alert(LANG6);
				//password.focus();
					email.style.borderColor  = '#da251d';
					email.style.background = '#f9e0df';
					
				return false;
			}
			
			if(email.value.indexOf('.') == -1 || email.value.indexOf('@') == -1)
			{
				alert(LANG7);
				//password.focus();
					email.style.borderColor  = '#da251d';
					email.style.background = '#f9e0df';
	
	
				return false;
			}
	
			if(badress.value == "" || bcity.value == "" || bzip.value == "")
			{
				alert(LANG8);
				//password.focus();
					badress.style.borderColor  = '#da251d';
					badress.style.background = '#f9e0df';
					bcity.style.borderColor  = '#da251d';
					bcity.style.background  = '#f9e0df';
					bzip.style.borderColor  = '#da251d';
					bzip.style.background  = '#f9e0df';
					
				return false;
			}
	
	
		} else {
			alert("Form Error...")
		}
	
		return true;
	}

	function CatToDo(CatID) 
	{
	reCalc();

	//document.getElementById('CatItemImage'+CatID).src = "./images/products/cbc0ccf4ed2cf97deb27d0476a0cbcc1.jpg";

	}
	
	function reCalc() 
	{
		
		
		
		newPrice=0.00;
		for(i=0;i<document.TheForm.elements.length;++i)
			if(document.TheForm.elements[i].type == 'select-one') {
		// if(document.TheForm.elements[i].name == 'Qty') continue;	
		thisValue = document.TheForm.elements[i].options[document.TheForm.elements[i].selectedIndex].value;
		if(thisValue.indexOf('->') != -1) newPrice += 1 * thisValue.substring(thisValue.indexOf('|')+1, thisValue.length);
			}
		
		document.TheForm.Total.value = Math.round(newPrice*1*100)/100 + ',-';
		if(document.TheForm.Total.value == '0,-') document.TheForm.Total.value = '0,-';
		while(document.TheForm.Total.value.indexOf('.') > document.TheForm.Total.value.length-3) document.TheForm.Total.value += '0';
	
		document.TheForm.TotalNetto.value = '(' + Math.round((newPrice-(newPrice*0.22))) + ',-)';
		if(document.TheForm.TotalNetto.value == '0,-') document.TheForm.TotalNetto.value = '0,-';
		while(document.TheForm.TotalNetto.value.indexOf('.') > document.TheForm.TotalNetto.value.length-3) document.TheForm.TotalNetto.value += '0';
	
	}
	
	
	function CheckAddCommentFormFunction(MSG1, MSG2)
	{
		
		if(document.getElementById("fTitle").value == "")
		{
			alert(MSG1);
			document.getElementById("fTitle").style.borderColor  = '#da251d';
			document.getElementById("fTitle").style.background = '#f9e0df';
			document.getElementById("fTitle").focus();
			
			return false;
		}
	
		if(document.getElementById("fContent").value == "")
		{
			alert(MSG2);
			
			document.getElementById("fContent").style.borderColor  = '#da251d';
			document.getElementById("fContent").style.background = '#f9e0df';
			document.getElementById("fContent").focus();
			
			return false;
		}
	
		return true;	
		
	}
	
	
	function setBg(elem) 
	{
			if (document.getElementById) {
				elem.style.borderColor  = '#333333';
				elem.style.fontWeight  = 'bold';
			}
		if (elem.value == elem.defaultValue)
			elem.value = ""
	
	}
	
	function setRedBg(elem) 
	{
			if (document.getElementById) {
				elem.style.borderColor  = '#ff0000';
			}
	}
	
	function removeBg(elem) 
	{ 
		//clearall(); 
		//var bg2 = "#ffcccc"; 	
		elem.style.borderColor = "";
		elem.style.fontWeight  = "";
	
		if (elem.value == '')
			elem.value = elem.defaultValue;
		else 
			elem.value = elem.value;
	} 


	function clipBoard(copyString)
	{
		var otext = copyString;
		//otext = copyString;
		var trange = otext.createTextRange()
		copyRange = trange.execCommand("Copy");
	}
	
	function popupImage (url) {
		 window.open('index.php?option=popup&'+url,'popupImage','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150');
	}
	

