function preloader() 
{
but1 = new Image(); 
but1.src = "images/but-home-on.jpg";

but2 = new Image(); 
but2.src = "images/but-galerie-on.jpg";

but3 = new Image(); 
but3.src = "images/but-servicii-on.jpg";

but4 = new Image(); 
but4.src = "images/but-imprejurimi-on.jpg";

but5 = new Image(); 
but5.src = "images/but-rezervare-on.jpg";

but6 = new Image(); 
but6.src = "images/but-guestbook-on.jpg";

but7 = new Image(); 
but7.src = "images/but-contact-on.jpg";
}


var slideShowSpeed = 4000
var crossFadeDuration = 3
var Pic = new Array() // don't touch this


Pic[0] = 'img/header.jpg';
Pic[1] = 'img/header2.jpg';
Pic[2] = 'img/header3.jpg';



var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}


function checkbooking()
{
var returnval=1;

	if (document.booking.nume.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul NUME este obligatoriu !";
		returnval=0;
		return false;	
	}

	if (document.booking.email.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul E-MAIL este obligatoriu !";
		returnval=0;
		return false;	
	}


	if (document.booking.adresa.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul ADRESA este obligatoriu !";
		returnval=0;
		return false;	
	}

	if (document.booking.oras.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul ORAS este obligatoriu !";
		returnval=0;
		return false;	
	}	

	if (document.booking.tara.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul TARA este obligatoriu !";
		returnval=0;
		return false;	
	}

	if (document.booking.telefon.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul TELEFON este obligatoriu !";
		returnval=0;
		return false;	
	}


	if (document.booking.arrival_date.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul DATA CAZARE este obligatoriu !";
		returnval=0;
		return false;	
	}


	if (document.booking.departure_date.value=="") 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.booking.errortext.value = "Cāmpul DATA PLECARE este obligatoriu !";
		returnval=0;
		return false;	
	}


	if (returnval == 1) 
	{
		document.getElementById("errorbox").style.visibility="visible";
		document.getElementById("errortext").style.color="#35161B";
		document.booking.errortext.value = "Va multumim ! Transmitere date ...";		
		return true;
	}	
	


}




function checkform_contact()
{
var returnval=1;

	if (document.contact.nume.value=="") 
	{
				
		alert("Va rugam completati cāmpul NUME !");
		document.contact.nume.focus();
		returnval=0;
		return false;	
	}

	
	if (document.contact.email.value=="") 
	{
		alert("Va rugam completati adresa dumneavoastra de E-MAIL !");
		document.contact.email.focus();
		returnval=0;
		return false;	
	}
		
	
	if (document.contact.mesaj.value=="") 
	{
		alert("Va rugam completati cāmpul MESAJ !");
		document.contact.mesaj.focus();		
		returnval=0;
		return false;	
	}

	if (returnval == 1) 
	{			
		return true;
	}	
	


}


function checkform_contact_en()
{
var returnval=1;

	if (document.contact.nume.value=="") 
	{
				
		alert("Please fill in NAME !");
		document.contact.nume.focus();
		returnval=0;
		return false;	
	}

	
	if (document.contact.email.value=="") 
	{
		alert("Please fill in E-MAIL !");
		document.contact.email.focus();
		returnval=0;
		return false;	
	}
		
	
	if (document.contact.mesaj.value=="") 
	{
		alert("Please fill in MESSAGE !");
		document.contact.mesaj.focus();		
		returnval=0;
		return false;	
	}

	if (returnval == 1) 
	{			
		return true;
	}	
	


}


function checkform_contact_de()
{
var returnval=1;

	if (document.contact.nume.value=="") 
	{
				
		alert("NAME ist Pflichtfeld !");
		document.contact.nume.focus();
		returnval=0;
		return false;	
	}

	
	if (document.contact.email.value=="") 
	{
		alert("E-MAIL  ist Pflichtfeld !");
		document.contact.email.focus();
		returnval=0;
		return false;	
	}
		
	
	if (document.contact.mesaj.value=="") 
	{
		alert("Nachricht  ist Pflichtfeld !");
		document.contact.mesaj.focus();		
		returnval=0;
		return false;	
	}

	if (returnval == 1) 
	{			
		return true;
	}	
	


}

var win= null;
function CloseNewWin(){if(win!=null && win.open)win.close()}

function NewWindow(image_url,w,h,mypage,myname,scroll){
	var ws = parseInt(w)+80;
	var hs = parseInt(h)+50;
  var winl = (screen.width-ws)/2;
  var wint = (screen.height-hs)/2;
  var settings  ='height='+hs+',';
      settings +='width='+ws+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=no,';
      settings +='dependent=yes';

  win=window.open(mypage,myname,settings);  
  win.document.write("<html>\n<body>\n <div align=\"center\">\n<table width=\"100%\" height=\"100%\">\n<tr>\n<td valign=\"center\" align=\"center\">\n\n");
  win.document.write("\t<table>\n\t<tr>\n\t\t<td height=100% align=center valign=middle>\n\t\t\t");
  win.document.write("<img border=1 src=" + image_url + " width=" + w +" height="+ h+ ">\n\t\t</td>\n\t</tr>\n\t</table>\n\n</td>\n</tr>\n</table>\n</div>\n</html>");
  
  if(parseInt(navigator.appVersion) >= 4)
  		{
  			win.window.focus();
  			
  		}  
}

function NewWindowPret(mypage,myname,w,h,scroll){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=no,';
      settings +='dependent=yes';

  win=window.open(mypage,myname,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

var slideShowSpeed = 4000
var crossFadeDuration = 3
var Pic = new Array() // don't touch this


Pic[0] = 'img/header.jpg';
Pic[1] = 'img/header2.jpg';
Pic[2] = 'img/header3.jpg';



var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}





