

function pencere(url,width,height,scrollb) {
    //scrollbar yes veya no şeklinde gönderilecek.
    var rastgele= Math.floor(Math.random()*11);
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",toolbar=0,resizable=0,location=0,scrollbars=" + scrollb + ",directories=0,status=0,menubar=0,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    window.open(url, "subWind"+rastgele, windowFeatures);
}









function LoadCoupon() {
    document.getElementById("couponfrm").src = "iddaa/kupon.html"
}



function disableCoupon(id) {



}



function enableCoupon() {



}

function AddCoupon(code, integrationcode, iddaa_kodu, bettypeid, tdcode, livescore, which) {

    if (document.getElementById(tdcode) != undefined) {
        

        if (document.getElementById(tdcode).className.indexOf("Selected") > -1) {

            DeleteCoupon(code, iddaa_kodu, integrationcode, tdcode, which);

            return;

        }

    }



    $.ajax({
        url: "iddaa/kupon_fonksiyon.html?islem=ekle",

        data: "code=" + code + "&gametypeid=" + integrationcode + "&tdkod=" + tdcode,
        
        contentType: "application/json; charset=utf-8",

        dataType: "json",        
        
        type: "GET",

        success: function(msg) {
            

            retval = msg.d;

           document.getElementById("couponfrm").src = "iddaa/kupon.html?ViewType=CouponSystem";




            if (retval.Status == 0) {
                document.getElementById(tdcode).className = "bulten_oranSelected";
            }





            else {

                if (retval.Status == 5) {
                    location.reload();
                    return;
                
                alert(retval.ErrorMessage);                
                }


            else if (retval.Status == 6) {

jAlert('Bu maç zaten kuponunuza eklidir. Eğer bu maçın farklı seçeneklerine bahis yapmak istiyorsanız ilk önce kuponunuzdan çıkarmalısınız..', 'Uyarı');
                return;
            }



            else if (retval.Status == 7) {

jAlert('Kuponunuza en fazla 15 bahis ekleyebilirsiniz.', 'Uyarı');
                return;
            }




            }

        },

        error: function(xmlHttpRequest, status, err) {
jAlert('Oran Kupona Eklenemedi.', 'Uyarı');

        }

    });

}





function GetCoupon() {

    document.getElementById("couponfrm").src = "iddaa/kupon.html?ViewType=CouponSystem";

}



function DeleteCoupon(code, gametypeid, integrationcode, tdcode, which) {

    $.ajax({

        type: "GET",

        url: "iddaa/kupon_fonksiyon.html?islem=sil",

        data: "code=" + code + "&gametypeid=" + gametypeid + "&tdcode=" + tdcode,

        contentType: "application/json; charset=utf-8",

        dataType: "json",

        success: function(msg) {

            retval = msg.d;

            if (retval.Status == 5) {
                location.reload();
                return;
            }
            document.getElementById("couponfrm").src = "iddaa/kupon.html?ViewType=CouponSystem";

            if (tdcode != undefined) {

                if (which != undefined) {

                    tdcode_ = tdcode.replace("_" + which, "");
                }

                else if (document.getElementById(tdcode) != null) {

                    document.getElementById(tdcode).className = document.getElementById(tdcode).className.replace("Selected","");

                }

            }

        },
        error: function(xmlHttpRequest, status, err) {
jAlert('Oran Silinemedi.', 'Uyarı');

        }

    });

}



function DeleteAllCoupon() {

    $.ajax({

        type: "GET",

        url: "iddaa/kupon_fonksiyon.html?islem=hepsini_sil",

        data: "",

        contentType: "application/json; charset=utf-8",

        dataType: "json",

        success: function(msg) {

            retval = msg.d;

            if (retval.Status == 5) {

                location.reload();

                return;

            }

            document.getElementById("couponfrm").src = "iddaa/kupon.html?ViewType=CouponSystem";

            var obj = $(".bulten_oranSelected");

            obj.removeClass("bulten_oranSelected");

            obj.addClass("bulten_oran");

        },

        error: function(xmlHttpRequest, status, err) {

            jAlert('Oranlar Silinemedi.','Uyarı');

        }

    });

}




function DeleteAllCoupon_2() {
var obj = $(".bulten_oranSelected");
obj.removeClass("bulten_oranSelected");
obj.addClass("bulten_oran");

}


