 
function arata_statistici(zi,data,agentie,tip_comanda){
 
getHTTPObject2('ajax/statistici.php?data='+data+'&id_agentie='+agentie+'&tip_comanda='+tip_comanda,'statistici',zi);    
document.getElementById('data_'+zi).innerHTML='..loading';    
    
}


function valid_number(nb){
		var valid = '0123456789';
		var i = 0;
		var ok = 1;
		var ok1= 0;
		for (i=0; i<nb.length; i++){
			ok1 = 0;
			for (j=0; j<10; j++){
				if (valid.charAt(j)==nb.charAt(i)) ok1 = 1;
			}
			if (!ok1) ok = 0;
		}
		return ok;
	}
	function getCheckedValue(radioObj) {
		if(!radioObj)
			return "";
		var radioLength = radioObj.length;
		if(radioLength == undefined)
			if(radioObj.checked)
				return radioObj.value;
			else
				return "";
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].checked) {
				return radioObj[i].value;
			}
		}
		return "";
	}

	function valid_form(){

		var valid = true;
		var mesaj='';
				if (document.getElementById('nume').value == ''){
			valid = false;
			mesaj+='Numele ofertei nu a fost completat! \n';
		}

		if (document.getElementById('id_tara').value == '0'){
			valid = false;
			mesaj+='Nu a fost aleasa tara! \n';
		}
		if (getCheckedValue(document.getElementById('aleg_loc_sel'))== 'sel'){
			if (document.getElementById('id_localitate').value == '0'){
				valid = false;
				mesaj+='Nu a fost aleasa localitatea!\n';
			}
		} else {
			if (document.getElementById('localitate').value == ''){
				valid = false;
				mesaj+='Nu a fost completata localitatea!\n';
			}
		}
		var today = new Date();
//		if (document.getElementById('data_an_1').value < today.getYear){
	//		alert('Oferta pare a fi expirata1!');
	//		valid = false;
	//	} else {
	//		if (document.getElementById('data_an_1').value == today.getYear){
	//			if (document.getElementById('data_luna_1').value < today.getMonth){
	//				valid = false;
	//				alert('Oferta pare a fi expirata2!');
	//			} else {
	//				if (document.getElementById('data_luna_1').value == today.getMonth){
	//					if (document.getElementById('data_zi_1').value < today.getDay){
	//						valid = false;
	//						alert('Oferta pare a fi expirata3!');
	//					}
	//				}
	//			}
	//		}
	//	}
		if (!valid_number(document.getElementById('pret_generic').value)){
			valid = false;
			mesaj+='Pretul contine caractere invalide! \n';
		} else {
			if (document.getElementById('pret_generic').value < 10){
				valid = false;
				mesaj+='Pretul trebuie sa fie mai mare de 10! \n';
			}
		}
		
		if (document.getElementById('descriere').value.length < 10){
			valid = false;
			mesaj+='Descrierea nu a fost completata (cel putin 10 caractere)! \n';
		}
		
		
		if (valid) {
			return true;
		} else {
			alert(mesaj);
			return false;
		}
	}


function cautare_ajax() {

	index1=document.getElementById('gen_oferta').selectedIndex;
	valoare=document.getElementById('gen_oferta').options[index1].value;

	index1=document.getElementById('tip_oferta_search').selectedIndex;
	valoare2=document.getElementById('tip_oferta_search').options[index1].value;

	var valid=1;
	if(valoare=='') {
		mesaj='Nu ai ales genul ofertei';
		valid=0;
	}
	else if (valoare2=='') {
		mesaj='Nu ai ales tipul ofertei';
		valid=0;
	}

	if(valid==1) {
			document.getElementById('search_complex').submit();
	}
	else
		alert(mesaj);


}

function search_ajax3() {
	
	index1=document.getElementById('gen_oferta').selectedIndex;
	valoare=document.getElementById('gen_oferta').options[index1].value;

	index1=document.getElementById('tip_oferta_search').selectedIndex;
	valoare2=document.getElementById('tip_oferta_search').options[index1].value;

	index1=document.getElementById('tara_search').selectedIndex;
	valoare3=document.getElementById('tara_search').options[index1].value;


	getHTTPObject('ajaxing/search3.php?gen='+valoare+'&tip_oferta='+valoare2+'&id_tara='+valoare3,'oras_search');
	}
	
