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('Please enter your Email address');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("Please enter a valid Email address");allnames[a].focus();return false;}
								}
							break;							
		case 'fullname':		if(allnames[a].value == '')
								{   alert('Please enter your Name');allnames[a].focus();return false;}
							break;								
		case 'RecommandToEmail1':		if(allnames[a].value == '')
								{ alert('Please enter your Colleague`s Email address');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("Please enter a valid Email address for your Colleague");allnames[a].focus();return false;}
								}
							break;																	
	  	}
	}		
	return true;
	window.close();
}
function open_stf_popup(object)
{
	var newLocation = 'http://ns1.php4.co.il/~kivuntev/sendToAFriend.html?' + object;
		window.open(newLocation,"_blank","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=500")
}
