nav = navigator.appName.indexOf("Microsoft")!= -1 ? 1 : 2;

var email_exp= new RegExp("^[\\w\\+-]+(\\.[\\w\\+-]+)?@((\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})\|([\\w\\+-]+\\.[a-zA-Z0-9\.]{2,}))$");

function popup(url, name, width, height, scroll, modal, resizable) {
	width=Math.min(screen.availWidth,width);
	height=Math.min(screen.availHeight-40,height);
	var poz_x=(screen.availWidth-width)/2;
	var poz_y=(screen.availHeight-height-30)/2;
	newwin=window.open(url, name, 'scrollbars='+scroll+', menubar=no, width='+width+', height='+height+', resizable=no,toolbar=no, left='+poz_x+', top='+poz_y+', location=no, status=no');
	if(modal){
		popInt=setInterval(function(n){
			if(typeof(newwin.name)=="string"){
				if(newwin.document.body){
					openerfocus=function(){
						if(typeof(newwin.name)=="string"){
							newwin.focus();
						}else{
							document.body.onfocus=null;
						}
					}
					document.body.onfocus=openerfocus;
					newwin.window.document.body.onunload=function(){alert(66)}
					newwin.focus();
					/*with(newwin){
						self.focus()
						opener.document.body.onfocus=function(){self.focus();opener.alert(4);}
						self.document.body.onunload=function(){opener.document.body.onfocus=null}
					}*/
					clearInterval(popInt);
				}
			}else{
				clearInterval(popInt)
			}
		},1)
	}
}

function validareKeyword(){
	if(document.form_cautare.cuvant_cheie.value.replace(/^\s+|\s+$/, '').length < 3) {
		alert('Cuvantul cheie este prea scurt!');
		return false;
	}
	else{
		document.form_cautare.submit()
		return true;
	}
}

function validareContact() {
	if((!email_exp.test(document.quickmail.contact_email.value)) || (document.quickmail.contact_email.value.replace(/^\s+|\s+$/, '')=='')){
		document.quickmail.contact_email.focus();
		alert('Completati adresa de email!');
		return false;
	}
	else{
		return true;
	}
}