function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isOP    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isOP = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }

  s = "MSIE";
  if ((i = ua.indexOf(s))) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }
}

var browser = new Browser();


var xBonusCode = 'bitti';
var xAnaMenu;
var xIEoldmessage;
var LastMenu0;
var LastMenu1;
var LastMenu2;
var LastMenu3;

LastMenu0 = "";
LastMenu1 = "";
LastMenu2 = "";
LastMenu3 = "";

function show(object) {
 if (browser.isIE) {
//	 document.all.iframegizle.outerHTML = '<font id=iframegizle></font>';
	 if (document.getElementById && document.getElementById(object) != null)
       document.getElementById(object).style.visibility='visible';
	 else if (document.layers && document.layers[object])       
       document.layers[object].visibility = 'visible';
	 else if (document.all)
	    document.all[object].style.visibility = 'visible';
	 }
}
function hide(object){
	 if (browser.isIE) {	
 if (document.getElementById && document.getElementById(object) != null)
       document.getElementById(object).style.visibility='hidden';
 else if (document.layers && document.layers[object])       
       document.layers[object].visibility = 'hidden';
 else if (document.all)
    document.all[object].style.visibility = 'hidden';
	 }
}


function getX(obj)
{
 return( obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft+getX(obj.offsetParent) );
}

function getY(obj)
{
 return( obj.offsetParent==null ? obj.offsetTop : obj.offsetTop+getY(obj.offsetParent) );
}


function opendiv(xMenu,xMenu1,xMenu2,xMenu3) {

var img;
var xvalue;
var xdeger;

Showhide_Checkbox(0);

if (xMenu1 == "") xvalue = xMenu;

if ((LastMenu0.indexOf(xMenu)  < 0) ||(xMenu == "" && LastMenu0 != "" ))  { hidediv(LastMenu0);LastMenu0 = "";}

if  (document.images["mimage"+ xMenu + xMenu1 + xMenu2 + xMenu3] != null)  
    img = document.images["mimage"+ xMenu + xMenu1 + xMenu2 + xMenu3];

if (img.src.indexOf('spacer',0)>-1)
  {
   if (xMenu  != "")  LastMenu0 = xMenu ;  
   if (xvalue != "") {
     /*if  (document.all["menu"+xvalue] != null) {   
       document.all["menu"+xvalue].style.pixelTop  = getY(img) + 18;
       document.all["menu"+xvalue].style.pixelLeft = getX(img) + 5+3;  
	 }*/  
	 if (document.getElementById("menu"+xvalue) != null) {
	  	document.getElementById("menu"+xvalue).style.top  = getY(img) + 18;
		document.getElementById("menu"+xvalue).style.left  = getX(img) + 8;
	  }
    }
  }  
}


function movediv(xMenu,xMenu1,xMenu2,xMenu3) {

var img;
var xvalue;
var xdeger;

if (xMenu3 == "") xvalue = xMenu + xMenu1 + xMenu2;
if (xMenu2 == "") xvalue = xMenu + xMenu1;
if (xMenu1 == "") xvalue = xMenu;

if ((LastMenu2.indexOf(xMenu + xMenu1 + xMenu2) < 0) ||(xMenu2 == "" && LastMenu2 != "" )) { hidediv(LastMenu2);LastMenu2 = "";}

if ((LastMenu1.indexOf(xMenu + xMenu1) < 0) ||(xMenu1 == "" && LastMenu1 != "" ))  { hidediv(LastMenu1);LastMenu1 = "";}

if ((LastMenu0.indexOf(xMenu)  < 0) ||(xMenu == "" && LastMenu0 != "" ))  { hidediv(LastMenu0);LastMenu0 = "";}

if  (document.images["mimage"+ xMenu + xMenu1 + xMenu2 + xMenu3] != null) 
        img = document.images["mimage"+ xMenu + xMenu1 + xMenu2 + xMenu3];

if (img.src.indexOf('arrow_black',0)>-1)
  {
if (xMenu2 != "")  LastMenu2 = xMenu + xMenu1 + xMenu2; 
if (xMenu1 != "")  LastMenu1 = xMenu + xMenu1;
if (xMenu  != "")  LastMenu0 = xMenu ;  
   if (xvalue != "") {
     /*if  (document.all["menu"+xvalue] != null) {
       document.all["menu"+xvalue].style.pixelTop  = getY(img) + 2;
       document.all["menu"+xvalue].style.pixelLeft = getX(img) + 10;  
	 }  */
	 if (document.getElementById("menu"+xvalue) != null) {
	  	document.getElementById("menu"+xvalue).style.top  = getY(img) + 2;
		document.getElementById("menu"+xvalue).style.left  = getX(img) + 10;
	  }
    }
  }  
}

