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 OG(){
	if (document.getElementById('ogretimg').style.display=='none'){
		Effect.Appear('ogretimg');
		Effect.BlindDown('ogretimg');
	}else{
		Effect.Fade('ogretimg');
		Effect.BlindUp('ogretimg');
	}
}

function StartUp(){
//new Effect.Move('ust', { x: 0, y: 150,mode:'relative' });
Effect.Appear('ust');
Effect.BlindDown('ust');
setTimeout("Effect.BlindDown('ust3')",50);


setTimeout("Effect.Appear('logo')",900);
setTimeout("Effect.Appear('gir')",750);

setTimeout("new Effect.Move('yazi', { x: -200, y: 0,mode:'relative' })",175);
setTimeout("Effect.Appear('yazi')",175);
setTimeout("Effect.Appear('ust2')",1000);
setTimeout("Effect.Appear('ic')",750);

}

function LoginFalse(){
	document.getElementById('ajax_failed').innerHTML='e-posta adresiniz veya şifreniz hatalı';
	document.getElementById('ajax_failed').style.display='block';
	document.getElementById('ajax_submit').value="Giriş Yap";
	document.getElementById('ajax_submit').disabled=false;
}

function LoginTrue(a){
	ajax_tab('modul_ajax_uye_girisi','/includes/uyelik.asp');
	setTimeout("ajax_tab('slsp','/includes/sepet.asp')",300);

if (a==1){
	sifrb("şapkakolik.com'a hoşgeldiniz");
	setTimeout("ajax_tab('ictaraf','/ana')",700);
}

}

function LogOut(){
if (confirm("Siteden çıkış yapmak istediğinize emin misiniz?")){

	ajax_tab('ictaraf','/logout?r='+(Math.floor(Math.random()*55)*48811)+kk(20,'abcdefghijklmnopqrstuvwxyz'));
	setTimeout("ajax_tab('modul_ajax_uye_girisi','/includes/uyelik.asp?r='+(Math.floor(Math.random()*55)*48811)+kk(20,'abcdefghijklmnopqrstuvwxyz'))",600);
	setTimeout("ajax_tab('slsp','/includes/sepet.asp?r='+(Math.floor(Math.random()*55)*48811)+kk(20,'abcdefghijklmnopqrstuvwxyz'))",305);
	sifrb("şapkakolik.com'a hoşgeldiniz");
}}


function Login(){

	var a='login';

	a_username=document.getElementById('ajax_username');
	a_password=document.getElementById('ajax_password');

	if ((a_username.value.indexOf(".") > 2) && (a_username.value.indexOf("@") > 0)){}
	else{
		alert('E-posta adresiniz hatalı.');
		a_username.focus();
		return false;
	}

	if (a_password.value.length<5)
	{
		alert('Şifrenizi eksik girdiniz');
		a_password.focus();
		return false;
	}

	document.getElementById('ajax_submit').value="Bekleyiniz...";
	document.getElementById('ajax_submit').disabled=true;
	ifrm = document.createElement("iframe");
	ifrm.setAttribute("name", 'iff_g'+a);
	ifrm.setAttribute("id", 'if_g'+a);
	ifrm.setAttribute("src", "/login.asp?r="+(Math.floor(Math.random()*55)*48811)+kk(20,'abcdefghijklmnopqrstuvwxyz')+"&username="+a_username.value+"&password="+a_password.value);

	document.body.appendChild(ifrm);

	return false;
}



function sifrb(b) {
sIFR.getReplacementByFlashElement($('b_btab').childNodes[0]).replaceText(b);
sIFR.getReplacementByFlashElement($('b_btab_2').childNodes[0]).replaceText(b);
}

function ajax_tab(div,url) {	if(window.XMLHttpRequest){		xmlhttp=new XMLHttpRequest();		if(xmlhttp.overrideMimeType){		}	} else if(window.ActiveXObject){		try{			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");		} catch(e) {			try{				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");			} catch(e){			}		}	}	if(!xmlhttp) {		return false;	};xmlhttp.onreadystatechange = function() {	if (xmlhttp.readyState==4) {document.getElementById(div).innerHTML = xmlhttp.responseText;if(xmlhttp.status=='200'){$('loader').hide()};		}	};	xmlhttp.open('GET',url,true);	xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-9');Effect.Appear('loader'); 	xmlhttp.setRequestHeader('Content-Language','tr'); 	xmlhttp.send(null);};
function ajax_write(url){	if(window.XMLHttpRequest){		xmlhttp2=new XMLHttpRequest();		if(xmlhttp2.overrideMimeType){			xmlhttp2.overrideMimeType('text/xml');		}	} else if(window.ActiveXObject){		try{			xmlhttp2=new ActiveXObject("Msxml2.XMLHTTP");		} catch(e) {			try{				xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");			} catch(e){			}		}	}	if(!xmlhttp2) {		return false;	};	xmlhttp2.onreadystatechange = function() {	if (xmlhttp2.readyState==4) {		if(xmlhttp2.responseText=='403'){		document.getElementById("sauchat").innerHTML = document.getElementById("sauchat").innerHTML+"<br><b>üye girişi yapmalısın</b><br>";var objDiv = document.getElementById("sauchat");objDiv.scrollTop = objDiv.scrollHeight;			}		}	};	xmlhttp2.open('GET',url,true);	xmlhttp2.send(null);};

