///functii pentru rubrica de hoteluri la filtre

function changePic(el_id, new_pic) {

	document.getElementById(el_id).src=new_pic;

}

function confirma(id){
		if (confirm("Sunteti sigur?"))
			document.location=id;
}


function refresh_tara() {
	document.getElementById('localitate').value='';
	document.getElementById('stele').value='';
	document.getElementById('hotels_form').submit();
}

function refresh_loc() {
	document.getElementById('stele').value='';
	document.getElementById('hotels_form').submit();
}


///functii pentru rubrica de hoteluri la filtre

// functie pentru zonal -> switching de taburi

//alert('test');
function show(tip1,tip2){
		document.getElementById(tip1).style.display='block';
		document.getElementById(tip2).style.display='none';	
		document.getElementById(tip1+'mm').style.display='block';
		document.getElementById(tip2+'mm').style.display='none';	
		document.getElementById(tip1+'hh').style.display='block';
		document.getElementById(tip2+'hh').style.display='none';	
}




// functie pentru zonal -> switching de taburi



function mess(){
	var index=document.getElementById('domeniu').selectedIndex;
	var value1=document.getElementById('domeniu').options[index].value;
	
	if(value1==1){
		document.getElementById('id_mess').style.display="block";
		document.getElementById('mess2').style.display="block";
		}
 	else {
		document.getElementById('id_mess').style.display="none";
		document.getElementById('mess2').style.display="none";
		document.getElementById('yahoo_mess').value="";
		}
	
	
}


<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// -->


/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate




function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }

// functie pentru flashuri = detectare flsah player



function ursuleti( latime, inaltime,  sursa,  parametri, fereastra ) {



if(fereastra==true){
 if (AC_FL_RunContent == 0) 
	 alert("This page requires AC_RunActiveContent.js.");
 else 
 	AC_FL_RunContent(
                       'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
                       'width', latime,
                       'height', inaltime,
                       'src', sursa,
                       'quality', 'high',
                       'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                       'align', 'middle',
                       'play', 'true',
                       'loop', 'true',
                       'scale', 'showall',
                       'wmode', 'transparent',
                       'devicefont', 'false',
                       'id', sursa,
                       'bgcolor', '#ffffff',
                       'name', sursa,
                       'menu', 'true',
                       'allowFullScreen', 'false',
                       'allowScriptAccess','sameDomain',
                       'movie', sursa,
                       'salign', '',
					   'flashvars', parametri
                       ); //end AC code
    
 }
else {
	if (AC_FL_RunContent == 0)
    	alert("This page requires AC_RunActiveContent.js.");
    else
               AC_FL_RunContent(
                       'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
                       'width', latime,
                       'height', inaltime,
                       'src', sursa,
                       'quality', 'high',
                       'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                       'align', 'middle',
                       'play', 'true',
                       'loop', 'true',
                       'scale', 'showall',
                       'wmode', 'opaque',
                       'devicefont', 'false',
                       'id', sursa,
                       'bgcolor', '#ff0000',
                       'name', sursa,
                       'menu', 'true',
                       'allowFullScreen', 'false',
                       'allowScriptAccess','sameDomain',
                       'movie', sursa,
                       'salign', '',
					   'flashvars', parametri
                       ); //end AC code
}

return AC_FL_RunContent;
}
 
 

// functie pentru flashuri = detectare flsah player



var win=null; 
function NewWindow(mypage,myname,w,h,scroll,pos) 

{ 

if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor		

	(Math.random()*((screen.height-h)-75)):100;} 

if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} 

else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings); 

} 





function confirmDelete(delUrl) {

  if (confirm("Are you sure you want to delete")) {

    document.location = delUrl;

  }

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}



function submitform(){

  document.myform.submit();

  }



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

function formCheck(formobj){

	// Enter name of mandatory fields

	var fieldRequired = Array("destinatiehtml", "numehtml", "loc_plecarehtml", "clienttelhtml", "clientemailhtml", "tara");

	// Enter field description to appear in the dialog box

	var fieldDescription = Array("Destinatia dorita", "Nume complet", "Punctul de plecare", "Telefonul dvs.", "E-mail-ul dvs.","Tara de destinatie");

	// dialog message

	var alertMsg = "Va rugam completati campurile:\n";//Please complete the following fields

	

	var l_Msg = alertMsg.length;



	for (var i = 0; i < fieldRequired.length; i++){

		

    var obj = formobj.elements[fieldRequired[i]];

		if (obj){

		  

			switch(obj.type){

			

			case "select-one":

			

				if (obj.selectedIndex == '' || obj.options[obj.selectedIndex].text == ""){

					alertMsg += " - " + fieldDescription[i] + "\n";

				}

				break;

			case "select-multiple":

				if (obj.selectedIndex == -1){

					alertMsg += " - " + fieldDescription[i] + "\n";

				}

				break;

			case "text":

			case "password":

			case "textarea":

				if (obj.value == "" || obj.value == null){

					alertMsg += " - " + fieldDescription[i] + "\n";

				}

				break;	

			default:

			}

			if (obj.type == undefined){

				var blnchecked = false;

				for (var j = 0; j < obj.length; j++){

					if (obj[j].checked){

						blnchecked = true;

					}

				}

				if (!blnchecked){

					alertMsg += " - " + fieldDescription[i] + "\n";

				}

			}

		}

	}



	if (alertMsg.length == l_Msg){

		return true;

	}else{

		alert(alertMsg);

		return false;

	}

}



	function delete_link(ID) {
	
    if(confirm("Sunteti sigur?")) document.location="mypage.php?what=detalii&act=edit&c=recomandare&sterge=1&id="+ID;

     }


	function verif()

	{

		

		if (document.formoferta.id_tara.options[document.formoferta.id_tara.selectedIndex].value=="-")

		{ 

			document.formoferta.id_tara.focus();

			alert("Nu ati introdus Tara!"); 

			return false; 

		}

		

		if (document.formoferta.id_localitate.options[document.formoferta.id_localitate.selectedIndex].value=="-")

		{ 

			document.formoferta.id_localitate.focus();

			alert("Nu ati introdus Localitatea!"); 

			return false; 

		}

			

	}    

    

///calendar functions 





function dateChangedS(calendar) {
		    // Beware that this function is called even if the end-user only

		    // changed the month/year.  In order to determine if a date was

		    // clicked you can use the dateClicked property of the calendar:
		    if (calendar.dateClicked) {
		      // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
		      var y = calendar.date.getFullYear();
		      var m = calendar.date.getMonth()+1;     // integer, 0..11
		      var d = calendar.date.getDate();      // integer, 1..31
      	     document.formoferta.data_start.value= y+'-'+m+'-'+d;
		    }
		  };
function dateChangedF(calendar) {

		    // Beware that this function is called even if the end-user only

		    // changed the month/year.  In order to determine if a date was

		    // clicked you can use the dateClicked property of the calendar:

		    if (calendar.dateClicked) {

		      // OK, a date was clicked, redirect to /yyyy/mm/dd/index.php

		      var y = calendar.date.getFullYear();

		      var m = calendar.date.getMonth()+1;     // integer, 0..11

		      var d = calendar.date.getDate();      // integer, 1..31

		      

		     document.formoferta.data_finish.value= y+'-'+m+'-'+d;

		    }

		  };