function ChangeTypeCoupon(typid) {

    $.ajax({

        type: "GET",

        url: "iddaa/kupon_fonksiyon.html?islem=tip_degistir",

        data: "typeid=" + typid,

        contentType: "application/json; charset=utf-8",

        dataType: "json",

        success: function(msg) {

            retval = msg.d;

            if (retval.Status == 5) {

                location.reload();

                return;

            }

            document.getElementById("couponfrm").src = "iddaa/kupon.html?ViewType=CouponSystem";

        },

        error: function(xmlHttpRequest, status, err) {

            jAlert('Kupon Tipi Değiştirilemedi.','Uyarı');

        }

    });

}



function ToogleBanko(code, gametypeid, integrationcode) {

    $.ajax({

        type: "GET",

        url: "iddaa/kupon_fonksiyon.html?islem=banko_degis",

        data: "code=" + code,

        contentType: "application/json; charset=utf-8",

        dataType: "json",

        success: function(msg) {

            retval = msg.d;

            if (retval.Status == 5) {

                location.reload();

                return;

            }

            

            document.getElementById("couponfrm").src = "iddaa/kupon.html?ViewType=CouponSystem";

        },

        error: function(xmlHttpRequest, status, err) {

            enableCoupon('dCoupon');
            jAlert('Banko Yapılamadı.','Uyarı');

        }

    });

}



function CalculateCoupon(coupontype, system, multiply, gamecolumns, maxodd) {

    $.ajax({

        type: "GET",

        url: "iddaa/kupon_fonksiyon.html?islem=kupon_hesapla",

        data: "{coupontype: " + coupontype + ", system: '" + system + "', multiply: " + multiply + ", gamecolumns: " + gamecolumns + ", maxodd: " + maxodd + " }",

        contentType: "application/json; charset=utf-8",

        dataType: "json",

        success: function(msg) {

            retval = msg.d;



            if (retval.Status == 5) {

                location.reload();

                return;

            }

        

        document.getElementById("couponfrm").src = "/IddaaKupon.aspx?ViewType=CouponCalculate&Status=" + retval.Status + "&ErrorMessage=" + escape(_utf8_encode(retval.ErrorMessage));

        },

        error: function(xmlHttpRequest, status, err) {

            jAlert('Kupon Hesaplanamadı.','Uyarı');

        }

    });

}










$(document).ready(function() {
      
	// Setup the nav drop-downs
	$('#nav').nmcDropDown({
    show: {height: 'show', opacity: 'show'}
	});
	
});

(function(a){a.fn.nmcDropDown=function(b){var c=a.extend({},a.fn.nmcDropDown.defaults,b);return this.each(function(){menu=a(this);submenus=menu.children("li:has("+c.submenu_selector+")");if(c.fix_IE){menu.css("z-index",51).parents().each(function(d){if(a(this).css("position")=="relative"){a(this).css("z-index",(d+52))}});submenus.children(c.submenu_selector).css("z-index",50)}over=function(){a(this).addClass(c.active_class).children(c.submenu_selector).animate(c.show,c.show_speed);return false};out=function(){a(this).removeClass(c.active_class).children(c.submenu_selector).animate(c.hide,c.hide_speed);return false};if(c.trigger=="click"){submenus.toggle(over,out).children(c.submenu_selector).hide()}else{if(a().hoverIntent){submenus.hoverIntent({interval:c.show_delay,over:over,timeout:c.hide_delay,out:out}).children(c.submenu_selector).hide()}else{submenus.hover(over,out).children(c.submenu_selector).hide()}}})};a.fn.nmcDropDown.defaults={trigger:"hover",active_class:"open",submenu_selector:"ul",show:{opacity:"show"},show_speed:300,show_delay:50,hide:{opacity:"hide"},hide_speed:200,hide_delay:100,fix_IE:true}})(jQuery);


(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);




















var loadstatustext="<img src='images/loader.gif' /> Yükleniyor...";
var autocontrolvar;

var arrayList = new Array (  "/tab/", //// Tab 
							"/tab/changeMustWatch", //// Must Watch
							"/tab/changeMustRead", //// Must Read
							"/tab/"

						 ); 	