function search_ajax2() {
	
	index1=document.getElementById('gen_oferta').selectedIndex;
	valoare=document.getElementById('gen_oferta').options[index1].value;

	index1=document.getElementById('tip_oferta_search').selectedIndex;
	valoare2=document.getElementById('tip_oferta_search').options[index1].value;

	getHTTPObject('ajaxing/search2.php?gen='+valoare+'&tip_oferta='+valoare2,'tara_search');
	}

function search_ajax1() {
	
	index1=document.getElementById('gen_oferta').selectedIndex;
	valoare=document.getElementById('gen_oferta').options[index1].value;

	getHTTPObject('ajaxing/search1.php?gen='+valoare,'tip_oferta_search');
	}



function confirma_actiune(adresa) {
	if(confirm('Esti sigur ?'))
		document.location=adresa;
}


function sterge_oprire(id) {
var bulk='';

if(confirm("Sigur doresti sa stergi ?")) {
bulk+='&id_cursa='+document.getElementById('id_cursa').value;
getHTTPObject('ajax/transport.php?act=sterge_oprire&id='+id+bulk,'lista_statii');
document.getElementById('parcurs').innerHTML='';
}

}

function editeaza_oprire(id) {

getHTTPObject('ajax/transport.php?act=edit_stationare&id='+id,'stationare_controller_sus');
document.getElementById('stationare_controller_sus').style.display='block';
}


function adauga_cursa() {
	
	var valid=1;
	var mesaj='';
	var bulk='';
	var rangs=0;
	var index1=0;
	var valoare=0;
	var pozitie=0;
	
	if(document.getElementById('nume').value=='') {
		mesaj+='Numele cursei nu a fost completat\n';
		valid=0;
		}
	else bulk+='&nume='+document.getElementById('nume').value;
	

	if(document.getElementById('selector_operator_sel').checked==true) {
		index1=document.getElementById('id_operator').selectedIndex;
		valoare=document.getElementById('id_operator').options[index1].value;
		if(valoare=='') {
			mesaj+='Operatorul nu a fost selectat\n';
			valid=0;
			}
		else bulk+='&id_operator='+valoare;
		}


	if(document.getElementById('selector_operator_add').checked==true) {
		valoare=document.getElementById('operator').value;
		if(valoare=='') {
			mesaj+='Operatorul nu a fost completat\n';
			valid=0;
			}
		else bulk+='&operator='+valoare;
		
	}
	
	for(i=0;i<document.getElementById('nr_tipuri').value;i++)
		if(document.getElementsByName("tip_auto")[i].checked==true) { rangs=1;pozitie=i; }
	
	
	if(rangs==1)
		bulk+='&tip_auto='+document.getElementsByName("tip_auto")[pozitie].value;
	else {
		mesaj+='Tipul autovehiculului nu a fost completat\n';
		valid=0;	
	}

	if(document.getElementById('zile_sapt').value=='') {
		mesaj+='Zilele saptamanii nu au fost completate\n';
		valid=0;
		}
	else bulk+='&zile_sapt='+document.getElementById('zile_sapt').value;
	
	if(document.getElementById('ore_plecare').value=='') {
		mesaj+='Orele de plecare nu au fost completate\n';
		valid=0;
		}
	else bulk+='&ore_plecare='+document.getElementById('ore_plecare').value;

	bulk+='&observatii='+document.getElementById('observatii').value;

	if(valid==0) alert(mesaj);
	else {
			getHTTPObject('ajax/transport.php?act=add_cursa'+bulk,'tren_ok');
			
		
		}
		
}


