var isDHTML=0;
var isId=0;
var isAll=0;
var isLayers=0;

if(document.getElementById){
	isId=1;
	isDHTML=1;
}else{
	if(document.all){
		isAll=1;
		isDHTML=1;
	}else{
		browserVersion=parseInt(navigator.appVersion);
		if(navigator.appName.indexOf('Netscape')!=-1 && (browserVersion==4)) 
		{
			isLayers=1;
			isDHTML=1;
		}
	}
}
function findDOM(objectId, withStyle) 
{
	if(withStyle==1) 
	{
		if(isId) 
			return (document.getElementById(objectId).style);
		else if(isAll)
			return (document.all[objectId].style);
		else if(isLayers)
			return (document.layers[objectId]);
	}
	else 
	{
		if(isId) 
			return (document.getElementById(objectId));
		else if(isAll)
			return (document.all[objectId]);
		else if(isLayers)
			return (document.layers[objectId]); 
	}	  
}
			function progMenu(i) 
			{
				//alert('ff1');
				resetMenu();
				//alert('ff2');
				var mp = findDOM('mp'+i)
				//alert('ff3');
				mp.className="s";
				if (i>1)
				{
					var mpT = findDOM('mp'+(i-1));
					//mpT.childNodes[0].className="s1";
				}
				//alert('ff4');
				var mpt = findDOM('tab'+i)
				findDOM('mp'+i).className='current';
				//alert('ff5');
				mpt.className="progdetails objVisible";
				//alert('ff6');
			}
			function resetMenu()
			{
				for(i=1;i<=6;i++)
				{
					//alert('tt1');
					var mp = findDOM('mp'+i)
					//alert('tt2');
					mp.className="";
					if (i>1)
					{
						var mpT = findDOM('mp'+(i-1));
						//alert('tt3_'+i);
						//mpT.childNodes[0].className="";
						//alert('tt3bis_'+i);
					}
					//alert('tt4');
					var mpt = findDOM('tab'+i)
					mpt.className="objHidden";
				}
			}
function show_spec(id){
		for(i=1; i<=6; i++){
			findDOM('tab'+String(i)).style.display='none';
			findDOM('mp'+String(i)).className='sss';
		}				 	
			findDOM('tab'+id).style.display='block';
			findDOM('mp'+id).className='current';
}		

function ver() {
		f = document.getElementById('formular');
		erori = "";
		if (f.nume.value.length < 3) erori += "\nNu ati introdus numele";
		if (f.prenume.value.length < 3) erori += "\nNu ati introdus prenumele";
		if (f.data_plecare.value.length < 3) erori += "\nNu ati selectat data plecarii";
		if ((f.tip[1].checked) && (f.data_sosire.value.length < 3)) erori += "\nNu ati selectat data sosirii";
		if (f.plecare.selectedIndex == 0)  erori += "\nNu ati selectat orasul de plecare";
		if (f.destinatie.value.length < 3) erori += "\nNu ati selectat destinatia";
		if (f.email.value.length < 3) erori += "\nNu ati introdus adresa de e-mail";
		if (f.telefon.value.length < 3) erori += "\nNu ati introdus un numar de telefon";
		if (!VerifyTuring()) erori += "\nCodul introdus nu este corect";
		if (erori.length > 0) {
			alert(erori);
		}
		else {
			f.submit();
		}
	}

function verrez() {
		f = document.getElementById('formular');
		erori = "";
		if (f.nume.value.length < 3) erori += "\nNu ati introdus numele";
		if (f.prenume.value.length < 3) erori += "\nNu ati introdus prenumele";
		if (f.telefon.value.length < 3 && f.email.value.length < 3) erori += "\nNu ati introdus un numar de telefon sau o adresa de e-mail";
		
		if (f.data_sosire.value.length < 3) erori += "\nNu ati selectat data sosirii";
		if (f.data_plecare.value.length < 3) erori += "\nNu ati selectat data plecarii";
		
		if (f.cam_dbl.selectedIndex == 0 && f.cam_sgl.selectedIndex == 0) erori += "\nNu ati ales tipul de camera";
		if (f.adulti.selectedIndex == 0) erori += "\nNu ati ales numarul de persoane";
		if (f.copii.selectedIndex > 0 && f.varsta.selectedIndex == 0) erori += "\nNu ati selectat varsta copiilor";
		
		if (!VerifyTuring()) erori += "\nCodul introdus nu este corect";
		if (erori.length > 0) {
			alert(erori);
		}
		else {
			f.submit();
		}
}
	
	function VerifyTuring(){
		f = document.getElementById('formular');
		to = f.cod_user.value;
		to1= f.cod_bun.value;
		if (to == to1) {
			return true;
		}
		else {
			return false;
		}
	}
	
	function verAutocar() {
		f = document.getElementById('formular');
		erori = "";
		if (f.nume.value.length < 3) erori += "\nNu ati introdus numele";
		if (f.data_plecare.value.length < 3) erori += "\nNu ati selectat data plecarii";
		//if (f.email.value.length < 3) erori += "\nNu ati introdus adresa de e-mail";
		if (f.telefon.value.length < 3) erori += "\nNu ati introdus un numar de telefon";
		if (!VerifyTuring()) erori += "\nCodul introdus nu este corect";
		if (erori.length > 0) {
			alert(erori);
		}
		else {
			f.submit();
		}
	}
