function silinp(gelen,xx) {
if (gelen.value == xx) { gelen.value=''; }
}

function yazinp(gelen,xx) {
if (gelen.value == "") { gelen.value=xx; }
}



function ortalaara() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
boyum = myWidth
durum = ((boyum - 1000) / 2)
sondurum = (myWidth - durum) - 350
document.getElementById('suggestions').style.left = sondurum;
}


function kategori(){
document.getElementById('layer1').style.display = '';
document.getElementById('layer2').style.display = 'none';
}

function marka(){
document.getElementById('layer1').style.display = 'none';
document.getElementById('layer2').style.display = '';
}

function ortalalogin() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
boyum = myWidth
durum = (boyum / 2)
sondurum = (durum) - 210
document.getElementById('loginid').style.top = 300;
document.getElementById('loginid').style.left = sondurum;
}

function loginajax(sid,nereye) {
if (sid != ""){
PrdID=sid;
randomnumber=Math.floor(Math.random()*10000);
ajax_request('loginpen.asp?sid='+randomnumber+'&AAID='+sid,nereye);
ortalalogin()
}
}

function taksitajx(sid,nereye,kam) {
if (sid != ""){
PrdID=sid;
randomnumber=Math.floor(Math.random()*10000);
// alert(sid);
ajax_request('taksitsec.asp?sid='+randomnumber+'&AAID='+sid+'&km='+kam,nereye);
}
}

function sttopla(gelen1,gelen2,gelen3) {
// alert(gelen1 +" "+ gelen2 +" "+ gelen3);
if (gelen1 != "0" && gelen3 != "0"){
stdajx(gelen1,gelen2,gelen3)
//alert('Sepetinize eklendi!');
location.href('studyo.asp');
}
}

function stdajx(g1,sid,g3) {
nereye ='kayan_alan';
if (sid != ""){
PrdID=sid;
randomnumber=Math.floor(Math.random()*10000);
// test = 'std.asp?GID='+g1+'&adet='+g3+'&sid='+randomnumber+'&UID='+sid;
// document.getElementById(nereye).innerHTML = test;
ajax_request('std.asp?GID='+g1+'&adet='+g3+'&sid='+randomnumber+'&UID='+sid,nereye);
}
}

function ajax_request(url,nereye) {
if (window.XMLHttpRequest) { AjaxReq = new XMLHttpRequest(); }
else if (window.ActiveXObject) { AjaxReq = new ActiveXObject("Microsoft.XMLHTTP"); }
if (AjaxReq != undefined) {
AjaxReq.onreadystatechange = function() {ajax_request_done(url,nereye);};
AjaxReq.open("GET", url, true);
AjaxReq.send("");
}
}

function ajax_request_done(url,nereye) {
if (AjaxReq.readyState == 4) {
if (AjaxReq.status == 200) {
document.getElementById(nereye).innerHTML=AjaxReq.responseText;
}
else { document.getElementById(nereye).innerHTML="Hata"; }
}
else {
document.getElementById(nereye).innerHTML="Load";
if(PrdID) {
}
}
}