function add_oprire(tip_actiune,id_stationare) {
	var valid=1;
	var mesaj='';
	var bulk='';
	bulk+='&id_cursa='+document.getElementById('id_cursa').value;
	
	
	if(document.getElementById('ora_sosire').value=='') {
		mesaj+='Ora plecarii nu a fost completata\n';
		valid=0;
		}
	else bulk+='&ora='+document.getElementById('ora_sosire').value;
		
	
	if(document.getElementById('selector_statie_sel').checked==true) {
		
		index1=document.getElementById('statie_sel').selectedIndex;
		valoare=document.getElementById('statie_sel').options[index1].value;
		if(valoare=='') {
			mesaj+='Statia nu a fost selectata\n';
			valid=0;
			}
		else bulk+='&id_statie='+valoare;
			
		} 
	
	if(document.getElementById('selector_statie_add').checked==true) {
		
		if(document.getElementById('statie_add').value=='') {
			mesaj+='Statia nu a fost introdusa\n';
			valid=0;
			}
		else bulk+='&statie='+document.getElementById('statie_add').value;
		
	
	if(document.getElementById('selector_localitate_sel').checked==true) {
		
		index1=document.getElementById('id_localitate').selectedIndex;
		valoare=document.getElementById('id_localitate').options[index1].value;
		if(valoare=='') {
			mesaj+='Localitatea nu a fost selectata\n';
			valid=0;
			}
		else bulk+='&id_localitate='+valoare;
		}

	if(document.getElementById('selector_localitate_add').checked==true) {
		
		if(document.getElementById('nume_localitate').value=='') {
			mesaj+='Localitatea nu a fost introdusa\n';
			valid=0;
			}
		else bulk+='&localitate='+document.getElementById('nume_localitate').value;
		}
		
	index1=document.getElementById('id_tara').selectedIndex;
	valoare=document.getElementById('id_tara').options[index1].value;
	if(valoare=='') {
		mesaj+='Tara nu a fost selectata\n';
		valid=0;
		}
	else bulk+='&id_tara='+valoare;
	
	
	}
	
	if(valid==0) alert(mesaj);
	else {
			if(tip_actiune=='edit') bulk+='&id_oprire='+id_stationare;
			getHTTPObject('ajax/transport.php?act=add_oprire&tip_actiune='+tip_actiune+bulk,'lista_statii');
						
			document.getElementById('ora_sosire').value='';
			document.getElementById('selector_statie_sel').checked=true;
			document.getElementById('statie_sel').selectedIndex=0;
			document.getElementById('statie_add').value='';
			
			document.getElementById('selector_localitate_sel').checked=true;
			document.getElementById('id_localitate').selectedIndex=0;
			document.getElementById('nume_localitate').value='';
			document.getElementById('arata_form_localitati').style.display='none';
			if(tip_actiune=='edit')
				document.getElementById('stationare_controller_sus').innerHTML='';
		}
		
}

function sterge_stationare(id) {
var bulk='';

if(confirm("Sigur doresti sa stergi ?")) {
bulk+='&id_tren='+document.getElementById('id_tren').value;
getHTTPObject('ajax/trenuri.php?act=sterge_stationare&id='+id+bulk,'lista_statii');
document.getElementById('parcurs').innerHTML='';
}

}

function editeaza_stationare(id) {

getHTTPObject('ajax/trenuri.php?act=edit_stationare&id='+id,'stationare_controller_sus');
document.getElementById('stationare_controller_sus').style.display='block';
}

function adauga_tren() {
	var valid=1;
	var mesaj='';
	var bulk='';
	var rangs=0;
	var pozitie=0;
	if(document.getElementById('numar').value=='') {
		mesaj+='Numarul trenului nu a fost completat\n';
		valid=0;
		}
	else bulk+='&numar='+document.getElementById('numar').value;
	
	for(i=0;i<document.getElementById('nr_ranguri').value;i++)
		if(document.getElementsByName("rang")[i].checked==true) { rangs=1;pozitie=i; }
	
	
	if(rangs==1)
		bulk+='&rang='+document.getElementsByName("rang")[pozitie].value;
	else {
		mesaj+='Rangul trenului nu a fost completat\n';
		valid=0;	
	}

	if(document.getElementById('nume').value=='') {
		}
	else bulk+='&nume='+document.getElementById('nume').value;
	if(valid==0) alert(mesaj);
	else {
			getHTTPObject('ajax/trenuri.php?act=add_tren'+bulk,'tren_ok');
			
		
		}
		
}

