// sıradaki bahisler
var MaxOdd = 100000;
var MaxCount = 15;
var StartCount = 0;
var StartOdd = 100/100;
var StartFormaction="insert_all.asp?A=1";
function init() {

}
function CanUseDHTML() {
window.onerror=null;
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);    
if((browserName == "Netscape" && browserVer >= 3) ||
(browserName == "Microsoft Internet Explorer" && browserVer >= 4))
return 1;
else
return 0;
}




function SelectChange() {
if (CanUseDHTML()) {
var CurrentOdd = StartOdd;
var CurrentCount = StartCount;
var Formaction = StartFormaction;
for (var i = 0; i < document.all.tags("SELECT").length; i++)
if (document.all.tags("SELECT")[i].name.substring(0,1) == "S")
{
var index = document.all.tags("SELECT")[i].selectedIndex;

if (index > 8) 
start = 3
else
start = 2;	
if (document.all.tags("SELECT")[i].options[index].value != "*") {
CurrentOdd = (CurrentOdd * document.all.tags("SELECT")[i].options[index].value.substring(start) * 100)/100;
Formaction=Formaction + "&KOD=" +document.all.tags("SELECT")[i].name.substring(1,5);
Formaction=Formaction + "&SID=" +document.all.tags("SELECT")[i].options[index].value.substring(0,1);
CurrentCount++
}  
}

if (CurrentOdd > 1)
if (CurrentCount > MaxCount) {
alert("En fazla " + MaxCount + " maç ekleyebilirsiniz.")
event.srcElement.selectedIndex = event.srcElement.options.length - 1;
}
else 
if (CurrentOdd > MaxOdd) {
alert("Toplam oran " + MaxOdd + " den küçük olmalıdır.")
event.srcElement.selectedIndex = event.srcElement.options.length - 1;
}
else
{ document.all.toran.value = "Toplam Oran " + formatnum(parseInt(CurrentOdd * 100)/100);
document.all.form1.action=Formaction;}
else  
{ document.all.toran.value = "";
document.all.form1.action= "";}
}    
}


function formatnum(n) 
{
var s = "" + Math.round(n * 100) / 100
var i = s.indexOf('.')
if (i < 0) return s + ".00"
var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3)
if (i + 2 == s.length) t += "0"
return t.replace(".",",");
}

// sıradaki bahisler


function Only_Numeric(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	if (whichCode == 13) return true;  // Enter
	//if (whichCode == 46) return true;  // Comma
	if (whichCode > 57 ){
	return false;}
	if (whichCode < 48 && whichCode > 13){
	return false;}
}
function checkmail() {
 if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form1.email.value))) {
    alert("Lütfen email adresinizi doğru bir şekilde giriniz!");
    return false; 
  }else{ 
    return true;
  } 
}

// sifre degistir
function checkSubmit2() {
  if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form1.email.value))) {
    alert("Lütfen email adresinizi doğru bir şekilde giriniz!");
    return false; 
  }else if (document.form1.dogum_gun.value=="" || document.form1.dogum_ay.value=="" || document.form1.dogum_yil.value==""){
    alert("Lütfen Doğum Tarihinizi Giriniz!");
    return false;
  }else if (document.form1.sifre.value==""){
    alert("Lütfen Şifrenizi Giriniz!");
    return false;
  }else if (document.form1.sifre.value.length <= 7){
    alert("Şifreniz en az 8 karakter olmalıdır!");
    return false;
  }else if (!sifre_degersayi_kontrol(document.form1.sifre,1,1)){
	alert("Şifreniz en az 1 Harf ve en az 1 Rakam İçermelidir.");
    return false;
  }else if (document.form1.sifre2.value==""){
    alert("Lütfen Şifrenizi Tekrar Giriniz!");
    return false;
  }else if (document.form1.sifre.value!=document.form1.sifre2.value){
    alert("Girdiğiniz şifreler birbirinden farklı. Lütfen tekrar giriniz!");
    return false;
  }else{ 
    return true;
  } 
}
// sifre degistir

function checkSubmit1() {
  if (document.form1.dogum_gun.value=="" || document.form1.dogum_ay.value=="" || document.form1.dogum_yil.value==""){
    alert("Lütfen Doğum Tarihinizi Giriniz!");
    return false;
  }else if (document.form1.tcno.value==""){
    alert("Lütfen T.C. Kimlik Numaranızı Giriniz!");
    return false;
  }else if (document.form1.adi.value==""){
    alert("Lütfen Adınızı Giriniz!");
    return false;
  }else if (document.form1.soyadi.value==""){
    alert("Lütfen Soyadınızı Giriniz!!");
    return false;
  }else{ 
    return true;
  } 
}


function checkSubmit() {
  if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form1.email.value))) {
    alert("Lütfen email adresinizi doğru bir şekilde giriniz!");
    return false; 
  }else{ 
    return true;
  } 
}

function only_latin(e) {	
	//alert(window.event.srcElement.value);
	var whichCode = (window.Event) ? e.which : e.keyCode;
	
	if (whichCode == 13) return true;  // Enter
	if (whichCode == 45) return true;  // tire
	if (whichCode == 95) return true;  // alt cizgi
	if (whichCode >= 48 && whichCode <= 57){  //rakamlar
		return true;}
	if ((whichCode >=97 && whichCode <=122) || (whichCode <=90 && whichCode >=65)){  //latin harfler
		return true;}
	
	return false;
}

