function dgstr(lyid, drm) {
		var lyr = document.layers ? document.layers[lyid]:document.getElementById?document.getElementById(lyid).style:document.all[lyid].style;
		lyr.visibility = document.layers?(drm?"show":"hide"):(drm?"visible":"hidden");
		lyr.position = drm?"":"absolute";
}

function ifade(id,msj) {
	document.getElementById('mesaj'+id).value=document.getElementById('mesaj'+id).value + " " + msj;
}

function mgonder(i) {
	document.getElementById('mesajsonucu'+i).innerHTML="<font color='#FFFFFF'><span style='background-color: #CC3300'>&nbsp;&nbsp;Mesaj Gönderiliyor. Lütfen Bekleyiniz...&nbsp; </span></font>";
	document.getElementById('mesajsonucu2'+i).innerHTML="<font color='#FFFFFF'><span style='background-color: #CC3300'>&nbsp;&nbsp;Mesaj Gönderiliyor. Lütfen Bekleyiniz...&nbsp; </span></font>";

	var mesajx;
	var konux;
	var hedef_idx;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
	
	if(isIE) { 
	konux=document.getElementById('konu'+i).value;
	mesajx=document.getElementById('mesaj'+i).value;
	hedef_idx=document.getElementById('hedef_id'+i).value;
	selef_mesaj_idx=document.getElementById('selef_mesaj_id'+i).value;
	
	} else {
	konux=document.all['konu'+i].value;
	mesajx=document.all['mesaj'+i].value;
	hedef_idx=document.all['hedef_id'+i].value;
	selef_mesaj_idx=document.all['selef_mesaj_id'+i].value;
	}
		
    konux=escape(konux);konux=konux.replace(new RegExp('\\+','g'),'%2B');konux=konux.replace(new RegExp('%20','g'),'+');
    mesajx=escape(mesajx);mesajx=mesajx.replace(new RegExp('\\+','g'),'%2B');mesajx=mesajx.replace(new RegExp('%20','g'),'+');
	
	var req = null;
	var req = new XMLHttpRequest();

			if (req) {
				req.onreadystatechange = function() {
					if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {
				
						if (req.responseText=="tamam") {
								
								document.getElementById('mesajsonucu'+i).innerHTML="<span style='background-color: #B9F0BD'>&nbsp; <b>Mesaj Gönderildi.</b>&nbsp;</span>";
								document.getElementById('mesajsonucu2'+i).innerHTML="<span style='background-color: #B9F0BD'>&nbsp; <b>Mesaj Gönderildi.</b>&nbsp;</span>";

								//document.getElementById('profilalt'+i).style.visibility='hidden';
								//document.getElementById('profilalt'+i).style.position='absolute';
								//dgstr('mesajyaz'+i, 0);
								
								if (i!=0) {	mf_bosalt(i); }
								//dgstr('normal'+i, 1);
								//document.getElementById('konu'+i).value="";
								//document.getElementById('mesaj'+i).value="";
								
						} else if (req.responseText=="hata") {
							document.getElementById('mesajsonucu2'+i).innerHTML="<span style='background-color: #99ffff'>&nbsp; <b>Mesaj Gönderilemedi. Lütfen Tekrar Deneyiniz</b>&nbsp;</span>";
						} else if (req.responseText=="login") {
								document.getElementById('mesajsonucu'+i).innerHTML="<font color='#FFFFFF'><span style='background-color: #FF9933'>&nbsp;&nbsp;Mesaj göndermek için <a href='/uye/login.asp'><b>Üye Girişi</b></a> yapmanız gerekmektedir...&nbsp; </span></font>";
								document.getElementById('mesajsonucu2'+i).innerHTML="<font color='#FFFFFF'><span style='background-color: #FF9933'>&nbsp;&nbsp;Mesaj göndermek için <a href='/uye/login.asp'><b>Üye Girişi</b></a>  yapmanız gerekmektedir...&nbsp; </span></font>";
						} else if (req.responseText=="limitStandart") {
								document.getElementById('mesajsonucu'+i).innerHTML="<font color='#000000'><span style='background-color: #FF9933'>&nbsp;&nbsp;Şu anda mesaj gönderemiyorsunuz... Mesaj gönderme hakkı elde etmek için  <a href='/uye/?sayfa=abone'><b>tıklayın.</b></a> &nbsp; </span></font>";
								document.getElementById('mesajsonucu2'+i).innerHTML="<font color='#000000'><span style='background-color: #FF9933'>&nbsp;&nbsp;Şu anda mesaj gönderemiyorsunuz.... Mesaj gönderme hakkı elde etmek için <a href='/uye/?sayfa=abone'><b>tıklayın.</b></a></span></font>";

						} else if (req.responseText=="limitSilver") {
								document.getElementById('mesajsonucu'+i).innerHTML="<font color='#000000'><span style='background-color: #FF9933'>&nbsp;&nbsp;Bugünkü mesaj gönderme limitiniz doldu... GOLD üyeliğe geçerek dilediğiniz sayıda mesaj göndermek için <a href='/uye/?sayfa=abone'><b>tıklayın.</b></a> &nbsp; </span></font>";
								document.getElementById('mesajsonucu2'+i).innerHTML="<font color='#000000'><span style='background-color: #FF9933'>&nbsp;&nbsp;Bugünkü mesaj gönderme limitiniz doldu... GOLD üyeliğe geçerek dilediğiniz sayıda mesaj göndermek için  <a href='/uye/?sayfa=abone'><b>tıklayın.</b></a></span></font>";


						} // Bizim if sonu
					} //
		};
			
		req.open('POST', '/mesaj/xml_mesaj_gonder.asp?', true);
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=iso-8859-9');
		req.send('x=1&konu='+konux+'&mesaj='+mesajx+'&hedef_id='+hedef_idx+'&selef_mesaj_id='+selef_mesaj_idx);
	}	
}


