function SendFriend()
{
	document.getElementById('Background').style.visibility="visible";
	document.getElementById('Background').style.display="block";
	document.getElementById('WarnBackground').style.visibility="visible";
	document.getElementById('WarnBackground').style.display="block";
		if (bname == "Microsoft Internet Explorer" && bvers<7)
		document.body.style.overflow="hidden";
	loadSendArea();
	document.getElementById('SendFriend').style.visibility="visible";
	document.getElementById('SendFriend').style.display="block";
	loadSendFriendForm();
}
function loadSendFriendForm()
{
	var parameters = "";
	HttpRequest.onreadystatechange = WriteSendFriendForm;
	HttpRequest.open('GET', 'post.php', true);
	HttpRequest.setRequestHeader("Connection", "close");
	HttpRequest.send(parameters);
}
function WriteSendFriendForm() 
{
      if (HttpRequest.readyState == 4) 
	  {
         if (HttpRequest.status == 200) 
		 {
		 	result = HttpRequest.responseText;
			document.getElementById('sending').innerHTML = result; 
         } 
      }
	  else
	  {
			document.getElementById('sending').innerHTML = '<img src="Template/Images/Design/Layout/ajax.gif" title="Yükleniyor..." alt="Yükleniyor..." />'; 
	  }
}
function SendFriendLink()
{
	var writeit = '<ul><li><a href="#SendFriend" id="send_friend" onclick="javascript:SendFriend()" title="Bu sayfayı arkadaşınızla paylaşın.">Arkadaşına Gönder</a></li><li><a href="#" onclick="return printPage()" id="print" title="Bu sayfayı yazdır.">Yazdır</a></li><!--<li><a href="#" id="rss"  title="Sigortacılıkla ilgili makalelere abone olabilirsiniz.">Abone Ol</a></li>--></ul>';
	document.write(writeit);
}
function loadSendArea()
{
	var writeit = '<div style="width:447px"><div class="BackLayerTop"></div><!--BackLayerTop--><div class="BackLayerTopContent"><h2>Bu Sayfayı Paylaş</h2><div class="CloseButton" onclick="closeWarn()"  title="Kapat"></div><div class="clear"></div></div><!--BackLayerTopContent--><div class="BackLayerContent"><span id="sending"></span><div class="clear"></div></div><!--BackLayerContent--><div class="BackLayerBottom"></div></div>';
	document.getElementById('SendFriend').innerHTML = writeit; 
}
function postIt(obj)
{
	
	var parameter =	"Name=" + encodeURI( document.getElementById("Name").value ) + 
								"&LastName=" + encodeURI( document.getElementById("LastName").value ) +
								"&EMail=" + encodeURI( document.getElementById("EMail").value ) +
								"&FriendsName=" + encodeURI( document.getElementById("FriendsName").value ) +
								"&FriendsLastName=" + encodeURI( document.getElementById("FriendsLastName").value ) +
								"&FriendsEMail=" + encodeURI( document.getElementById("FriendsEMail").value ) +
								"&PageAdresses=" + document.getElementById("PageAdresses").value +
								"&Message=" + encodeURI( document.getElementById("Message").value );
	POSTRequest('post.php', parameter);
}
function POSTRequest(url, parameters)
{
	HttpRequest.open('POST', url, true);
	HttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	HttpRequest.setRequestHeader("Content-length", parameters.length);
	HttpRequest.setRequestHeader("Connection", "close");
	HttpRequest.onreadystatechange = alertContents;
	HttpRequest.send(parameters);
}
function alertContents() 
{
	  if (HttpRequest.readyState == 4) 
	  {
         if (HttpRequest.status == 200) 
		 {
				result = HttpRequest.responseText;
				document.getElementById('sending').innerHTML = result; 
				if(result == "")
					closeWarn();
         } 
      }
	  else
	  {
			document.getElementById('sending').innerHTML = '<img src="Template/Images/Design/Layout/ajax.gif" title="Yükleniyor..." alt="Yükleniyor..." />'; 
	  }
}
function Warns()
{
	var writeit = '<div id="Background"></div><!--Background--><div id="WarnBackground"><div id="Warn"></div><!--Warn--><div id="SendFriend"></div><!--SendFriend--></div><!--WarnBackground-->';
	document.write(writeit);
}
function WarnCss()
{
	var writeit = '<style type="text/css">#Background{filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5} #WarnBackground{filter:alpha(opacity=100);-moz-opacity:1;opacity:1} .CloseButton {cursor:hand;cursor:pointer}</style>';
	document.write(writeit)
}