//////////////////////////////////
//			Global				//
//////////////////////////////////

//--------------- LOCALIZEABLE GLOBALS ---------------
var now = new Date(); var yr = now.getYear(); var mName = now.getMonth() + 1; var dName = now.getDay() + 1;  
var yr_str = " 19";   // yil 2000 iken, 19 sayisinin çikmamasini saglayacak string
var dayNr = ((now.getDate()<10) ? "" : "")+ now.getDate(); if(dName==1) Day = "Pazar"; if(dName==2) Day = "Pazartesi"; if(dName==3) Day = "Salı"; if(dName==4) Day = "Çarşamba"; if(dName==5) Day = "Perşembe"; if(dName==6) Day = "Cuma"; if(dName==7) Day = "Cumartesi"; if(mName==1) Month="Ocak"; if(mName==2) Month="Şubat"; if(mName==3) Month="Mart";
if(mName==4) Month="Nisan"; if(mName==5) Month="Mayıs"; if(mName==6) Month="Haziran"; if(mName==7) Month="Temmuz"; if(mName==8) Month="Ağustos"; if(mName==9) Month="Eylül";
if(mName==10) Month="Ekim"; if(mName==11) Month="Kasım"; if(mName==12) Month="Aralık";
if ( yr > 99 ) 
{
yr_str =" ";
if ( yr < 2000 ) yr += 1900; 
}
 var todaysDate =(" " + dayNr + " " + Month + yr_str + yr + "" + " " + Day + ""); 
//      document.write(todaysDate);
function saatigoster() {
						 var d, saat_,dakika_,saniye_,x1,x2,s;
						 d = new Date();
						 saat_ = d.getHours(); if (saat_.toString(10).length==1) { saat_="0"+saat_; }
						 dakika_= d.getMinutes();if (dakika_.toString(10).length==1) { dakika_="0"+dakika_; }
						 saniye_= d.getSeconds();if (saniye_.toString(10).length==1) { saniye_="0"+saniye_; }
						 s = saat_ + ":" + dakika_ + ":" + saniye_;
						 saat.innerHTML = s; 
 }
//<b><font face="arial" size="3" color="#000000" name="saat" id="saat" > 
//<script language="JavaScript">window.setInterval("saatigoster();",1000);</script></font></b>
//---------------   END LOCALIZEABLE   ---------------

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//<a href="#" onclick="MM_showHideLayers('Layer1','','show','Layer2','','hide','Layer3','','hide','Layer4','','hide')">1</a>

// iki sayfayi tek tikla yuklemek için
function loadtwo(solsayfa, sagsayfa) 
{ parent.Menu.location.href=solsayfa; 
parent.Content.location.href=sagsayfa; }

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

//'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=300'
function launchCenter(url, name, width,height,features) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;

    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
	str += "," + features;
  }
  var NewWindow=null;
  NewWindow = window.open(url, name, str);
    if (NewWindow.open) {
    NewWindow.focus();
  }
 
}

//'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=300'

function NewWinCenter(url, name, features) {
  var str;
  if (window.screen) {
    var ah = screen.availHeight - 50;
    var aw = screen.availWidth - 10;
    var xc = 0;
    var yc = 0;

   str = "height=" + ah + ",innerHeight=" + ah;
   str += ",width=" + aw + ",innerWidth=" + aw;
   str += ",left=" + xc + ",screenX=" + xc;
   str += ",top=" + yc + ",screenY=" + yc;
   str += "," + features;
  }
  var NewWindow=null;
  NewWindow = window.open(url, name, str);
    if (NewWindow.open) {
    NewWindow.focus();
  }
 
}

function MaximizeWin() {
  if (window.screen) {
    var aw = screen.availWidth;
    var ah = screen.availHeight;
    window.moveTo(0, 0);
    window.resizeTo(aw, ah);
  }
}

function Brw() { 
	if (screen.Width < 1024) {
	   alert ("Ekran Çözünürlügünüzü 1024x768 yapmalisiniz...");
	   window.close();
	}
	
	if (navigator.appName == "Netscape") {
		alert ("Microsoft Internet Explorer Kullanirsaniz daha iyi olur");
	} 

}