function changeNavigation ( arg, total_arg, tab_name )
{	
   try 
   {   		
		if ( tab_name == 'most' )	var url = arrayList[ 0 ];
		if ( tab_name == 'mustwatch' )	var url = arrayList[ 1 ];
		if ( tab_name == 'mustread' )	var url = arrayList[ 2 ];
        
	 		
	if ( tab_name == 'most' 
|| tab_name == 'kategori' 
|| tab_name == 'haber' 
|| tab_name == 'maclar_kutu' 
|| tab_name == 'videolar' 
|| tab_name == 'cokizlenengenel' 
|| tab_name == 'loan_tax' 
|| tab_name == 'sonmaclar'  
|| tab_name == 'sonyorumlar' 
|| tab_name == 'puandurumu' 
|| tab_name == 'iddaa_programi' 
|| tab_name == 'uye_ekonomi'
|| tab_name == 'uye_ekonomi2' 
|| tab_name == 'uye_oran'
|| tab_name == 'Puan-Durumu-Maclar'    
|| tab_name == 'Puan-Durumu-Maclar1'
|| tab_name == 'Puan-Durumu-Maclar2'
|| tab_name == 'Puan-Durumu-Maclar3'
|| tab_name == 'Puan-Durumu-Maclar4'
|| tab_name == 'Puan-Durumu-Maclar5'
|| tab_name == 'Puan-Durumu-Maclar6'
|| tab_name == 'Puan-Durumu' 
|| tab_name == 'Puan-Durumu1'  
|| tab_name == 'Puan-Durumu2'
|| tab_name == 'Puan-Durumu3'
|| tab_name == 'Puan-Durumu4'
|| tab_name == 'Puan-Durumu5'
|| tab_name == 'Puan-Durumu6'
    ) 		
{	 
	 for ( var i=1; i <= total_arg ; i++ )	 {
		if ( arg == i )
			document.getElementById( tab_name +i).style.display="block";
		else
			document.getElementById( tab_name +i).style.display="none";
	}
	
	if (tab_name == 'kategori' 
|| tab_name == 'sonmaclar' 
|| tab_name == 'haber' 
|| tab_name == 'maclar_kutu' 
||  tab_name == 'videolar' 
|| tab_name == 'cokizlenengenel'  
|| tab_name == 'sonyorumlar' 
|| tab_name == 'puandurumu' 
|| tab_name == 'iddaa_programi' 
|| tab_name == 'uye_ekonomi' 
|| tab_name == 'uye_ekonomi2' 
|| tab_name == 'uye_oran' 
|| tab_name == 'Puan-Durumu-Maclar'          
|| tab_name == 'Puan-Durumu-Maclar1'
|| tab_name == 'Puan-Durumu-Maclar2'
|| tab_name == 'Puan-Durumu-Maclar3'
|| tab_name == 'Puan-Durumu-Maclar4'
|| tab_name == 'Puan-Durumu-Maclar5'
|| tab_name == 'Puan-Durumu-Maclar6'
|| tab_name == 'Puan-Durumu'  
|| tab_name == 'Puan-Durumu1'  
|| tab_name == 'Puan-Durumu2'
|| tab_name == 'Puan-Durumu3'
|| tab_name == 'Puan-Durumu4'
|| tab_name == 'Puan-Durumu5'
|| tab_name == 'Puan-Durumu6'          
            ) {
				for ( var i=1; i <= total_arg ; i++ )	 {
				if ( arg == i )
					document.getElementById( "a" + tab_name +i).style.display="block";
				else
					document.getElementById( "a" + tab_name +i).style.display="none";
			}
			}		
		}
		http.send(null);
   }catch(e){}
}



/*TAB MENÜ SCRİPTİ SONU*/ 





function yazi_bk(trgt,inc)

{

   if (!document.getElementById) return;

   var d = document, cEl = null, sz = startSz, i, j, cTags;



   sz += inc;

   if ( sz < 0 ) sz = 0;

   if ( sz > 6 ) sz = 6;

   startSz = sz;



   if (!(cEl = d.getElementById(trgt))) cEl = d.getElementsByTagName(trgt)[0];



   cEl.style.fontSize = szs[sz];



   for (i = 0; i < tgs.length; i++)

   {

      cTags = cEl.getElementsByTagName(tgs[i]);

      for (j = 0; j < cTags.length; j++) cTags[j].style.fontSize = szs[sz];

   }

}
