var effect_1 = null;

		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){

if (t=='uyeol'){url='/check/?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='sorukategori'){url='/kategori/?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='kat'){url='/kategori/kat.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='katarama'){url='/kategori/kat_arama2.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='kategoriliste'){url='/includes/kategori_listele.asp?ux='+urla+'&r='+(Math.floor(Math.random()*55)*4888)}
if (t=='kategorilisteA'){url='/includes/kategori_listele_anket.asp?ux='+urla+'&r='+(Math.floor(Math.random()*55)*4888)}
if (t=='cevapsil'){url='/includes/cevapsil.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)}
if (t=='anketsorusil'){url='/includes/anketsorusil.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)}
if (t=='anketsil'){url='/includes/anketsil.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)}
if (t=='yorumsil'){url='/includes/yorumsil.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)}
if (t=='yorumanketsil'){url='/includes/yorumsil.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)}
if (t=='ajaxlogin'){url='/includes/giris_ajax.asp?ajaxlogin=1&username='+urla+'&r='+(Math.floor(Math.random()*55)*4888);}
if (t=='Captcha'){url='/CaptchaR.html?r='+(Math.floor(Math.random()*55)*4888);}

if (t=='baslikoner'){url='/suggest/default.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='baslikonerA'){url='/suggest/defaulta.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='user_info'){url='/includes/u.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*48811)};
if (t=='uyesonuc'){url='/includes/ua.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*48811)};
if (t=='uyesonucf'){url='/includes/uaf.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='befan'){url='/includes/be.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};
if (t=='youtube_add'){url='/includes/youtube_add.asp?u='+urla+'&r='+(Math.floor(Math.random()*55)*4888)};

//document.getElementById(divid).innerHTML="<center><table width=95% height=85% cellspacing=0 cellpadding=0><tr><td align=center valign=middle><img src=/images/progress.gif> <font class=ltf>yükleniyor...</font></table></center>";
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);};

page_request.open('GET', url, true);
page_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-9'); 
page_request.setRequestHeader('Content-Language','tr'); 
page_request.send(null)}

		function loadpage(page_request, divid){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;Effect.Appear(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 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 writeCookie(name, value, days) {
    if(days==null || days=="")days=365;
    
    var d=new Date(); 
    d.setTime(d.getTime()+(days*24*60*60*1000));  
    var expires="; expires="+d.toGMTString();  
    
    document.cookie = name+"="+value+expires+"; path=/"; 
}

function readCookie(name){ 
    var c=document.cookie ; 
    if (c.indexOf(name)!=-1) { 
        pos1=c.indexOf("=", c.indexOf(name))+1; 
        pos2=c.indexOf(";",pos1);  
            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)
}