function hidediv(xMenu) {
var img;
 if (!(xMenu == "")) {
//   if  (document.all["menu"+xMenu] != null)   document.all["menu"+xMenu].style.pixelTop = - 800;
   if  (document.getElementById("menu"+xMenu) != null)   document.getElementById("menu"+xMenu).style.top = - 800;
 }
} 
 
function hidemenus() {
 if (LastMenu2 != "")   hidediv(LastMenu2);
 if (LastMenu1 != "")   hidediv(LastMenu1);
 if (LastMenu0 != "")   hidediv(LastMenu0);
    if ( BrowserVersion < 5.5) {    
      show('ifricerik');
    }
 Showhide_Checkbox(1);	
}  

function popUp(url,xwinname,xwidth,xheight,xscrollbars) 
{
	var str  = "toolbar=0,directories=0,status=0,menubar=0,scrollbars="+xscrollbars+",resizable=0,width="+xwidth+",height="+xheight+",top=0,left=0";
	var xsealWin = window.open(url,xwinname,str);
}

function popUpSecure(url,xwinname,xwidth,xheight) 
{
	var str  = "toolbar=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width="+xwidth+",height="+xheight+",top=xxx,left=yyy";
      str = str.split('yyy').join(screen.width/2 - xwidth/2);
      str = str.split('xxx').join(screen.height/2 - xheight/2);
	var xsealWin = window.open(url,xwinname,str);
}

function popUpFull(url) 
{
	var str  = "toolbar=0,directories=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=xxx,height=yyy,top=0,left=0";
      str = str.split('xxx').join(screen.width);
      str = str.split('yyy').join(screen.height);		

	sealWin=window.open(url,"ColonyCasino",str);
}

function C_M(xMenu,xMenu1,xMenu2,xMenu3,xTop,xLeft) {
  document.write('<div id="menu'+ xMenu + xMenu1 + xMenu2 + xMenu3 +'" style="POSITION: absolute;  Z-INDEX: 999; VISIBILITY: visible; TOP: '+ xTop +'px; LEFT: '+ xLeft +'px;">'); 
  document.write('<table class="menumain" cellspacing="0" cellpadding="0" border="0">');
}

