function submitNewsLetter(){
	document.forms.NewsLetterForm.submit();
}
function submitDeliver(){
	document.forms.DeliverForm.submit();
}
function submitAddress(){
	document.forms.AddressForm.submit();
}
function submitPasswordForget(){
	document.forms.PasswordForget.submit();
}
function submitLogin(){
	document.forms.LoginForm.submit();
}
function submitRegister(){
	document.getElementById("CartFormAction").value='33';
	document.forms.LoginForm.submit();
}
function submitProductQuestion(){
	document.forms.ProductQuestionForm.submit();
}
function submitRecommendation(){
	document.forms.RecommendationForm.submit();
}
function submitCallback(){
	document.forms.CallbackForm.submit();
}
function addToCart1(product_id, url){
	if(document.getElementById("value_"+product_id)!=null){
		url+="?Article="+product_id+"&value="+document.getElementById("value_"+product_id).value;
	}else{
		url+="?Article="+product_id+"&value=1";
	}
	sendAjaxRequest(url,processReqCart);
}

var moveStartY = 200;
var moveStopX = 450;
var moveStopY = 170;
var imgDiv;
var moveI=0;
var intervalRef;
function addToCart2(e,product_id,url){
	imgDiv = document.getElementById("PIT"+product_id);
	if(imgDiv !=null && e.which != null){
		moveStartX = e.clientX -e.x+100;
		imgDiv.style.left=moveStartX+"px";
		imgDiv.style.top=moveStartY+"px";
		imgDiv.style.position="absolute";
		imgDiv.style.visibility="visible";
		imgDiv.style.display="block";
		intervalRef = window.setInterval("moveToCart()", 10);
	}else if (imgDiv !=null &&  document.all) {
		moveStartX = e.clientX -e.x+100;
		imgDiv.style.left=moveStartX+"px";
		imgDiv.style.top=moveStartY+"px";
		imgDiv.style.position="absolute";
		imgDiv.style.visibility="visible";
		imgDiv.style.display="block";
		intervalRef = window.setInterval("moveToCart()", 10);
	}
	if(document.getElementById("value_"+product_id)!=null){
		url+="?Article="+product_id+"&value="+document.getElementById("value_"+product_id).value;
	}else{
		url+="?Article="+product_id+"&value=1";
	}
	sendAjaxRequest(url,processReqCart);
}
function moveToCart(){
	moveI +=10;
	if(moveI < moveStopX){
		var temp =moveStartX+moveI;
		imgDiv.style.left=temp+"px";
	}else{
		window.clearInterval(intervalRef);
		moveI=0;
		imgDiv.style.visibility="hidden";
		imgDiv.style.display="none";
	}
}
function processReqCart(){
	if(req.readyState == 4&&req.status == 200){
		document.getElementById("CartMiniDiv").innerHTML=req.responseText;
	}else if(req.readyState == 4){
		alert("Request Fail:"+req.statustext+" "+req.status);
	}
}

function addToCart3(e,product_id, url){
	url+="?redirect=true";
	if(document.getElementById("value_"+product_id)!=null){
		url+="&Article="+product_id+"&value="+document.getElementById("value_"+product_id).value;
	}else{
		url+="&Article="+product_id+"&value=1";
	}
	window.location.href=url ;
}
function getNodeValue(tree, el){
	return tree.getElementsByTagName(el)[0].firstChild.nodeValue;
}
function sendAjaxRequest(url,processReq){
	req = createXMLHttpRequest();
	req.onreadystatechange=processReq;
	req.open("GET",url,true);
	req.send(null);
}
function onLoadEvent(){
	if(document.getElementById("ErrorDiv")!=null)showDiv("ErrorDiv");
	if(document.getElementById("MessageDiv")!=null)showDiv("MessageDiv");
}
function showDiv(name){
	document.getElementById(name).style.visibility="visible";
	document.getElementById(name).style.display="block";
}
function hideDiv(name){
	document.getElementById(name).style.visibility="hidden";
	document.getElementById(name).style.display="none";
}
function createXMLHttpRequest() {
	return AJAXcreateXMLHttpRequest();
}