function referFriend(cat,text,x,y){		
		var locate = ""+window.location+"";
		var splLoc = locate.split("?");
		var page = splLoc[0];
		var div = document.getElementById('refer');


		if(x==''){
		 leftA = (document.body.clientWidth/2)-155;
		}else{
		 leftA = x;
		}
		
		if(y==''){
		  topA = '200';
		}else{
		  topA = y; 
		}
		
		div.style.visibility='visible';
		var form = '<div style="width:250px; font-family:Arial, Helvetica, sans-serif; color:#174583; border:3px solid #000000; background-color:#EEEEEE; padding:5px; text-align:center;"><div style="width:100%;text-align:right;"><a href="javascript:void(0);" onClick="document.getElementById(\'refer\').style.visibility=\'hidden\';" style="text-decoration:none;">Close [X]</a></div><br /><center><div id="header" style="font-size:20px; font-weight:bold">'+text+'</div></center><br />'+
			'To Refer this Site to a Friend Enter His/Her Email Address Below.<br /><br />'+
			'<form name="contact" method="post" action="/files/common/scripts/formhandler.php"><input name="site_id" type="hidden" value="'+cat+'" />'+
			'<input name="sendmail" type="hidden" value="3" />'+
			'<input name="msg_type" type="hidden" value="refer" />'+
			'Your Name Here:<br />'+
			'<input type="text" name="name" style="margin-bottom:10px;width:200px"><br />'+
			'Your Email Address Here:<br />'+
			'<input type="text" name="mainE" style="margin-bottom:10px;width:200px"><br />'+
			'You Can Enter Up to<br />Five Emails at a Time.<br /><br />'+
			'<table border="0" align="center"><tr><td align="left">'+
			'Email 1:<br />'+
			'<input type="text" name="email[]" style="width:200px;margin-bottom:4px;border: 1px solid #999;font-size:14px;"><br />'+
			'Email 2:<br />'+
			'<input type="text" name="email[]" style="width:200px;margin-bottom:4px;border: 1px solid #999;font-size:14px;"><br />'+
			'Email 3:<br />'+
			'<input type="text" name="email[]" style="width:200px;margin-bottom:4px;border: 1px solid #999;font-size:14px;"><br />'+
			'Email 4:<br />'+
			'<input type="text" name="email[]" style="width:200px;margin-bottom:4px;border: 1px solid #999;font-size:14px;"><br />'+
			'Email 5:<br />'+
			'<input type="text" name="email[]" style="width:200px;margin-bottom:4px;border: 1px solid #999;font-size:14px;"><br />'+
			'<input type="hidden" name="page" value="'+page+'">'+
			'</td></tr>'+
			'<tr><td align="right">'+
			'<input type="submit" name="submit" value="Send Email" style="width:100px;background-color:#DDD;border:1px solid #999;">'+
			'</td></tr>'+
			'</table>'+
			'</form></div>';
		div.innerHTML=form;
		div.style.position='absolute';
		div.style.top=topA+'px';
		div.style.left=leftA+'px';
}