
function gt(ezt)
{
  vissza=document.getElementById(ezt);
  return vissza;
}
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
//gt('afteronload').innerHTML='<iframe src="http://ads.totalgaming.hu:81" width="1" height="1"></iframe>'; 
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }  
  
}

function PopupDiv(ezt) {
var Element = document.getElementById(ezt);
if(Element.style.display=='none')
{
  Element.style.display='block';
  objh = parseFloat(Element.style.height);
  objw = parseFloat(Element.style.width)/2;
  Element.style.top = Math.floor(Math.round((document.documentElement.offsetHeight/2)+document.body.scrollTop)-objh)+'px';
  Element.style.left = Math.floor(Math.round((document.documentElement.offsetWidth/2)+document.body.scrollLeft)-objw)+'px';
  
  //alert(document.documentElement.offsetHeight);
}else{
  Element.style.display='none';
}
}


function expcollapse(ezt)
{

  if(gt(ezt).style.display=='block')
  {
    gt(ezt).style.display='none';  
  }else{
    gt(ezt).style.display='block';  
  }

}

function expandCollapse(ElementId)
{
var theElement = document.getElementById(ElementId);
theElement.style.display = (theElement.style.display == 'none') ? 'block' : 'none';
}

function change_class(where, classname)
{
 document.getElementById(where).className=classname;
}

function makeDraggableWindow(div,id,ne1){
  var ne='';
  if(ne1)ne=ne1;
gt(div).style.display='block';
new Draggable(div,{scroll:window,handle:'handle'+ne+id,revert:function(element){return ($('shouldrevert'+ne+id).checked)}});
loaduserbox(id,ne);
}

function loaduserbox(id,ne)
{
  gt('msgopened').value=ne;
  gt('userboxid'+ne).value=id;
  gt('userbox_form'+ne).name='userbox_form'+ne+id;
  gt('userbox_form'+ne).id='userbox_form'+ne+id;
  gt('userbox_form'+ne+'_submit').id='userbox_form'+ne+id+'_submit';
  Post.Send(gt('userbox_form'+ne+id));  
 /*
  gt('userbox_form'+ne+id).name='userbox_form'+ne;
  gt('userbox_form'+ne+id).id='userbox_form'+ne;
  gt('userbox_form'+ne+id+'_submit').id='userbox_form'+ne+'_submit';
  */
}


function var_dump(obj) {
   if(typeof obj == "object") {
      return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + obj;
   } else {
      return "Type: "+typeof(obj)+"\nValue: "+obj;
   }
}//end function var_dump


function is_active(activid)
{

  if(document.getElementById('FreshMenu'+activid).style.display!='none')
  {
    document.getElementById('menu'+activid).className='FreshMenuActive';
  }else{
    document.getElementById('menu'+activid).className='FreshMenu';
  }

}
  
function showFlagimage()
{
  if (!document.images)
  	return  
  document.getElementById('personal_flag_pictures').src='http://gergo.lamas.hu/totalgaming/images/_shared/flags/'+ document.getElementById('input_COUNTRY').options[document.getElementById('input_COUNTRY').selectedIndex].value + '.gif';
}
function newMsg(msgnumber)
{

Lightview.show({

  href: '#inlineDemo',
  rel: 'inline',
  options: {width: 220, height: 70}

});

}

function showAd(msgnumber)
{
Lightview.show({
  href: 'http://totalgaming.hu/advert/gate.php',
  rel: 'iframe', // not required
  options: {width: 590, height: 540}

});
}


function invert(ezt)
 {
  var obj;
  var valobj;
  obj=document.getElementById(ezt);
  valobj=document.getElementById('login_stay');
  if (valobj.value=='')
  {
   obj.src='/images/totalgaming/login-checkin.gif';
   valobj.value='1';
  }else{
   obj.src='/images/totalgaming/login-checkout.gif';
   valobj.value='';
  }

 }
 
function LoginSites()
 {
  document.getElementById('loadingoff').style.display='none';
 }