function mf_doldur(id) {
var id;
var mf_html='';
mf_html="<table border='0' style='border-collapse: collapse' bordercolor='#111111' cellpadding=0 cellspacing=0 width='100%'><tr><td width='24' background='/resimler/sol-gri-orta.gif'>&nbsp;</td><td bgcolor='#EEEEEE' colspan=3>";
mf_html=mf_html+"<center><table border=0 cellpadding=2 cellspacing=0 style='border-collapse: collapse' bordercolor='#111111' width='500'><tr><td width=20><b><img border=0 src='/resimler/ifadeler/gulumse.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",':)');\"></b></td><td width=36><b>:)</b></td><td width=20><b><img border='0' src='/resimler/ifadeler/uzulme.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",':(');\"></b></td><td width='36'><b>:(</b></td><td width='20'><b><img border='0' src='/resimler/ifadeler/sasirma.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",':-o');\"></b></td><td width='36'><b>:-o</b></td><td width='20'><b><img border='0' src='/resimler/ifadeler/utanma.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",':$');\"></b></td><td width='36'><b>:$</b></td><td width='20'><b><img border='0' src='/resimler/ifadeler/kizma.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",':@');\"></b></td><td width='36'><b>:@</b></td><td width='20'><b><img border='0' src='/resimler/ifadeler/dudak.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",'(D)');\"></b></td><td width='36'><b>(D)</b></td><td width='20'><b><img border='0' src='/resimler/ifadeler/gul.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",'(G)');\"></b></td><td width='36'><p align='left'><b>(G)</b></td><td width='20'><b><img border='0' src='/resimler/ifadeler/kalp.gif' width=20 height=19 style='cursor:hand' onclick=\"javascript:ifade("+id+",'(K)');\"></b></td><td width='36'><b>(K)</b></td><td width='20'><b><img border='0' src='/resimler/ifadeler/kirik_kalp.gif' width='20' height='19' style='cursor:hand' onclick=\"javascript:ifade("+id+",'(KK)');\"></b></td><td width='36'><b>(KK)</b></td></tr></table></center></td><td width='16' background='/resimler/sag-gri-orta.gif'><span style='cursor:pointer' onclick=\"javascript:mf_bosalt("+id+");\"><img border='0' src='/resimler/kapat.gif' alt='Mesaj gönderme formunu kapatmak için tıklayın.' width='13' height='13'></span></font></b></td></tr><tr><td width=24 background='/resimler/sol-gri-orta.gif'></td><td bgcolor='#EEEEEE' colspan='3' valign=top><table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%'><tr><td width=43 valign=top>Konu:&nbsp; </td><td width=721><input type='text' name='konu"+id+"' size=70></td></tr><tr><td width=43 valign=top>Mesaj:</td><td><textarea rows=2 name='mesaj"+id+"' cols=100 onfocus=\"javascript:document.getElementById('mesaj"+id+"').rows=10;\"></textarea></td></tr><tr><td width=43>&nbsp;</td><td width=721><table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%'><tr><td width='19%'><input type='button' value='Gönder' name='B12' style='font-family: Arial; font-size: 8pt;height:20;width:100' onclick='javascript:mgonder("+id+");'></td><td width='81%'><div id='mesajsonucu2"+id+"' align='left'></div></td></tr></table></td></tr></table></td><td width=16 background='/resimler/sag-gri-orta.gif'>&nbsp;</td></tr><tr><td width='24' bgcolor='#EEEEEE'><IMG BORDER='0' SRC='/resimler/sol_alt.gif' width='24' height='24'></td><td background='/resimler/orta_alt.gif' valign=top colspan=3 ></td><td width=16><IMG BORDER='0' SRC='/resimler/sag_alt.gif' width='16' height='24'>";
mf_html=mf_html+"</td></tr><input type='hidden' name='hedef_id"+id+"' value='"+id+"'><input type='hidden' name='selef_mesaj_id"+id+"' value='0'></table>";