function add_statie(tip_actiune,id_stationare) {
	var valid=1;
	var mesaj='';
	var bulk='';
	bulk+='&id_tren='+document.getElementById('id_tren').value;
	
	
	if(document.getElementById('ora_sosire').value=='') {
		mesaj+='Ora sosirii nu a fost completata\n';
		valid=0;
		}
	else bulk+='&ora='+document.getElementById('ora_sosire').value;
		
	
	if(document.getElementById('selector_statie_sel').checked==true) {
		
		index1=document.getElementById('statie_sel').selectedIndex;
		valoare=document.getElementById('statie_sel').options[index1].value;
		if(valoare=='') {
			mesaj+='Statia nu a fost selectata\n';
			valid=0;
			}
		else bulk+='&id_statie='+valoare;
			
		} 
	
	if(document.getElementById('selector_statie_add').checked==true) {
		
		if(document.getElementById('statie_add').value=='') {
			mesaj+='Statia nu a fost introdusa\n';
			valid=0;
			}
		else bulk+='&statie='+document.getElementById('statie_add').value;
		
	
	if(document.getElementById('selector_localitate_sel').checked==true) {
		
		index1=document.getElementById('id_localitate').selectedIndex;
		valoare=document.getElementById('id_localitate').options[index1].value;
		if(valoare=='') {
			mesaj+='Localitatea nu a fost selectata\n';
			valid=0;
			}
		else bulk+='&id_localitate='+valoare;
		}

	if(document.getElementById('selector_localitate_add').checked==true) {
		
		if(document.getElementById('nume_localitate').value=='') {
			mesaj+='Localitatea nu a fost introdusa\n';
			valid=0;
			}
		else bulk+='&localitate='+document.getElementById('nume_localitate').value;
		}
		
	index1=document.getElementById('id_tara').selectedIndex;
	valoare=document.getElementById('id_tara').options[index1].value;
	if(valoare=='') {
		mesaj+='Tara nu a fost selectata\n';
		valid=0;
		}
	else bulk+='&id_tara='+valoare;
	
	
	}
	
	if(valid==0) alert(mesaj);
	else {
			if(tip_actiune=='edit') bulk+='&id_stationare='+id_stationare;
			getHTTPObject('ajax/trenuri.php?act=add_station&tip_actiune='+tip_actiune+bulk,'lista_statii');
						
			document.getElementById('ora_sosire').value='';
			document.getElementById('selector_statie_sel').checked=true;
			document.getElementById('statie_sel').selectedIndex=0;
			document.getElementById('statie_add').value='';
			
			document.getElementById('selector_localitate_sel').checked=true;
			document.getElementById('id_localitate').selectedIndex=0;
			document.getElementById('nume_localitate').value='';
			document.getElementById('arata_form_localitati').style.display='none';
			if(tip_actiune=='edit')
				document.getElementById('stationare_controller_sus').innerHTML='';
		}
		
}

function edit_tag(id,valoare,tip_tag) {
document.getElementById('con_span_'+id).innerHTML="<form onSubmit='return false'><input type=\"text\" name=\"edit_tag_"+id+"\" value='"+valoare+"' id=\"edit_tag_"+id+"\"  /><input type=\"button\" onclick=\"salveaza_tag('"+id+"','"+tip_tag+"')\" value=\"Go\"/></form>";
}

function salveaza_tag(id,tip_tag){
value=document.getElementById('edit_tag_'+id).value;
getHTTPObject2('ajax/edit_place_taguri.php?tip=ok&id='+id+'&tip_tag='+tip_tag+'&tag='+value,'edit',id);
}



function arata_cat_prin_img(nr) {

	if(nr==1) {

		document.getElementById('img_1').style.display="block";

		document.getElementById('img_2').style.display="none";

		document.getElementById('img_3').style.display="none";

		

		document.getElementById('link_img_1').className="tabnav_active";

		document.getElementById('link_img_2').className="";

		document.getElementById('link_img_3').className="";

		}

	if(nr==2) {

		document.getElementById('img_1').style.display="none";

		document.getElementById('img_2').style.display="block";

		document.getElementById('img_3').style.display="none";

		

		document.getElementById('link_img_1').className="";

		document.getElementById('link_img_2').className="tabnav_active";

		document.getElementById('link_img_3').className="";

		

		}



	if(nr==3) {

		document.getElementById('img_1').style.display="none";

		document.getElementById('img_2').style.display="none";

		document.getElementById('img_3').style.display="block";

		

		document.getElementById('link_img_1').className="";

		document.getElementById('link_img_2').className="";

		document.getElementById('link_img_3').className="tabnav_active";

		}



}



function verific_nr() {

	lungime=document.getElementById('continut').value.length;

	

	if(lungime>135) {

			document.getElementById('continut').value=document.getElementById('continut').value.substring(0,135);

			

	}

	if(lungime>140) {

			alert("Limita de 135 de caractere a fost depasita");

	}

	

}

