function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function MesajGonder(){
ShowDiv('mesajgonder')
}
var effect_1 = null;
var highlightin= 0;
var yuklegoster=0;
var sonentryfalan='';
		function checkempty(form){var returnval=true;for (i=0; i<form.elements.length; i++){alert(form.elements[i].name);if (form.elements[i].value==""){returnval=false;break}}return returnval}	
		function Ajax(urla, divid,t,yuklegoster,mesajne){

//if (divid=='entryfalan'){sonentryfalan=urla;}

if (t!='onlineuser' && document.getElementById('iconline')!=null){onlineJS2('a')};
if (t=='uyeform'){url='/includes/u.asp?u='+urla};
if (t=='sonbasliklar'){url='/includes/sonbasliklar.asp?u='+urla+'&'};
if (t=='baslikara'){url='/includes/a.asp?u='+urla+'&'};
if (t=='baslikgetir'){url='/includes/b.asp?b='+urla+'&'};
if (t=='mesajucur'){url='/includes/ms.asp?m='+urla+'&'};
if (t=='entrygetir'){url='/includes/e.asp?e='+urla+'&'};
if (t=='ihbar'){url='/includes/i.asp?e='+urla+'&'};
if (t=='baslikihbar'){url='/includes/i.asp?baslik=1&e='+urla+'&'};
if (t=='sm'){url='/includes/sm.asp?e='+urla+'&'};
if (t=='oy'){url='/includes/v.asp?e='+urla+'&'};
if (t=='baslikoy'){url='/includes/v.asp?baslik=1&e='+urla+'&'};
if (t=='fav'){url='/includes/f.asp?e='+urla+'&'};
if (t=='faventry'){url='/includes/fe.asp?e='+urla+'&'};
if (t=='onlineuser'){url='/includes/o.asp?d='+urla+'&'};
if (t=='dikkatt'){url='/includes/dk.asp?d='+urla+'&'};
if (t=='temalar'){url='/includes/temalar.asp?d='+urla+'&'};
if (t=='chat_cikis'){url='/ac/chata.asp?cikis=1&d='+urla+'&'};
if (t=='detayli'){url='/detayli.asp?d='+urla+'&'};
if (t=='stats'){url='/stats.asp?d='+urla+'&'};


if (t=='dikkat'){url='/includes/dk2.asp?d='+urla+'&'};
if (t=='iletisim'){url='/includes/iletisim.asp?d='+urla+'&'};
if (t=='arkadasol'){url='/includes/t.asp?d='+urla+'&'};
if (t=='tayfa'){url='/includes/tayfa.asp?d='+urla+'&'};
if (t=='stat'){url='/includes/stat.asp?d='+urla+'&'};
if (t=='giris'){url='/giris.html?d='+urla+'&'};
if (t=='inbox'){url='/includes/in.asp?d='+urla+'&'};
if (t=='inboxx'){url='/includes/mb.asp?d='+urla+'&'};
if (t=='getmessageMessagesInbox'){url='/includes/mo.asp?m='+urla+'&'};
if (t=='getmessageMessagesOutbox'){url='/includes/mo2.asp?m='+urla+'&'};
if (t=='getmessageTrash'){url='/includes/mo3.asp?m='+urla+'&'};
if (t=='sauser'){url='/includes/sa.asp?e='+urla+'&'};
if (t=='aktivasyon'){url='/includes/act.asp?e='+urla+'&'};
if (t=='mesajgonder'){url='/includes/m.asp?e='+urla+'&'};
if (t=='uyeol'){url='/check/?u='+urla+'&'};
if (t=='profil'){url='/includes/p.asp?u='+urla+'&'};
if (t=='staff'){url='/includes/staff.asp?u='+urla+'&'};
if (t=='news2'){url='/includes/a2.asp?u='+urla+'&'};
if (t=='news'){url='/includes/a3.asp?u='+urla+'&'};
if (t=='ajaxlogin'){url='/includes/giris_ajax.asp?ajaxlogin=1&username='+urla+'&';}
if (t=='Captcha'){url='/CaptchaR.html?';}

if (yuklegoster!=0){

	if (mesajne=='@'){
	}
	else if (mesajne!=null){
	document.getElementById(divid).innerHTML=mesajne;
	}
	else{
//	document.getElementById(divid).innerHTML="<center><table width=95% cellspacing=0 cellpadding=10><tr><td valign=middle width=26><img src=/images/progress.gif><td><font  style=font-size:11px;font-family:Tahoma>yükleniyor...</font></table></center>";
	document.getElementById(divid).innerHTML="<img src=/images/pl.gif style=margin-bottom:5px>";
	}
}

var page_request = false;if (window.XMLHttpRequest){page_request = new XMLHttpRequest()}else if (window.ActiveXObject){try {page_request = new ActiveXObject("Msxml2.XMLHTTP")} catch (e){try{page_request = new ActiveXObject("Microsoft.XMLHTTP")}catch (e){}}}else{return false};page_request.onreadystatechange=function(){loadpage(page_request, divid,t,mesajne);};
url=url+'r='+(Math.floor(Math.random()*55)*48811)+kk(20,'abcdefghijklmnopqrstuvwxyz')
page_request.open('GET', url, true);
page_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=utf-8'); 
page_request.setRequestHeader('Content-Language','tr'); 
page_request.send(null)}

		function loadpage(page_request, divid,t,mesaj){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){document.getElementById(divid).style.display='none';document.getElementById(divid).innerHTML=page_request.responseText;if(t=='baslikgetir' || t=='onlineuser' || t=='baslikgetir'){if(t!='onlineuser' && mesaj!='@'){Effect.BlindDown(divid)}else{document.getElementById(divid).style.display='block'}}else{Effect.BlindDown(divid)}}}	
		function AjaxC(){Ajax(document.thisform.sor.value, 'suggest','baslikoner');document.thisform.ajaxb.value='';}
		//function enablebutton(button,button2,target,a,wt,wt3){var string=target.value;if(wt=='ss' && string.length>a){document.thisform.ajaxb.value='p';setTimeout("AjaxC()", 2000)}}
		function enablebutton(button,button2,target,a,wt,wt3){var string=target.value;if(string.length>a){button.disabled=false}else{button.disabled=true};if(wt=='ss' && string.length>a){document.thisform.ajaxb.value='p';setTimeout("AjaxC()", 2000)}}

		function AjaxCA(){Ajax(document.thisform.sor.value, 'suggest','baslikonerA');document.thisform.ajaxb.value='';}
		function enablebuttonA(button,button2,target,a,wt,wt3){var string=target.value;if(wt=='ss' && string.length>a){document.thisform.ajaxb.value='p';setTimeout("AjaxCA()", 2000)}}
		function textCounter(field,max,span){if(field.value.length>max){field.value=field.value.substring(0, max);};document.getElementById(span).innerHTML=max-field.value.length;}

