
var gdDEBUG = false;
var gdIsLoaded = false;
var gdRun = false;

function gdCreateRollOvers(){
	if(document.getElementById){
		var gdImages = document.getElementsByTagName('IMG');
		var gdButtons = document.getElementsByTagName('INPUT');
	}else if(document.all){
		var gdImages = document.all['mouseovers'].all.tags('IMG');
		var gdButtons = document.all['mouseovers'].all.tags('INPUT');
	}else return;
	gdPreloads = new Object();

	for (var i = 0; i < gdImages.length; i++){
		var gdImageOffSrc = gdImages[i].src + "";
		if(gdImageOffSrc.indexOf("_off") != -1){
			var gdImageOnSrc = gdImageOffSrc.replace(/_off/g, "_on");
			gdPreloads['gdImageOff_' + i] = new Image();
			gdPreloads['gdImageOff_' + i].src = gdImageOffSrc;
			gdPreloads['gdImageOn_' + i] = new Image();
			gdPreloads['gdImageOn_' + i].src = gdImageOnSrc;
			gdImages[i].onmouseover = function(){this.src = this.src.replace(/_off/g, "_on");}
			gdImages[i].onmouseout = function(){this.src = this.src.replace(/_on/g, "_off");}
		}
	} 

	for (var i = 0; i < gdButtons.length; i++){
		if(gdButtons[i].src){
		var gdImageOffSrc = gdButtons[i].src + "";
		if(gdImageOffSrc.indexOf("_off") != -1){
			var gdImageOnSrc = gdImageOffSrc.replace(/_off/g, "_on");
			gdPreloads['gdImagebOff_' + i] = new Image();
			gdPreloads['gdImagebOff_' + i].src = gdImageOffSrc;
			gdPreloads['gdImagebOn_' + i] = new Image();
			gdPreloads['gdImagebOn_' + i].src = gdImageOnSrc;
			gdButtons[i].onmouseover = function(){this.src = this.src.replace(/_off/g, "_on");}
			gdButtons[i].onmouseout = function(){this.src = this.src.replace(/_on/g, "_off");}
		}
		}
	} 

}

function gdInit(){
	gdIsLoaded = true;
	gdCreateRollOvers();
	return gdStart();
}

function gdStart(){
	gdRun = true;
	return true;
}

function gdStop(){
	gdRun = false;
	return true;
}

function gdDestroy(){
	gdStop();
	return true;
}

function openw(url, windowname, attributes) { 
	window.open (url, windowname, attributes);
}

function closeme (){
	window.close();
	window.opener.focus();
	return true;
}


function checkNewsForm() {
	nume = document.nletter.n_nume.value;
	email = document.nletter.n_email.value;
	interes = document.nletter.n_interes.value;
	work = document.nletter.n_work.value;
	mesaj = document.nletter.n_mesaj.value;
	vcd = document.nletter.v_code.value;
	vcdimg = document.nletter.ver_code.value;
	
	if(nume == '' || email == '' || interes == '') {
		alert('Campurile nume,email,si interes achizitie sunt obligatorii');
	}
	else {
		if(vcd != vcdimg) {
			alert('Codul de verificare este invalid');
		}
		else {
			document.nletter.submit();
		}
	}

	
}


function checkNewsPressForm() {
	nume = document.nletter.n_nume.value;
	email = document.nletter.n_email.value;
	pub = document.nletter.n_publicatie.value;
	functie = document.nletter.n_functie.value;
	mesaj = document.nletter.n_mesaj.value;	
	vcd = document.nletter.v_code.value;
	vcdimg = document.nletter.ver_code.value;

	
	if(nume == '' || email == '' || pub == '' || functie == '') {
		alert('Campurile nume,email,publicatie si functie sunt obligatorii');
	}
	else {
		if(vcd != vcdimg) {
			alert('Codul de verificare este invalid');
		}
		else {
			document.nletter.submit();
		}
	}

	
}