function arata_cat(nr) {

	if(nr==1) {

		if(document.getElementById('content1'))

			document.getElementById('content1').style.display="block";

		if(document.getElementById('content2'))

			document.getElementById('content2').style.display="none";

		if(document.getElementById('content3'))

			document.getElementById('content3').style.display="none";



		if(document.getElementById('link1'))

			document.getElementById('link1').className="tabnav_active";

		if(document.getElementById('link2'))			

			document.getElementById('link2').className="";

		if(document.getElementById('link3'))			

			document.getElementById('link3').className="";

		}

	if(nr==2) {

		if(document.getElementById('content1'))		

			document.getElementById('content1').style.display="none";

		if(document.getElementById('content2'))			

			document.getElementById('content2').style.display="block";

		if(document.getElementById('content3'))		

			document.getElementById('content3').style.display="none";

		

		if(document.getElementById('link1'))		

			document.getElementById('link1').className="";

		if(document.getElementById('link2'))			

			document.getElementById('link2').className="tabnav_active";

		if(document.getElementById('link3'))			

			document.getElementById('link3').className="";

		

		}



	if(nr==3) {

		if(document.getElementById('content1'))				

			document.getElementById('content1').style.display="none";

		if(document.getElementById('content2'))				

			document.getElementById('content2').style.display="none";

		if(document.getElementById('content3'))		

			document.getElementById('content3').style.display="block";



		if(document.getElementById('link1'))

			document.getElementById('link1').className="";

		if(document.getElementById('link2'))

			document.getElementById('link2').className="";

		if(document.getElementById('link3'))			

		document.getElementById('link3').className="tabnav_active";

		}



}



function arata_cat2(nr) {

	if(nr==1) {

		if(document.getElementById('content1'))					

			document.getElementById('content1').style.display="block";

		if(document.getElementById('content2'))					

			document.getElementById('content2').style.display="none";

		if(document.getElementById('content3'))		

			document.getElementById('content3').style.display="none";

		if(document.getElementById('content4'))		

			document.getElementById('content4').style.display="none";

		if(document.getElementById('content5'))

			document.getElementById('content5').style.display="none";

		

		if(document.getElementById('link1'))		

			document.getElementById('link1').className="tabnav_active";

		if(document.getElementById('link2'))

			document.getElementById('link2').className="";

		if(document.getElementById('link3'))	

			document.getElementById('link3').className="";

		if(document.getElementById('link4'))

			document.getElementById('link4').className="";

		if(document.getElementById('link5'))

			document.getElementById('link5').className="";		

		

		}

	if(nr==2) {

		if(document.getElementById('content1'))

			document.getElementById('content1').style.display="none";

		if(document.getElementById('content2'))

			document.getElementById('content2').style.display="block";

		if(document.getElementById('content3'))

			document.getElementById('content3').style.display="none";

		if(document.getElementById('content4'))

			document.getElementById('content4').style.display="none";

		if(document.getElementById('content5'))

			document.getElementById('content5').style.display="none";



		if(document.getElementById('link1'))

			document.getElementById('link1').className="";

		if(document.getElementById('link2'))

			document.getElementById('link2').className="tabnav_active";

		if(document.getElementById('link3'))	

			document.getElementById('link3').className="";

		if(document.getElementById('link4'))

			document.getElementById('link4').className="";

		if(document.getElementById('link5'))

			document.getElementById('link5').className="";

		

		}



	if(nr==3) {

		if(document.getElementById('content1'))

			document.getElementById('content1').style.display="none";

		if(document.getElementById('content2'))					

			document.getElementById('content2').style.display="none";

		if(document.getElementById('content3'))					

			document.getElementById('content3').style.display="block";

		if(document.getElementById('content4'))			

			document.getElementById('content4').style.display="none";

		if(document.getElementById('content5'))			

			document.getElementById('content5').style.display="none";



		if(document.getElementById('link1'))

			document.getElementById('link1').className="";

		if(document.getElementById('link2'))		

			document.getElementById('link2').className="";

		if(document.getElementById('link3'))			

			document.getElementById('link3').className="tabnav_active";

		if(document.getElementById('link4'))			

			document.getElementById('link4').className="";

		if(document.getElementById('link5'))			

			document.getElementById('link5').className="";

		}

	if(nr==4) {

		if(document.getElementById('content1'))		

			document.getElementById('content1').style.display="none";

		if(document.getElementById('content2'))			

			document.getElementById('content2').style.display="none";

		if(document.getElementById('content3'))		

			document.getElementById('content3').style.display="none";

		if(document.getElementById('content4'))			

			document.getElementById('content4').style.display="block";

		if(document.getElementById('content5'))

			document.getElementById('content5').style.display="none";



		if(document.getElementById('link1'))

			document.getElementById('link1').className="";

		if(document.getElementById('link2'))			

			document.getElementById('link2').className="";

		if(document.getElementById('link3'))			

			document.getElementById('link3').className="";

		if(document.getElementById('link4'))

			document.getElementById('link4').className="tabnav_active";

		if(document.getElementById('link5'))			

			document.getElementById('link5').className="";		

		}

	if(nr==5) {

		if(document.getElementById('content1'))		

			document.getElementById('content1').style.display="none";

		if(document.getElementById('content2'))					

			document.getElementById('content2').style.display="none";

		if(document.getElementById('content3'))		

			document.getElementById('content3').style.display="none";

		if(document.getElementById('content4'))			

			document.getElementById('content4').style.display="none";

		if(document.getElementById('content5'))			

			document.getElementById('content5').style.display="block";



		if(document.getElementById('link1'))

			document.getElementById('link1').className="";

		if(document.getElementById('link2'))			

			document.getElementById('link2').className="";

		if(document.getElementById('link3'))			

			document.getElementById('link3').className="";

		if(document.getElementById('link4'))			

			document.getElementById('link4').className="";

		if(document.getElementById('link5'))			

			document.getElementById('link5').className="tabnav_active";		

		}



}