function C_M_I(xMenu_ID,xMenu,xMenu1,xMenu2,xMenu3,xTitle,xLink,xFrame,xImage,xSubMenu) {

  document.write('<tr><td ');
  if (xFrame == 'ifricerik' || xFrame == 'ifristatistik' )  document.write('onclick="Reload(\''+xFrame+'\',\''+xLink+'\',\''+xMenu_ID+'\');"');
  if (xFrame == 'popup500' )  document.write('onclick="popUp(\''+xLink+'\',\'popup500\','+500+','+317+','+0+');"');    
  if (xFrame == 'popupsecure' )  document.write('onclick="popUpSecure(\''+xLink+'\',\'popupSecure\','+483+','+400+');"');      
  if (xFrame == 'popup576' )  document.write('onclick="popUp(\''+xLink+'\',\'popup576\','+576+','+440+','+1+');"');  
  if (xFrame == 'popup650' )  document.write('onclick="popUp(\''+xLink+'\',\'popup650\','+650+','+479+','+0+');"');
  if (xFrame == 'popup300' )  document.write('onclick="popUpSecure(\''+xLink+'\',\'popup300\','+300+','+300+');"');      
  if (xFrame == 'popupfull' ) document.write('onclick="popUpFull(\''+xLink+'\');"');    
  if (xFrame == 'popup900x600' ) document.write('onclick="popUp(\''+xLink+'\',\'popup900x600\','+900+','+600+','+0+');"');

  document.write(' class="anamenuoff" onmouseover="');
   if ( BrowserVersion < 5.5) {    
     document.write('hide(\'ifricerik\');');
    }
  document.write('this.className = \'anamenuon\';');
  document.write(' movediv(\'' + xMenu + '\',\'' + xMenu1 + '\',\'' + xMenu2 + '\',\'' + xMenu3 +'\');');
  document.write('" onmouseout="this.className = \'anamenuoff\';"><table class="icmenu" border="0" cellpadding="0" cellspacing="0"><tr>');
  document.write('<td><img src="images/'+xImage+'" width="16" height="16" hspace="3" border="0"></td>');
  document.write('<td width="100%">' + xTitle + '</td>');
  document.write('<td>');
  if ( xSubMenu == "") {
     document.write('<img name="mimage'+ xMenu + xMenu1 + xMenu2 + xMenu3 +'" id="mimage'+ xMenu + xMenu1 + xMenu2 + xMenu3 +'" src="images/spacer.gif" width="1" height="1" border="0" hspace="5">');
   } else {
     document.write('<img align="right" name="mimage'+ xMenu + xMenu1 + xMenu2 + xMenu3 +'" id="mimage'+ xMenu + xMenu1 + xMenu2 + xMenu3 +'" src="images/arrow_black1.gif" width="5" height="9" border="0" hspace="5">');   
   }	 
  document.write('</td></tr></table></td>');
  document.write('</tr>');
}

function C_M_M(xMenu,xMenu1,xMenu2,xMenu3,xTitle,xSubMenu) {
  document.write('<td class="greenbgmenu" width="10"><img name="mimage'+ xMenu + xMenu1 + xMenu2 + xMenu3 +'" id="mimage'+ xMenu + xMenu1 + xMenu2 + xMenu3  +'" src="images/spacer.gif" width="5" height="18" alt="" border="0"></td>');
  document.write('<td class="menutext"');
  document.write('onmouseover="hidemenus();');

   if ( BrowserVersion < 5.5) {  
  document.write('hide(\'ifricerik\');' );
    }  

  if ( xSubMenu == 1) {
     document.write('LastMenu0 =\'' + xMenu + '\';opendiv(\'' + xMenu + '\',\'' + xMenu1 + '\',\'' + xMenu2 + '\',\'' + xMenu3 +'\')');
     document.write(';" onclick="opendiv(\'' + xMenu + '\',\'' + xMenu1 + '\',\'' + xMenu2 + '\',\'' + xMenu3 +'\')');
	} 
  document.write(';" >'+ xTitle +'</td>'); 
}

function C_C_M() {
  document.write('</table></div>');
}

function Reload(xFrame,xLink,xMenu_ID) {
var Link;
if (xLink.length > 1 ) {
 if (xLink.indexOf("?")==-1) {
    Link = xLink + "?wme_id=" +  xMenu_ID;
 } else {
    Link = xLink + "&wme_id=" +  xMenu_ID;
 }
 // if  (document.all[xFrame] != null)  document.all[xFrame].src=Link;
  if  (document.getElementById(xFrame) != null)  document.getElementById(xFrame).src=Link;
   hidemenus();
   Showhide_Checkbox(1);  
 }   
}