function katarka(al,v,i){
document.getElementById(v).innerHTML="<div style='border-bottom:1px solid #a5de1e;padding:3px;background-color:#f9f9f9'><b><center>"+al+"</center></b></div>"
if (i==1){document.getElementById('d3').innerHTML=""}
}

function randomNum(low, high) {     return Math.random()*(high-low) + low; }  
function randomInt(low, high) {     return Math.floor(Math.random()*(high-low+1)) + low; }  
function randomChar(str) {      return str.charAt(randomInt(0, str.length-1)); }  
function randomOneOf(list) {        return list[randomInt(0, list.length-1)]; } 
function kk(a,b) {      var i, seq = "";      for (i = 1; i <= a; i = i + 1) {          seq += randomChar(b);      }      return seq;}


function AjaxLogin(alform){
Ajax(alform.username.value+'&password='+alform.password.value, 'ajaxlogindiv','ajaxlogin');

}
function ShowDiv(al){

alw=document.getElementById(al).style.display;

if (alw=='none')
		effect_1 = Effect.SlideDown(al,{duration:1.0});
else
		effect_1 = Effect.SlideUp(al,{duration:1.0});

}

function ShowDiv2(al){

new Effect.Highlight(al,{duration:1})
}



function writeCookie(name, value, days) {
    //Fix Days
    if(days==null || days=="")days=365;
    
    // Set Date
    var d=new Date(); 
    d.setTime(d.getTime()+(days*24*60*60*1000));  
    var expires="; expires="+d.toGMTString();  
    
    // Write Cookie
    document.cookie = name+"="+value+expires+"; path=/"; 
}

function readCookie(name){ // by .fm
    var c=document.cookie ; 
    if (c.indexOf(name)!=-1) { 
        pos1=c.indexOf("=", c.indexOf(name))+1; 
        pos2=c.indexOf(";",pos1);  
            // If last cookie
            if(pos2==-1)    pos2=c.length;;
        
        data=c.substring(pos1,pos2); 
        
        return data;
    }
}