document.getElementById('profilalt'+id).innerHTML=mf_html;
}


function mf_bosalt(id) {
	var mf_html2="";
	mf_html2="<table border=0 style='border-collapse: collapse' bordercolor='#111111' cellpadding=0 cellspacing=0 width='100%'><tr><td width=20 height=3 valign='top'><img  border=0 src='/resimler/gri_sol_alt.gif' width=24 height=8></td><td colspan=3 background='/resimler/gri_alt.gif' height=3></td><td width=16 height=3 valign=top><img border=0 src=/resimler/gri_sag_kose.gif width=16 height=8></td></tr></table>";

	document.getElementById('profilalt'+id).innerHTML=mf_html2;
}




function mouseX(obj) {
	var curleft = 0;
	if (obj.offsetParent) 	{
		while (obj.offsetParent) 		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function mouseY(obj) {
	var curtop = 0;
	if (obj.offsetParent) 	{
		while (obj.offsetParent) 		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

//document.getElementById('form_gozkirp').style.visibility = 'hidden';

function gozkirp(icon,id) {
	var uye=id;
	if(icon != null && (typeof icon != 'undefined')) {
		var x = mouseX(icon) - 250;
		var y = mouseY(icon) + 20;

		document.getElementById('form_gozkirp').style.top = y + 'px';
		document.getElementById('form_gozkirp').style.left = x + 'px';
	}
	document.getElementById('form_gozkirp').style.display = 'block';
	document.getElementById('gozform').g_uye_id.value = uye;
	
		for (i=0, n=gozform.gmesaj.length; i<n; i++) {
			gozform.gmesaj[i].checked=false;
		}
	
}

function ggonder() {
	for (i=0, n=6; i<n; i++) {
		if (gozform.gmesaj[i].checked) {
			gmesaj=gozform.gmesaj[i].value;
		} 
	}
    gmesaj=escape(gmesaj);gmesaj=gmesaj.replace(new RegExp('\\+','g'),'%2B');gmesaj=gmesaj.replace(new RegExp('%20','g'),'+');
	id=document.getElementById('gozform').g_uye_id.value;
	
	document.getElementById('mesajsonucu'+id).innerHTML="<font color='#FFFFFF'><span style='background-color: #CC3300'>&nbsp;&nbsp;Göz Kırpma Gönderiliyor. Lütfen Bekleyiniz...&nbsp; </span></font>";
//	document.getElementById('mesajsonucu2'+id).innerHTML="<font color='#FFFFFF'><span style='background-color: #CC3300'>&nbsp;&nbsp;Göz Kırpma Gönderiliyor. Lütfen Bekleyiniz...&nbsp; </span></font>";

var req = new XMLHttpRequest();

			if (req) {
				req.onreadystatechange = function() {
					if (req.readyState == 4 && (req.status == 200 || req.status == 304)) {
						if (req.responseText=="tamam") {
								document.getElementById('mesajsonucu'+id).innerHTML="<span style='background-color: #B9F0BD'>&nbsp; <b>Göz Kırpıldı.</b>&nbsp;</span>";
//								document.getElementById('mesajsonucu2'+id).innerHTML="<span style='background-color: #B9F0BD'>&nbsp; <b>Göz Kırpıldı.</b>&nbsp;</span>";
								document.getElementById('form_gozkirp').style.display = 'none';
						} else if (req.responseText=="login") {
								document.getElementById('mesajsonucu'+id).innerHTML="<font color='#FFFFFF'><span style='background-color: #FF9933'>&nbsp;&nbsp;Göz kırpmak için <a href='/uye/login.asp'><b>Üye Girişi</b></a> yapmanız gerekmektedir...&nbsp; </span></font>";
//								document.getElementById('mesajsonucu2'+id).innerHTML="<font color='#FFFFFF'><span style='background-color: #FF9933'>&nbsp;&nbsp;Göz kırpmak için <a href='/uye/login.asp'><b>Üye Girişi</b></a> yapmanız gerekmektedir...&nbsp; </span></font>";
							
						} // Bizim if sonu
					} //
			};
			
		req.open('POST', '/mesaj/xml_gozkirp.asp?', true);
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=iso-8859-9');
		req.send('hedef_id='+id+'&konu='+gmesaj);
	}	


}