function Reload_Statistic(xLink,xWep_name,xCat_id,xLea_id,xLeay_id,xLeag_id,xTeam_id,xTeam_idex,xTop) {
var Link;

if (xLink.indexOf("?")==-1) {
   Link = xLink + "?wep_name="+ xWep_name +"&cat_id="+ xCat_id +"&lea_id="+ xLea_id +"&leay_id="+ xLeay_id +"&leag_id="+ xLeag_id +"&team_id="+ xTeam_id +"&team_idex=" + xTeam_idex +"&xTop=" + xTop;
} else {
   Link = xLink + "&wep_name="+ xWep_name +"&cat_id="+ xCat_id +"&lea_id="+ xLea_id +"&leay_id="+ xLeay_id +"&leag_id="+ xLeag_id +"&team_id="+ xTeam_id +"&team_idex=" + xTeam_idex +"&xTop=" + xTop;
}
 if (parent.document.all['ifristatis'] != null) {
	parent.document.all['ifristatis'].src=Link;
 } 
 else  if  (top.window.document.all['ifristatis'] != null) { 
    top.window.document.all['ifristatis'].src=Link;
 }
}

function Showhide_Checkbox(xdeger) {
 var allFrames,sallFrames,allElements;
 var i,j;

 if (browser.isIE) {
  allElements=document.getElementsByTagName('select');

  Showhide_CheckboxEx(allElements,xdeger);

  allFrames =  self.parent.document.frames;

  //for (j = 0; j < allFrames.length; j++) {
	//if (allFrames[j].getattribute("name") != "CasinoMini"){

		//allElements=allFrames[j].document.getElementsByTagName('select');
		allElements = parent.frames['ifricerik'].document.getElementsByTagName('select');
		Showhide_CheckboxEx(allElements,xdeger);
	
			  //sallFrames =  allFrames[j].document.frames;
			  sallFrames = parent.frames['ifricerik'].document.frames;
			  for (i = 0; i < sallFrames.length; i++) {
				allElements=sallFrames[i].document.getElementsByTagName('select');
				Showhide_CheckboxEx(allElements,xdeger);
			   }
	//}
  //}	
 }
  /*if  (self.parent.document.frames['ifricerik'].sonify != null) {
       if (xdeger == 0) {
           self.parent.document.frames['ifricerik'].hide('dotflashball');
		  } else {
           self.parent.document.frames['ifricerik'].show('dotflashball');		  
		}   
	   }
*/
}	

function bonus_value(yBonusTitle,yBonusNote,yBonusPrize,yBonusButton,yBonusCode) {
 xBonusCode   = yBonusCode;
 
 if (document.all.expBT != null) document.all.expBT.outerHTML = '<font id=\'expBT\'>'+yBonusTitle+'</font>'; 
 if (document.all.expBN != null) document.all.expBN.outerHTML = '<font id=\'expBN\'>'+yBonusNote+'</font>'; 
 if (document.all.expBP != null) document.all.expBP.outerHTML = '<font id=\'expBP\'>'+yBonusPrize+'</font>';  
 if (document.all.takebonus != null) document.all.takebonus.value = yBonusButton;  
 
 show('dotbonus');
}

function bonus_check() {

hide('dotbonus');
if (xBonusCode != null) {
  if (xBonusCode.length > 10 ) {
    if  (document.all['ifrozel'] != null)  document.all['ifrozel'].src='bonusjsp.jsp?bon_code='+xBonusCode;
 	xBonusCode = 'bitti';
   }	
 }  
} 

function Showhide_CheckboxEx(xobj,xdeger) {
    for(i = 0; i< xobj.length; i++)
    {
		 if (xobj[i].type == 'select-one'){ 
 		    if (xdeger == 0) { xobj[i].style.visibility='hidden' } else { xobj[i].style.visibility='visible'};
		}						  
    }
}	

function Reloadgizli(xno) {
 if  (document.all['ifrgizli'] != null)  document.all['ifrgizli'].src='gizlijsp.jsp';
  setTimeout("Reloadgizli(1)",300000);
}  

  setTimeout("Reloadgizli(1)",300000);