function arata_box_lines(nr) {

	for(i=1;i<=4;i++){

		if(nr==i) {

			document.getElementById('li_lines_'+nr).className="oferte_active";

			document.getElementById('box_lines'+nr).style.display="block";

			}

		else {

			document.getElementById('li_lines_'+i).className="";

			document.getElementById('box_lines'+i).style.display="none";

			}

		}

	}





function arata_box_lines2(nr) {	

	

	for(i=1;i<=7;i++){

		if(nr==i) {

			document.getElementById('li_lines_'+nr).className="oferte_active";

			document.getElementById('tara_box_lines'+nr).style.display="block";

			}

		else {

			if(document.getElementById('li_lines_'+i)) {	

				document.getElementById('li_lines_'+i).className="";

				document.getElementById('tara_box_lines'+i).style.display="none";

				}

			}

		}

	}





function arata_box_img(nr) {

		

	for(i=1;i<=3;i++){

		if(nr==i) {			

			document.getElementById('li_img_'+nr).className="oferte_active";

			document.getElementById('box_images_'+nr).style.display="block";

			}

		else {

			document.getElementById('li_img_'+i).className="";

			document.getElementById('box_images_'+i).style.display="none";

			}

		

		}

	}	

	

function news_insc(){
	var valid=1;
    
	if(document.getElementById('email').value=='') valid=0;
    else if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value)) valid=0;
	index1=document.getElementById('tip_oferta').selectedIndex;
	tip_of=document.getElementById('tip_oferta').options[index1].value;
	index1=document.getElementById('tip_oferta2').selectedIndex;
	tip_of2=document.getElementById('tip_oferta2').options[index1].value;
	index1=document.getElementById('tara').selectedIndex;
	tara=document.getElementById('tara').options[index1].value;
	email=document.getElementById('email').value;
	var bulk="";

	bulk='?tipOfertaHtml='+tip_of+'&tipOferta2Html='+tip_of2+'&taraHtml='+tara+'&adresaHtml='+email;

	

	if(valid==0) alert("Va rugam introduceti o adresa de e-mail");

	else {

		getHTTPObject('ajaxing/newsletter_add.php'+bulk,'newsletter_add');

		//document.getElementById('news_content').className = 'newsletter_content_alert';	

		//document.getElementById('news_content').innerHTML = '';
        var a = new Array();
        a['titlu'] = 'Multumim';
        a['content'] = 	'Adresa dumneavoastra de email a fost inregistrata!<div id="footer"><input type="button" value="Inchide" onclick="popupRemove();" /></div>';
        popupRemove();
        popup(a)
		}

		

}