function sendtofriend() {
		nume_sender = document.send2friend.sender_name.value;
		email_sender = document.send2friend.sender_email.value;
		nume_dest = document.send2friend.dest_name.value;
		email_dest = document.send2friend.dest_email.value;

		if(nume_sender == '' || email_sender =='' || nume_dest == '' || email_dest == '') {
			alert('In afara de campul mesaj, toate sunt obligatorii');
		}
		else {
			document.send2friend.submit();
		}
}

function cvCheck() {
	nume = document.cvForm.nume.value;
	prenume = document.cvForm.prenume.value;
	datan = document.cvForm.data_n_an.value;
	sex = document.cvForm.sex.value;
	adresa = document.cvForm.adresa.value;
	telefon = document.cvForm.telefon.value;
	email = document.cvForm.email.value;
	educatie = document.cvForm.educatie.value;
	limbi_straine = document.cvForm.limbi_straine.value;
	computers = document.cvForm.computers.value;
	permis = document.cvForm.permis.value;	
	obiective = document.cvForm.obiective_pers.value;
	
	vcd = document.cvForm.v_code.value;
	vcdimg = document.cvForm.ver_code.value;

	if(nume == '' || prenume == '' || datan == '' || sex == '' || adresa == '' || telefon == '' || email == '' || educatie == '' || limbi_straine == '' || computers == '' || permis == '' || obiective == '') {
		alert('Ati omis unul sau mai multe campuri obligatorii');
	}
	else {
		if(vcd != vcdimg) {
			alert('Codul de verificare este invalid');
		}
		else {
			document.cvForm.submit();
		}
	}



	
}

function bl_page() {
}


function AplicaCheck() {
	nume = document.aplica.nume.value;
	prenume = document.aplica.prenume.value;
	oras = document.aplica.oras.value;
	mob = document.aplica.mobil.value;
	fix = document.aplica.fix.value;
	mail = document.aplica.email.value;
	contact = document.aplica.contact.value;

	vcd = document.aplica.v_code.value;
	vcdimg = document.aplica.ver_code.value;

	if(nume == '' || prenume == '' || oras == '' || mob == '' || fix == '' || mail == '' || contact == '') {
		alert('Toate campurile in afara de mesaj sunt obligatorii');
	}
	else {
		if(vcd != vcdimg) {
			alert('Codul de verificare este invalid');
		}
		else {
			document.aplica.submit();
		}
	}
}

function pressAccountCheck() {
	nume = document.press_cr.nume.value;
	prenume = document.press_cr.prenume.value;
	email = document.press_cr.email.value;
	parola = document.press_cr.pass.value;
	publicatia = document.press_cr.publicatie.value;
	functia = document.press_cr.functia.value;
	specializare = document.press_cr.specializare.value;

	if(nume == '' || prenume == '' || email == '' || parola == '' || publicatia == '' || functia == '' || specializare == '') {
		alert('Toate campurile sunt obligatorii');
	}
	else {
		document.press_cr.submit();
	}
	
}

// Functii show-hidden layers

function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

function CheckComercialRequest() {
	company = document.com_request.company.value;
	activitate = document.com_request.activitate.value;
	experienta = document.com_request.experienta.value;
	marci = document.com_request.marci.value;
	locatii = document.com_request.locatii.value;
	suprafata = document.com_request.suprafata.value;
	vanzari = document.com_request.vanzari.value;
	contact = document.com_request.contact.value;

	if(company == '' || activitate == '' || experienta == '' || marci == '' || locatii == '' || suprafata == '' || vanzari == '' || contact == '') {
		alert('Toate campurile sunt obligatorii');
	}
	else {		
			document.com_request.submit();
	}

}

function OpenWindow(url,w,h) {
	detalii = window.open(url,'details','width='+w+',height='+h+', scrollbars=yes');
}

function OpenWindowNS(url,w,h) {
	detalii = window.open(url,'details','width='+w+',height='+h+', scrollbars=no');
}

function ContactMsg() {
	nume = document.genContact.c_nume.value;
	email = document.genContact.c_email.value;
	dept = document.genContact.dept.value;
	msg = document.genContact.c_msg.value;
	
	if(nume == '' || email == '' || dept == '' || msg == '') {
		alert('Toate campurile sunt obligatorii');
	}
	else {
		document.genContact.submit();
	}
}