
// calcul montant pre-reservation produits mode
function calculate(myProduct, myPrice){
	var total = parseInt(document.reservation.total.value);
	var mySelection = eval("document.reservation." + myProduct + ".checked");
	
	if(mySelection==true){
		var newTotal  = total + parseInt(myPrice); // ajout
	} else {
		var newTotal  = total - parseInt(myPrice); // suppression
	}
	
	document.reservation.total.value = newTotal;
	document.getElementById("divtotal").innerHTML = newTotal + " RUB";
}

// verif form reservation mode
function checkFashionForm() {
	var continu = 1;
	if(document.reservation.lastname.value == "") 					{ continu = 0; }
	if(document.reservation.firstname.value == "") 					{ continu = 0; }
	if(document.reservation.tel.value == "") 								{ continu = 0; }
	if(document.reservation.email.value == "") 							{ continu = 0; }
	if(document.reservation.email.value.indexOf("@",0) == -1) 		{ continu = 0; }
	if(document.reservation.email.value.indexOf(".",0) == -1) 		{ continu = 0; }
	if(document.reservation.total.value=="0") 							{ continu = 0; }

	if(continu == 0){
		alert("Attention! Please fill every mandatory field, check your email address and your order. \n\n Внимание! Пожалуйста заполните каждую обязательную линию, проверьте ваш адрес электронной почты и ваш заказ.");
	} else {
		document.reservation.submit();
	}
}

// verif form reservation mode
function checkRegistrationForm() {
	var continu = 1;
	if(document.registration.lastname_ru.value == "") 				{ continu = 0; }
	if(document.registration.patronym_ru.value == "") 				{ continu = 0; }
	if(document.registration.firstname_ru.value == "") 				{ continu = 0; }
	if(document.registration.company_ru.value == "") 				{ continu = 0; }
	if(document.registration.address1_ru.value == "") 				{ continu = 0; }
	if(document.registration.zip.value == "") 								{ continu = 0; }
	if(document.registration.city_ru.value == "") 						{ continu = 0; }
	if(document.registration.country_ru.value == "") 					{ continu = 0; }
	if(document.registration.phone.value == "") 						{ continu = 0; }
	if(document.registration.email.value == "") 							{ continu = 0; }
	if(document.registration.email.value.indexOf("@",0) == -1)		{ continu = 0; }
	if(document.registration.email.value.indexOf(".",0) == -1) 		{ continu = 0; }
	if(document.registration.position.value == "") 						{ continu = 0; }
	if(document.registration.profile.value == "") 						{ continu = 0; }

	if(continu == 0){
		alert("Attention! Please fill every mandatory field, and the validity of your email address. \n\n Внимание! Пожалуйста заполните каждую обязательную линию.");
	} else {
		document.registration.submit();
	}
}


function showhide(myId){
	if ( document.getElementById(myId).style.display == "" || document.getElementById(myId).style.display == "none" ) { 
		document.getElementById(myId).style.display = "block";
	} else {
		hide(myId,100);
	}
}

function show(myId){
	document.getElementById(myId).style.display = "block";
}

function hide(myId){
	document.getElementById(myId).style.display = "none";
}

function wo(theURL,winName,features) {
	features = features + ",toolbar=no,status=no,resizable=yes,scrollbars=yes";
	window.open(theURL,winName,features);
}

function showmenu(myId,myTheme){
	document.getElementById(myId).style.display = "block";
	document.getElementById(myId).style.left = document.getElementById(myTheme).offsetLeft + "px";
	document.getElementById(myId).style.top = document.getElementById(myTheme).offsetTop + document.getElementById(myTheme).offsetHeight - 1 + "px";
}

function changeHeader(myImg,mySize){
	document.getElementById("pageImage").style.background = "url(img/"+myImg+") no-repeat top center";
	document.getElementById("mask").style.height = mySize+"px";
}




