function doSearchHitEnter(e)
{
 var keynum;

 if(window.event) // IE
 {
 keynum = e.keyCode;
 }
 else if(e.which) // Netscape/Firefox/Opera
 {
 keynum = e.which;
 }
 if (keynum == 13){
	SearchString();
 return false;
 }
 return true;
}

function doSearchHitEnter2(e)
{
 var keynum;

 if(window.event) // IE
 {
 keynum = e.keyCode;
 }
 else if(e.which) // Netscape/Firefox/Opera
 {
 keynum = e.which;
 }
 if (keynum == 13){
	SearchString2();
 return false;
 }
 return true;
}

function isNumber(str)
{
	var reg=/^[0-9]+$/;
	if(str.search(reg) != -1) {
		return true;
	}
	else {
		return false;
	}
}

/* ------------------------ contact formular ------------------------ */
	
function isEmail(string)
{
if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else
return false;
}

function doarCifre(elem, helperMsg){
var numericExpression = /^[0-9]+$/;
if(elem.value.match(numericExpression)){return true;}else{
alert(helperMsg);
elem.focus();
return false;
}}
function gup1( name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
function contact() { 
	var mesaj = '';
	document.getElementById('tel').value = '';
	if ((document.getElementById('name').value.length == 0)) {
		mesaj=mesaj+'Please enter your name! \n';
	}
	if ((isEmail(document.getElementById('email').value) == false)) {
		mesaj=mesaj+'Please enter a valid e-mail address! \n';
	}
	if ((document.getElementById('mesaj').value.length == 0)) {
		mesaj=mesaj+'Please enter your message! \n';
	}
	
	if (mesaj == '') {
		if (gup1('par') != "")
			window.location.href='/Util/DoEmail.aspx?redirect=http://chiuariulawyers.ro/contact.aspx?1&from='+document.getElementById('email').value+'&to=ip@chiuariulawyers.ro&subiect=Mesaj%20de%20pe%20site%20-%20www.tudorchiuariu.ro&mesaj=E-mail: '+document.getElementById('email').value+'<br /> Nume: '+document.getElementById('name').value+'<br /> Telefon: '+document.getElementById('tel').value+'<br /> Mesaj:<br /><br />'+document.getElementById('mesaj').value;
		else
			window.location.href='/Util/DoEmail.aspx?redirect=http://chiuariulawyers.ro/contact.aspx?1&from='+document.getElementById('email').value+'&to=office@chiuariulawyers.ro&subiect=Mesaj%20de%20pe%20site%20-%20www.tudorchiuariu.ro&mesaj=E-mail: '+document.getElementById('email').value+'<br /> Nume: '+document.getElementById('name').value+'<br /> Telefon: '+document.getElementById('tel').value+'<br /> Mesaj:<br /><br />'+document.getElementById('mesaj').value;
	} else
		alert(mesaj);
}
	
/* ------------------------ end of contact formular ------------------------ */

function doneaza() { 
	var sw = 0;
	var mesaj = '';
	if ((document.getElementById('nume').value.length == 0) && (sw==0)) {
		mesaj='Va rugam sa va introduceti numele! \n';
		sw = 1;
	}
	if ((document.getElementById('prenume').value.length == 0) && (sw==0)) {
		mesaj='Va rugam sa va introduceti prenumele! \n';
		sw = 1;
	}
	if ((document.getElementById('adresa').value.length == 0) && (sw==0)) {
		mesaj='Va rugam sa va introduceti adresa! \n';
		sw = 1;
	}
	if ((isEmail(document.getElementById('email').value) == false)&&(sw==0)) {
		mesaj='Va rugam sa introduceti o adresa de e-mail valida! \n';
		sw = 1;
	}
	if ((document.getElementById('telefon').value.length == 0)&&(sw==0)) {
		mesaj='Va rugam sa introduceti numarul dvs. de telefon! \n';
		sw = 1;
	}
	if ((document.getElementById('suma').value.length == 0) && (sw==0)) {
		mesaj='Va rugam sa introduceti suma donata! \n';
		sw = 1;
	}
	if ((document.getElementById('comentariu').value.length == 0)&&(sw==0)) {
		mesaj='Va rugam introduceti comentariul dumnevoastra! \n';
		sw = 1;
	}
	if (sw == 0) {
	window.location.href='http://z.ekontent.ro/DoEmail.aspx?redirect=http://chiuariulawyers.ro/mesaj-trimis.aspx&from='+document.getElementById('email').value+'&to=cristina.salageanu@ekontent.ro&subiect=Mesaj%20de%20pe%20site%20[ABC]&mesaj=Email: '+document.getElementById('email').value+'<br /> Nume: '+document.getElementById('nume').value+'<br /> Prenume: '+document.getElementById('prenume').value+'<br /> Adresa: '+document.getElementById('adresa').value+'<br /> Telefon: '+document.getElementById('telefon').value+'<br /> Suma donata: '+document.getElementById('suma').value+'<br /> Comentariu:<br /><br />'+document.getElementById('comentariu').value;
	} else
		alert(mesaj);
}

function doNewsletter() {
	var sw = 0;
	var mesaj = '';
	if ((isEmail(document.getElementById('news_email').value) == false)&&(sw==0)) {
		mesaj='Please provide a valid e-mail address to subscribe to our newsletter! \n';
		sw = 1;
	}
	if (sw == 0){
		window.location.href='http://chiuariulawyers.ro/newsletter.aspx?subscription_email='+document.getElementById('news_email').value+'&subscription_birthday=12/12/2007&subscription_sex=1&subscription_active=1';
	} else
	alert(mesaj);
}


function redirect_to_ro() {
	var url=location.href;
	
	if (url.indexOf("/home.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/acasa.aspx";	
		
	else if (url.indexOf("/about-us/company-profile.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/despre-noi/Profilul-societatii-noastre.aspx";
		
	else if (url.indexOf("/about-us/vision-and-values.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/despre-noi/Viziunea-si-valorile-noastre.aspx";
		
	else if (url.indexOf("/about-us/our-team.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/despre-noi/echipa-noastra.aspx";
		
	else if (url.indexOf("/about-us/memberships-and-affiliations.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/despre-noi/Afilieri-internationale.aspx";
		
	else if (url.indexOf("/practice-areas.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/domenii-de-expertiza.aspx";
		
	else if (url.indexOf("/news/tcal-in-the-press.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/noutati/Echipa-Chiuariu-Asociatii-in-mass-media.aspx";
		
	else if (url.indexOf("/news/press-releases.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/noutati/comunicate-de-presa.aspx";
		
	else if (url.indexOf("/publications-and-events.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/publicatii-si-evenimente.aspx";
	
	else if (url.indexOf("/contact.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/contact-ro.aspx";
		
	else if (url.indexOf("/about-us/company-profile.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/despre-noi/Profilul-societatii-noastre.aspx";
		
	else if (url.indexOf("/43/section.aspx/101") >= 0)
		location.href="http://www.chiuariulawyers.ro/87/section.aspx/100";
		
	else if (url.indexOf("/43/section.aspx/98") >= 0)
		location.href="http://www.chiuariulawyers.ro/87/section.aspx/96";
		
	else if (url.indexOf("/practice-areas.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/domenii-de-expertiza.aspx";
		
	else if (url.indexOf("/terms-and-conditions.aspx") >= 0)
		location.href="http://www.chiuariulawyers.ro/termeni-si-conditii.aspx";		
	
	else if (url.indexOf("/contact.aspx?par=1") >= 0)
		location.href="http://www.chiuariulawyers.ro/contact-ro.aspx?par=1";	
		
		
	//Despre noi - Tudor Chiuariu
	else if (url.indexOf("/48/section.aspx/20") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/55";	
		
	//Despre noi - Iulia Stanciulescu
	else if (url.indexOf("/48/section.aspx/24") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/51";	
	
	// Despre noi - Mihai Badea
	else if (url.indexOf("/48/section.aspx/224") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/223";

	// Despre noi - Catrinel Florescu
	else if (url.indexOf("/48/section.aspx/22") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/40";	
		
	//Despre noi - Georgiana Teodorescu	
	else if (url.indexOf("/48/section.aspx/25") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/53";	
		
	//Despre noi - Dan Vatamaniuc 
	else if (url.indexOf("/48/section.aspx/23") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/41";	
		
	//Despre noi - Andeea Grigorescu
	else if (url.indexOf("48/section.aspx/215") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/216";
	
	//Despre noi - Ileana Maria Florea
	else if (url.indexOf("48/section.aspx/186") >= 0) 
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/187";	
		
	//Despre noi - Ludwig Petre
	else if (url.indexOf("48/section.aspx/21") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/56";	

	//Despre noi - Roxana Giurea
	else if (url.indexOf("/48/section.aspx/113") >= 0)
		location.href="http://www.chiuariulawyers.ro/109/section.aspx/114";
		
	else 
		location.href="http://www.chiuariulawyers.ro/acasa.aspx";
		
		
}

