function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function OpenBrWindow(theURL,winName,features) { //v3.0
  var isCenter="true"

  if(window.screen)if(isCenter)if(isCenter=="true"){
	var myWidth=430;
	var myHeight=650;
	var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
  	
}

function Large(poza,titlu,width,height)
{
	CreatePop(poza,titlu,width,height);
} 

function Large2(poza,titlu,width,height)
{
	CreatePop2(poza,titlu,width,height);
} 

var xx=new Object();
function CreatePop(poza,titlu,width,height)
{
	ttop=0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		ttop=window.pageYOffset;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		ttop=document.documentElement.scrollTop;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		//ttop=document.body.scrollTop;
	}
	
	if (width>myWidth-60) { width=myWidth-60;}
	if (height>myHeight-60) { height=myHeight-60;}
	
	l = (myWidth-width-200)/2;
	t = (myHeight-height)/2+ttop ; 
	
	//alert(myWidth+'    '+myHeight);
	
	var firefox = (navigator.appName=="Netscape")?'true':'false';
	
	xx=document.createElement("div");
	xx.innerHTML='<table onClick="javascript:ClosePop();"><tr><td style="font-size:11px; padding-top:2px; padding-left:4px; color:#EEEEEE; text-align:left">'+titlu+'</td><td align="right" style="padding-top:2px; padding-right:4px;"><a href="javascript:ClosePop();" style="color:#A1C2E3; font-size:14px;"><b>x</b></a></td></tr><td colspan="2" align="center"><img src="'+poza+'" alt='+titlu+' style="margin:2px"></td></tr></table>';
	
	xx.style.zIndex = '10';
	xx.style.backgroundColor = "black";  
	xx.style.position = "absolute";
	xx.style.border = "1px solid #FFFFFF";
	xx.style.left = l+'px';
	xx.style.top = t+'px';
	xx.style.backgroundColor='#165780';
	xx.style.display = "block";

	//hideSelect();
	//document.getElementById("select_an").style.display= 'none';
	document.getElementById("select_nr").style.display= 'none';
	document.body.appendChild(xx);	
} 


function CreatePop2(poza,titlu,width,height)
{
	
	ttop=0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
		ttop=window.pageYOffset;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
		ttop=document.documentElement.scrollTop;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
		//ttop=document.body.scrollTop;
	}
	
	if (width>myWidth-60) { width=myWidth-60;}
	if (height>myHeight-60) { height=myHeight-60;}
	
	l = (myWidth-width-200)/2;
	t = (myHeight-height)/2+ttop ; 
	
	//alert(myWidth+'    '+myHeight);
	
	var firefox = (navigator.appName=="Netscape")?'true':'false';
	
	xx=document.createElement("div");
	xx.innerHTML='<table onClick="javascript:ClosePop2();"><tr><td style="font-size:11px; padding-top:2px; padding-left:4px; color:#EEEEEE; text-align:left">'+titlu+'</td><td align="right" style="padding-top:2px; padding-right:4px;"><a href="javascript:ClosePop2();" style="color:#A1C2E3; font-size:14px;"><b>x</b></a></td></tr><td colspan="2" align="center"><img src="'+poza+'" alt='+titlu+' style="margin:2px"></td></tr></table>';
	
	xx.id = 'image_pop';
	xx.style.zIndex = '10';
	xx.style.backgroundColor = "black";  
	xx.style.position = "absolute";
	xx.style.border = "1px solid #FFFFFF";
	xx.style.left = l+'px';
	xx.style.top = t+'px';
	xx.style.backgroundColor='#165780';
	xx.style.display = "block";

	document.body.appendChild(xx);	
} 

function ClosePop()
{
	//unhideSelect();
	//document.getElementById("select_an").style.display= 'block';
	//document.getElementById("select_nr").style.display= 'block';
	xx.style.display = "none"; 
}

function ClosePop2()
{
	xx.style.display = "none"; 
}




function hideSelect()
{if (document.all){document.all.formselect.style.visibility="hidden";}}

function unhideSelect()
{if (document.all){document.all.formselect.style.visibility="visible";}}

function OpenBrWindow(theURL,winName,features) { //v3.0
  var isCenter="true"

  if(window.screen)if(isCenter)if(isCenter=="true"){
	var myWidth=420;
	var myHeight=500;
	var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

/* verificare formular contact */
function trim(obj) { 
	var cont=obj.replace(/\s+$|^\s+/g,"");	
	if(cont=='')
		{
			return 0;			
		}
	else
		{
			return 1;	
		}
} 

function verifica_contact(limba) {
	if (document.contact.nume.value == "" || trim(document.contact.nume.value)==0)
	 {
		  var mesaj = (limba=='ro') ? 'Nu ati completat campul nume!' : 'What is your last name?' ;
		  alert(mesaj);
		  document.contact.nume.value="";
		  document.contact.nume.focus();
		  var verifica = 0;
		  return false;
	 }

	 if (document.contact.prenume.value == "" || trim(document.contact.prenume.value)==0)
	 {
		 var mesaj = (limba=='ro') ? 'Nu ati completat campul prenume!' : 'What is your first name?!' ;
		  alert(mesaj);
		  document.contact.prenume.value="";
		  document.contact.prenume.focus();
		  var verifica = 0;
		  return false;
	 }

	 if (document.contact.phonenumber.value == "" || trim(document.contact.phonenumber.value)==0)
	 {
		 var mesaj = (limba=='ro') ? 'Nu ati completat campul numar de telefon!' : 'What is your phonenumber?' ;
		  alert(mesaj);
		  document.contact.phonenumber.value="";
		  document.contact.phonenumber.focus();
		  var verifica = 0;
		  return false;
	 }

	 if (document.contact.email.value == "" || trim(document.contact.email.value)==0)
	 {
		 var mesaj = (limba=='ro') ? 'Nu ati completat campul email!' : 'What is your email?' ;
		  alert(mesaj);
		  document.contact.email.value="";
		  document.contact.email.focus();
		  var verifica = 0;
		  return false;
	 }

	 if (document.contact.mesaj.value == "" || trim(document.contact.mesaj.value)==0)
	 {
		  var mesaj = (limba=='ro') ? 'Nu ati completat campul mesaj!' : 'The field `Message` is empty!' ;
		  alert(mesaj);
		  document.contact.mesaj.value="";
		  document.contact.mesaj.focus();
		  var verifica = 0;
		  return false;
	 } 

	 if ( verifica!=0 ) {
		document.contact.submited.value='sent';
		document.contact.submit();
	 } else {
		return false;
	 }
}

function checkSearch(form, message, defaultValue)
{
	if (form.search.value.length < 3) {
		alert(message);
		return false;
	}
	
	if (form.search.value == defaultValue) {
		return false;
	}
	
	return true;
}