function changecss(theclass,element,wh) {
var cssRules;
if (document.all) {
cssRules = 'rules';
}
else if (document.getElementById) {
cssRules = 'cssRules';
}
for (var S = 0; S < document.styleSheets.length; S++){
for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {


if (document.styleSheets[S][cssRules][R].selectorText == theclass) {
var oncekipx=(document.styleSheets[S][cssRules][R].style[element].replace(/px/,""));
if (wh=='buyuk' && parseInt(oncekipx)<20){document.styleSheets[S][cssRules][R].style[element] = parseInt(oncekipx)+1+'px';writeCookie('fontBoyut2',parseInt(oncekipx)+1+'px',365)}
if (wh=='kucuk' && parseInt(oncekipx)>11){document.styleSheets[S][cssRules][R].style[element] = parseInt(oncekipx)-1+'px';writeCookie('fontBoyut2',parseInt(oncekipx)-1+'px',365)}
if (wh=='cookie' && parseInt(oncekipx)>11 && parseInt(oncekipx)<20){document.styleSheets[S][cssRules][R].style[element] = readCookie('fontBoyut2')}

}}}}

function getposOffset(overlay, offsettype,alx,userid){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
var lastid='f';
function overlay(curobj, subobjstr, opt_position,alx,userid){


var subobj=document.getElementById(subobjstr)
 

subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : alx) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : -17)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"

if (lastid!=userid){	Ajax(userid, 'user_info','user_info');};

lastid=userid;
}


function overlayclose(){
Effect.Fade('user_info');
lastid=0;

}

var eniyiok=0;
function BestAnswer(al,al2){
if (eniyiok==0 && confirm('Bu cevabı en iyi cevap seçmek istiyor musunuz?')){
document.getElementById('eniyicevap2').innerHTML=document.getElementById('cevapA'+al).innerHTML
//document.getElementById('b-'+al).style.display='none';
document.getElementById('d-'+al).style.display='none';
ShowDiv('cevapA'+al);
ShowDiv('eniyicevap');
eniyiok=1;
window.open('/includes/eniyicevap.asp?u='+[al],'ifr', '');
for (i = 1; i <= al2; i++)
Effect.Fade('b-'+i);


}else{
var subobja=document.getElementById('eniyicevap')
 window.scrollTo(0,subobja.offsetTop+190)
}
}


function wel(){
ShowDiv('wel_div');setTimeout("ShowDiv('wel_div')",5000)
}


function btnbkz(F, B) {
    var box = $(F);
    if (document.selection) {
        var textrange = document.selection.createRange();
        if (textrange.parentElement() == box) {
            var boxtop = box.scrollTop;
            textrange.text = "{" + B + ":" + textrange.text + "}";
            textrange.select();
            box.scrollTop = boxtop;
        } else {
            box.value = box.value + "{" + B + ":}";
        }
    } else if (box.textLength) {
        var boxvalue = box.value;
        var boxrange = box.selectionStart == box.selectionEnd ? box.selectionEnd + B.length + 2 : box.selectionEnd + B.length + 3;
        var boxtop = box.scrollTop;
        box.value = boxvalue.substring(0, box.selectionStart) + "{" + B + ":" + boxvalue.substring(box.selectionStart, box.selectionEnd) + "}" + boxvalue.substring(box.selectionEnd, box.textLength);
        box.setSelectionRange(boxrange, boxrange);
        box.scrollTop = boxtop;
    } else {
        box.value += "{" + B + ":}";
    }
    box.focus();
}

function hideFocusBorders(){
var theahrefs = document.getElementsByTagName("a");
if (!theahrefs){return;}
for(var x=0;x!=theahrefs.length;x++){
theahrefs[x].onfocus = function stopLinkFocus(){this.hideFocus=true;};
}
}

function getir(e) {
    if (e.keyCode == 13) {
        Ajax(document.getElementById('solframeinput').value, 'entryfalan','baslikgetir');
    }
}

var onlinejsdivacik=0;
function onlineJS(e) {

	Ajax(onlinejsdivacik, "onlinesausers","onlineuser",0)
	Ajax(0, "dikkatt","dikkatt",0)
}


function Inbox(e) {
	Ajax('', "inboxt","inbox",0)
}
function oy(e,d) {
	if (d=='p'){
		document.getElementById('oyp'+e).src='/images/op2.gif';
		document.getElementById('oyn'+e).src='/images/on.gif';
	}else{
		document.getElementById('oyp'+e).src='/images/op.gif';
		document.getElementById('oyn'+e).src='/images/on2.gif';
	}
}