function turn_back_local(unde,tip){

	if(unde==1) {

		index1=document.getElementById('inapoi').selectedIndex;

		valoare=document.getElementById('inapoi').options[index1].value;

		document.location=tip+"/"+valoare+"/";

	}

	if(unde==2) {

		index1=document.getElementById('inapoi').selectedIndex;

		valoare=document.getElementById('inapoi').options[index1].value;

		

		tip_of=document.getElementById('tipul_ofertei').value;

		document.location=tip+"/"+tip_of+'/'+valoare+"/";

	}

}




function turn_back(unde,tip){

	if(unde==1) {

		index1=document.getElementById('inapoi').selectedIndex;

		valoare=document.getElementById('inapoi').options[index1].value;

		document.location=tip+"/"+valoare+".html";

	}

	if(unde==2) {

		index1=document.getElementById('inapoi').selectedIndex;

		valoare=document.getElementById('inapoi').options[index1].value;

		

		tip_of=document.getElementById('tipul_ofertei').value;

		document.location=tip+"/"+tip_of+'/'+valoare+".html";

	}

}



function trimite_mesaj(id_agentie,id_oferta) {

	

document.getElementById('frame_rasp').height=100;	

document.getElementById('rezultat_form').height=200;	

document.getElementById('frame_rasp').className="iframe_class";	

document.getElementById('inreg_form').submit();

}



function arata_parola() {

	

document.getElementById('frame_parola').height=200;	

document.getElementById('frame_parola').className="iframe_class_parola";	



}



function arata_mesaj(id) {

	

document.getElementById('frame_parola_'+id).height=220;	

document.getElementById('frame_parola_'+id).className="iframe_class_parola";	



}





function goleste_formular() {

	top.self.document.getElementById('nume_client').value='';

	top.self.document.getElementById('email_client').value='';

	top.self.document.getElementById('continut').value='';

	top.self.document.getElementById('security_code').value='';

}





function confirmare(mesaj,unde,id) {

	if(confirm(mesaj)){

			document.location=unde+'?id_stergere='+id;

	}

}



function confirmare2(mesaj,unde,id) {

	if(confirm(mesaj)){

			document.location=unde+'&id_stergere='+id;

	}

}



function sterge_poza(adresa) {

	

	if(confirm("Sunteti sigur?"))

		document.location=adresa;

}

function marcheaza_citit(tip,id,act){

	getHTTPObject('ajaxing/mesaj_citit.php?act='+act+'&tip='+tip+'&id='+id,'citit');

	if(act==1)

		document.getElementById('citit_'+id).innerHTML = 'DA';

	else

		document.getElementById('citit_'+id).innerHTML = 'NU';

}



function vezi_tip() {

	index1=document.getElementById('tip_oferta').selectedIndex;

	valoare=document.getElementById('tip_oferta').options[index1].value;

	if(valoare==2)

		getHTTPObject('ajaxing/circuite.php','zone_news');



}


function link_rec(id_firma, id_ad) {
	getHTTPObject('ajaxing/ads.php?t=link_recomandat&id_ad='+id_ad+'&id_firma='+id_firma,'zone_news');
	}
function banner_stg(id_firma, id_ad) {
	getHTTPObject('ajaxing/ads.php?t=banner_stanga&id_ad='+id_ad+'&id_firma='+id_firma,'zone_news');
	} 
function anunt_top(id_firma, id_ad) {
	getHTTPObject('ajaxing/ads.php?t=anunt_top&id_ad='+id_ad+'&id_firma='+id_firma,'zone_news');
	}
function anunt_dreapta(id_firma, id_ad) {
	getHTTPObject('ajaxing/ads.php?t=anunt_dreapta&id_ad='+id_ad+'&id_firma='+id_firma,'zone_news');
	}        
function oferte_recomandate(id_firma, id_ad) {
	getHTTPObject('ajaxing/ads.php?t=oferte_recomandate&id_ad='+id_ad+'&id_firma='+id_firma,'zone_news');
	}               
function monit(id_firma, id_ad,tip_reclama) {
	getHTTPObject('ajaxing/ads.php?t='+tip_reclama+'&id_ad='+id_ad+'&id_firma='+id_firma,'zone_news');
	}      
     
