
function popupWindow(url) {
				window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=5,left=5');
			}			

 function submit_form(theform) {		
	 sr = eval("document."+theform);
   	 sr.submit();
 }
 

function show_order_form(url){
     desktop = window.open(url, null, "toolbar=yes,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=330,height=380");
     desktop.window.focus();
}

function form_valid(form,hidd) {	

	 if (validate(form)) {
		 way=eval("form."+hidd);
		 way.value='ok';
		 form.submit();
	 }
}

function form_valid_contact(form,hidd) {	
		var err = [];
	 if(isValidEmail(form.mail.value)) {
		 way=eval("form."+hidd);
		 way.value='ok';
		 form.submit();
	 } else err[err.length] = "Please, enter right email";
	
	return error(err);
}

function validate(selff) {
		var err = [];
			if(selff.name.value == '' ) 
				err[err.length] = "Please, enter your name";
			if(selff.age.value == '' )
				err[err.length] = "Please, enter your age";
			if(selff.work_name.value == '' )
				err[err.length] = "Please, enter your work name";
			if(selff.height.value == '' )
				err[err.length] = "Please, enter your height";
			if(selff.phone.value == '' )
				err[err.length] = "Please, enter your phone";
			if(selff.width.value == '' )
				err[err.length] = "Please, enter your width";
			if(!isValidEmail(selff.mail.value))
				err[err.length] = "Please, enter right email";
			if(selff.statistic.value == 0 )
				err[err.length] = "Please, enter your statistic";
			if(selff.nationality.value == '' )
				err[err.length] = "Please, enter your nationality";
	return error(err);
}

function isValidEmail(email){
	return email.match(/^([-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+)@([-0-9A-Z]+\.)+([0-9A-Z]{2,4})$/i);
}

	function error(err){
		if(err.length > 0){
			alert(err.join("\n\n"));
			return false;
		} else return true;
	}


function flash_button() {
 //var obj = document.getElementById('flash');
 if(document.getElementById('flash_b').className == "a"){
  document.getElementById('flash_b').className = "b";
 } else {
  document.getElementById('flash_b').className = "a";
 };
 
 currentTimer = window.setTimeout("flash_button();", 300);
}

function addf(){
 window.external.AddFavorite('http://londonnightgirls.com','London Night Girls');
}