function baslikoy(e,d) {
	if (d=='p'){
		document.getElementById('baslikoyp'+e).src='/images/op2.gif';
		document.getElementById('baslikoyn'+e).src='/images/on.gif';
	}else{
		document.getElementById('baslikoyp'+e).src='/images/op.gif';
		document.getElementById('baslikoyn'+e).src='/images/on2.gif';
	}
}

function fav(e,d) {

if (d==1){document.getElementById('fav'+e).src='/images/st2.gif';}
else{
if (document.getElementById('fav'+e).src.indexOf('/images/st2.gif')==-1){
document.getElementById('fav'+e).src='/images/st2.gif';
}else{document.getElementById('fav'+e).src='/images/st.gif';}
}
}


function tay(e,d) {


if (document.getElementById('tay'+e).src.indexOf('/images/tra.gif')==-1){
document.getElementById('tay'+e).src='/images/tra.gif';
}else{document.getElementById('tay'+e).src='/images/ekl.gif';}

}



function onlineJS2(e) {

	if(document.getElementById('iconline').style.display=='none' && e!='a')
	{
	document.getElementById('online0').style.width='190px';
	document.getElementById('online00').style.left='607px';
//	document.getElementById('onborder').style.border='1px solid #f9638d';
	setTimeout('onlinejsdivacik=0;document.getElementById(\'online00\').style.left=\'722px\';document.getElementById(\'online0\').style.width=\'75px\';document.getElementById(\'iconline\').style.display=\'none\'',60000);
	onlinejsdivacik=1;
	document.getElementById('iconline').style.display='block'
	}
	else{
	document.getElementById('online00').style.left='722px';
	document.getElementById('online0').style.width='75px';
//	document.getElementById('onborder').style.border='1px solid #f21e5a';
	onlinejsdivacik=0;
	document.getElementById('iconline').style.display='none'
	}
}


var duyuruacik=0;
var icerikduyuru=''
function duyuruac() {
    if (duyuruacik == 0) {
		icerikduyuru=document.getElementById('duyuru1').innerHTML;
		document.getElementById('duyuru1').innerHTML='';
        Ajax('', 'duyuruliste','baslikara');
        setTimeout('Effect.Appear(\'duyuru\')',200)
		setTimeout('Effect.Fade(\'duyuru1\')',200)

		duyuruacik=1;
    }else {
        Effect.BlindUp('duyuru');
		document.getElementById('duyuru1').innerHTML=icerikduyuru;Effect.Appear('duyuru1')
		duyuruacik=0;
    }
}
function KukiAt(name,value,hours)
{
var expire = "";
expire = new Date((new Date()).getTime() + 24*350 * 3600000);
expire = "; expires=" + expire.toGMTString();
document.cookie = name + "=" + escape(value) + expire;
return true;
}

var chat_cikis=0;
function sausohbet(){

if (document.getElementById('ssoh').style.display=='none'){
chat_cikis=0;
document.getElementById('ssoh').style.display="block";
new Effect.Highlight('ssoh',{duration:1});
KukiAt('ssoh','goster',1); 
waittime=1100;		
var ssintUpdate = setTimeout("ajax_read('/ac/chata.asp')", waittime);
}else{
chat_cikis=1;
waittime=800000;		
document.getElementById('ssoh').style.display="none"
KukiAt('ssoh','gosterme',1); 
clearTimeout(ssintUpdate);
Ajax(0,"ajaxic", "chat_cikis",0)
}}

function genel(){
if (document.getElementById('ssoh').style.display=='block'){
waittime=1100;		
var ssintUpdate = setTimeout("ajax_read('/ac/chata.asp')", waittime);

}}

function mgonder(sauser) {
//	document.getElementsByTagName('html')[0].style.overflow='hidden';
	document.getElementById('mesajgonder').style.display='block';
	new Effect.Opacity('mesajgonder', { from: 0, to: 0.6, duration: 0.5 });
	setTimeout('Effect.Appear(\'mesajgonder2\')',700)
	Ajax(sauser, "mesajic","mesajgonder",0)
}

function mkapat() {
    Effect.Fade('mesajgonder2');
    Effect.Fade('mesajgonder');
	//document.getElementsByTagName('html')[0].style.overflow='auto';
}

