function getRightLink(str)
{
theleft = str.indexOf("?")+1;
return(str.substring(theleft, str.length));
}

function addLocation(){
	var NowLocation = window.location;
	document.getElementById('ReqLoc').value = NowLocation;
 	var textToPares = document.getElementById('ReqLoc').value;
	document.getElementById('ReqLoc').value = getRightLink(textToPares);
	//alert(document.getElementById('ReqLoc').value);
}
function validation(){

	var allnames = document.getElementsByTagName("input");
	for (a=0;a<allnames.length;a++)
	{
		switch (allnames[a].id)
	  	{																	
		case 'Email':		if(allnames[a].value == '')
								{ alert('&eth;&agrave; &auml;º&igrave;&atilde;/&eacute; Email');allnames[a].focus();return false;}
							else {
									var reEmail = /^[-\w\d\.]+@[-\w\d\.]+\.[-\w\d\.]+$/;
									if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(allnames[a].value)))
										{   alert("&euml;&uacute;&aring;&aacute;&uacute; EMAIL &agrave;&eacute;&eth;&auml; &uacute;º&eacute;&eth;&auml;");allnames[a].focus();return false;}
								}
							break;							
		case 'fullname':		if(allnames[a].value == '')
								{   alert('&eth;&agrave; &auml;º&igrave;&atilde;/&eacute; &ugrave;&iacute;');allnames[a].focus();return false;}
							break;								
		case 'RecommandToEmail1':		if(allnames[a].value == '')
								{ alert('&eth;&agrave; &auml;º&igrave;&atilde;/&eacute; Email');allnames[a].focus();return false;}
							else {
									var reEmail = /^[-\w\d\.]+@[-\w\d\.]+\.[-\w\d\.]+$/;
									if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(allnames[a].value)))
										{   alert("&euml;&uacute;&aring;&aacute;&uacute; EMAIL &agrave;&eacute;&eth;&auml; &uacute;º&eacute;&eth;&auml;");allnames[a].focus();return false;}
								}
							break;																	
	  	}
	}		
	return true;
	window.close();
}
function open_stf_popup(object)
{
	var newLocation = 'http://www.shimur.org/english/sendToAFriend.html?' + object;
		window.open(newLocation,null,"fullscreen=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, titlebar=no, top=100, width=350, height=370")
}