function changeURL(winName, newURL) {
  win = window.open("", winName);
  win.location.href = newURL;
}

function URLchanger (URLNavigation) {
 if (URLNavigation != "") { 
  top.location.href = URLNavigation;
 }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// oturum takip fonksiyonlari
function closeSession()
{
//capturing ALT + F4
if (event.altKey==true && event.keyCode==0 )
{
//alert("closed1")
window.opener=self; 
window.close();
launchCenter('UYE_terket.asp', '', 300,200); 
//window.open('UYE_terket.asp','',''); 
}
//capturing exit (çarpi ile kapatma ile çikilirsa
Xwidth=window.document.body.offsetWidth-window.event.clientX
YHeight=window.event.clientY
if(Xwidth<=30&&YHeight<0)
{
// alert("closed2")
window.opener=self; 
//document.location.href="SessionEndFile.asp";
window.close();
launchCenter('UYE_terket.asp', '', 300,200); 
//window.open('UYE_terket.asp','',''); 
}

}
var logged = true;
var bekle = 1000 * 60 * 60 * 1 ; // milisaniye * saniye * dakika * saat 
var Saniye=20;
var stopped = false;

function GeriyeSay() {
    if (!stopped) {
        if (Saniye >= 0) {
            document.getElementById("SaniyeGoster").innerHTML = Saniye;
            Saniye = Saniye -1;
            setTimeout(GeriyeSay, 1000);
        } else {
            OturumKapat();
        }
    }
}

function myTimeout() {
    if (logged) {
        var screenW = 778;
        var screenH = 574;
        var uyariLeft = 300;
        var uyariTop = 135;

        var uyari = document.getElementById("ZamanDolduUyarisi");

        //uyari.style.left = uyariLeft;
        //uyari.style.top = uyariTop;
        uyari.style.visibility = "visible";	
        window.setTimeout(GeriyeSay, 1000);
        window.focus();
        stopped = false;
    }
}

function DevamEt() {
    var uyari = document.getElementById("ZamanDolduUyarisi");
    uyari.style.visibility = "hidden";
    stopped = true;
    sec = 20;
    document.getElementById("SaniyeGoster").innerHTML = sec;
    window.setTimeout(myTimeout, bekle);
   }

 function OturumKapat() {
 
	launchCenter('uye_terket.asp','kapat', 400,300)
	// window.location.href='uye_terket.asp';
	window.opener=self; 
	window.close();
	 
 }

function openTab(id) {
	var cont = false;
	{
		document.getElementById("tabData").innerHTML = document.getElementById("tabData" + id).innerHTML;
		cont = true;
	}
	for (var i=1;i<=10;i++) {
		if (document.getElementById('option'+i)) {
			document.getElementById('option'+i).style.backgroundPosition = '0% 0px';
			document.getElementById('option'+i).getElementsByTagName('span')[0].style.backgroundPosition = '100% 0px';
		}
	}
	if (cont) {
		document.getElementById('option'+id).style.backgroundPosition = '0% -42px';
		document.getElementById('option'+id).getElementsByTagName('span')[0].style.backgroundPosition = '100% -42px';
	}
}


function flash(w,h,u,t) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+w+"' height='"+h+"'><param name='movie' value='"+u+"'><param name='quality' value='high'>");
	if(t=="y"){
		document.write("<param name='wmode' value='transparent'>");
	}
	document.write("<embed src='"+u+"' quality='high' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'></embed></object>");	
}

function fc(obj) {
	obj.innerHTML = obj.innerHTML + '<input type="submit" style="display:none" id="sb">';
	document.getElementById('sb').click();
}

var lastSSSID=0;
function sssOpen(ID) {
	if (lastSSSID) {
		document.getElementById('sss_cevap_'+lastSSSID).style.display = 'none'; 
		document.getElementById('sss_image_'+lastSSSID).src='images/buton/sss_close.gif';
	}
	if (lastSSSID != ID) {
		document.getElementById('sss_cevap_'+ID).style.display = 'block';
		document.getElementById('sss_image_'+ID).src = 'images/buton/sss_open.gif';
		lastSSSID=ID;
	}
	else lastSSSID=0;
	
}