function sifre_degersayi_kontrol(Obj, adet1, adet2)
	{
		var data = Obj.value;	
		var ls_numStr1="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
		var ls_numStr2="0123456789";
		var lc_temp;
		var li_adet1 = 0, li_adet2 = 0;
		var li_counter = 0;
		for(var i = 0; i < data.length; i++) {
			lc_temp = data.substring(i, i+1);
			if (!(ls_numStr1.indexOf(lc_temp) == -1)){
				li_counter++;
				li_adet1++;
			}
			if (!(ls_numStr2.indexOf(lc_temp) == -1)) {
				li_counter++;
				li_adet2++;
			}
		}		
		if ((li_counter == data.length)&&
				(li_adet1 >= adet1)&&(li_adet2 >= adet2))
			return true;
		else {			
			return false;
		}
	} 
	
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Kupon 

function reSize()
   {
   try{
   var oBody = ifrm.document.body;
   var oFrame = document.all("ifrm");

   oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
 //oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
   }
   //An error is raised if the IFrame domain != its container's domain
   catch(e)
   {
   window.status = '';
   }
   }

// kupon

function MakeArrayday(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = "";
}
return this;
}
function MakeArraymonth(size) {
this.length = size;
for(var i = 1; i <= size; i++) {
this[i] = "";
}
return this;
}


function work(h,m,s) {

if (!document.layers && !document.all)
return;
var runTime = new Date();
var hours = h;
var minutes = m;
var seconds = s;
var dn = "AM";
var shours = h;
var sminutes = m;
var sseconds = s;
if (shours >= 12) {
dn = "PM";

}
if (shours == 0) {
shours = "0";
}
if (sminutes <= 9) {

sminutes = "0" + sminutes;
}
if (sseconds <= 9) {

sseconds = "0" + sseconds;
}
if (shours <= 9) {
shours = "0" + shours;
}
movingtime = ""+ shours + ":" + sminutes +":"+sseconds+"";
if (document.layers) {
document.layers.clock.document.write(movingtime);
document.layers.clock.document.close();
}
else if (document.all) {
clock.innerHTML = movingtime;
}
if (seconds <=58) {
seconds=seconds+1;
}else {
seconds=0;
minutes=minutes+1;
}

if (minutes <=59) {

}else {

hours=hours+1;
}

if (hours <=23) {
if (minutes ==60) {

minutes=0;
}
}else if (hours ==24) {
hours=0;
minutes=0;
}

setTimeout("work("+hours+","+minutes+","+seconds+")",1000);
}
	function check() {
        var curl = location ;
	      var iY = window.event.clientY ;
			var pos=curl.toString().indexOf("Nesine");
			 
			 
	      if (pos!=11 || iY < 0 ) 
	      {           
					     window.top.location="\logout.asp?Kapat=1";
	
		  }
	
	}

// Ticker startup 
function startTicker() {  
// Define run time values  
theCurrentStory     = -1;  
theCurrentLength    = 0;  
// Locate base objects  
if (document.getElementById) {        
theAnchorObject     = document.getElementById("tickerAnchor");    
runTheTicker();        
}  else {
             document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}<\/style>");
             return true;  
} 
} 
// Ticker main run loop 
function runTheTicker() {  
var myTimeout;    
// Go for the next story data block  
if(theCurrentLength == 0)  {   
theCurrentStory++;   
theCurrentStory      = theCurrentStory % theItemCount;   
theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');     
theTargetLink        = theSiteLinks[theCurrentStory];   
theAnchorObject.href = theTargetLink;   
thePrefix       = "";  
}  
// Stuff the current ticker text into the anchor  
theAnchorObject.innerHTML = thePrefix +   theStorySummary.substring(0,theCurrentLength) + whatWidget();  
// Modify the length for the substring and define the timer  
if(theCurrentLength != theStorySummary.length)  {   
theCurrentLength++;   myTimeout = theCharacterTimeout;  
}  else  {   
theCurrentLength = 0;   
myTimeout = theStoryTimeout;  } 
 // Call up the next cycle of the ticker  
setTimeout("runTheTicker()", myTimeout); } 
// Widget generator 
function whatWidget() {  
if(theCurrentLength == theStorySummary.length)  {   
return theWidgetNone;  
}   
if((theCurrentLength % 2) == 1)  {   return theWidgetOne;  }  else  {   return theWidgetTwo;  } } 

var theCharacterTimeout = 50;  
var theStoryTimeout     = 5000;  
var theWidgetOne        = "_";  
var theWidgetTwo        = "-";  

var theWidgetNone       = "";  
var theLeadString       = "";   
var theSummaries = new Array();  
var theSiteLinks = new Array();

var browserType = navigator.appName;
								var browserVersion = navigator.appVersion;
								var obj = new Object();
								var key = new Object();
							
								function KeyEventIE(obj){
									if(browserType == 'Netscape'){
										return false;
									}
									
									var ch;
									key = window.event.keyCode;
									ch = String.fromCharCode(key);
									
									
								
								if ((obj.name == "kullanici") || (obj.name == "login_sifre"))
								{
									if (!isAlphaNumeric(ch)) 
									{
										event.returnValue = 0;
									}
								 } else return true;
							}	
							
							function isAlphaNumeric(ch) 
							{
							if (!(ch >= 'A' && ch <= 'Z') && !(ch >= '0' && ch <= '9') && !(ch >='a' && ch <='z') && ch != " "  && key != 8) 
								{
									return false;
								}
								return true;
							}