function gid(name) {
	return document.getElementById(name);
}
function toggleonoff(ID,onoff) {
	if(onoff != 'on') {
		gid(ID).style.display = 'none';
	} else { 
		gid(ID).style.display = 'block';
	}
}
function toggleDisplay(ID) {
	if(gid(ID).style.display == 'block') {
		gid(ID).style.display = 'none';
	} else { 
		gid(ID).style.display = 'block';
	}
}

function toggleDisplay_img(ID) {
	if(gid(ID).style.display == 'block') {
		gid(ID).style.display = 'none';
		document.getElementById('image_'+ID).src = 'images/buton/sss_close.gif';
	} else { 
		gid(ID).style.display = 'block';
		document.getElementById('image_'+ID).src ='images/buton/sss_open.gif';
	}
}

function showPic( imgName, imgCaption, imgWidth, imgHeight, textColor, bgColor, aciklama ) {
if(imgWidth<=100)imgWidth=100
if(imgHeight<=100)imgHeight=100
winHeight=imgHeight+25;
w = window.open('','Title','toolbar=no,location=no,directories=no,status=no,scrollbars=n o,resizable=no,copyhistory=no,width='+imgWidth+',height='+winHeight+'');
w.document.write( "<html><head><title>"+imgCaption+"</title>" );
w.document.write( "<STYLE TYPE='text/css'>" );
w.document.write( "A {font-family: verdana; font-size: 10px; color: "+textColor+"; text-decoration : none;}" );
w.document.write( "A:Visited {font-family: verdana;font-size: 10px; color: "+textColor+"; }" );
w.document.write( "A:Active { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );
w.document.write( "A:Hover { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );
w.document.write( "IMG {border-color : "+textColor+";}" );
w.document.write( "BODY { font-family: verdana; font-size : 10px; font-weight: normal; color : "+textColor+"; background-color : "+bgColor+"; }" );
w.document.write( "</STYLE>" );
w.document.write( "<script language='JavaScript'>\n");
w.document.write( "IE5=NN4=NN6=false\n");
w.document.write( "if(document.all)IE5=true;\n");
w.document.write( "else if(document.getElementById)NN6=true\n");
w.document.write( "else if(document.layers)NN4=true\n");
w.document.write( "function autoSize() {\n");
w.document.write( " if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31+25+40)\n");
w.document.write( " else if(NN6) self.sizeToContent()\n");
w.document.write( " else top.window.resizeTo(document.images[0].width,document.images[0].height+20)\n");
w.document.write( " self.focus()\n");
w.document.write( "}\n</scr");
w.document.write( "ipt>\n");
w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=" );
w.document.write( "'javascript:autoSize();'>" );
w.document.write( "<table cellpadding=0 cellspacing=0 border=0><tr><td colspan=3><div align='center'><img src='"+imgName+"' border=0 alt='"+imgCaption+"' onclick='window.close();'></div></td></tr>" );
w.document.write( "<tr><td align='center'>&nbsp;&nbsp;<a>&copy;"+aciklama+"</a></td></tr>" );
w.document.write( "</table><br></body></html>" );
w.document.close();
}

/*
Submit Once form validation- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}

function Onayla_Gec(URL,Mesaj)
  {

  var r=confirm(Mesaj)
  if (r==true)
    {
	window.location.href=URL;
    }
  else
    {
    }
  }

function Onayla_Gec_Win(url, name, width,height,features,Mesaj)
  {

  var r=confirm(Mesaj)
  if (r==true)
    {
	launchCenter(url, name, width,height,features);
    }
  else
    {
    }
  }
  
function check(field) {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
}
function uncheck(field) {
for (i = 0; i < field.length; i++) {
field[i].checked = false;}
}

//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="#FFE1E1"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}
//<FORM onKeyUp="highlight(event)" onClick="highlight(event)"> </FORM>
//End of Highlight form element- © Dynamic Drive (www.dynamicdrive.com)