function changeDisplay(objectID)    {

    object = document.getElementById(objectID).style;
    currentState = object.display;

    if (currentState == "none" || currentState == "") {

        object.display = "block";

    } else {

        object.display = "none";

    }

    return false;

}

function clearText(object, text) {

    if (object.value == text) {

        object.value = "";

    } else if (object.value == "") {

        object.value = text;

    }

}

function preloadImages(idList) {

    ids = idList.split(", ");
    var preImg = new Array();

    for (var id in ids) {

        preImg[id] = new Image();
        preImg[id].src = ids[id];

    }

}

function showImage(id) {

    fi = document.getElementById("fullImage").style;
    fi.backgroundImage = "url('"+id+"')";

}

function showBetDetails(betID)    {

    object = document.getElementById('bet'+betID).style;
    currentState = object.display;

    if (currentState == "none" || currentState == "") {

        try { /* IE не поддерживает table-row */

            object.display = "table-row";

        } catch (e) {

            object.display = "block";

        }

    } else {

        object.display = "none";

    }

}
function changeBlock(activeChangeBox,hideChangeBox){
    /*var contentChangeBox = document.getElementById('contentChangeBox');
    var changeBoxList = contentChangeBox.getElementsByTagName('DIV')

    for(var i = 0; i < changeBoxList.length; i++ ) {
        changeBoxList[i].style.display = "none";
    }*/
    document.getElementById(hideChangeBox).style.display = "none";
    document.getElementById(activeChangeBox).style.display = "block";

    /*var hideChangeBox = document.getElementById(hideChangeBox);
    hideChangeBox.style.display = "none";
    document.getElementById(hideChangeBox).style.display = "none";

    var activeChangeBox = document.getElementById(activeChangeBox);
    activeChangeBox.style.display = "block";
    document.getElementById(activeChangeBox).style.display = "block";*/
}
function changeMoneyBlock(activeChangeBox){
    var contentChangeBox = document.getElementById('moneyBox');
    var changeBoxList = contentChangeBox.getElementsByTagName('DIV')

    for(var i = 0; i < changeBoxList.length; i++ ) {
        changeBoxList[i].style.display = "none";
    }

    var activeChangeBox = document.getElementById(activeChangeBox);
    activeChangeBox.style.display = "block";
}
function changePic(obj, newPic){
    var last_state = obj.src;
    obj.src = newPic;
}
function fifty_change(){
    allmoney=document.paymentForm.all_money.value*1;
    in_money=document.paymentForm.get_money_in.value*1;
    name_money=(allmoney-in_money)*0.85;
    document.paymentForm.get_money_card.value=name_money.toFixed(2);
}
function counter_liveinternet(){
    document.getElementById('linternet').innerHTML='<img src="h'+'t'+'t'+'p'+':'+'/'+'/'+"counter.yadro.ru/hit?t44.1;r"+escape(document.referrer)+((typeof(screen)=="undefined")?"":";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+";"+Math.random()+'" alt="" title="LiveInternet" border="0" width="31" height="31">'; 
}
function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}
function screenHeight(){

return $.browser.opera? $(document).height() : $(document).height();

}
function bonusHide(){
    document.getElementById('bonus').style.display='none';
    document.getElementById('bonus2').style.display='none';
    return false;
}
function getPageSize() {
            
         var xScroll, yScroll;
        
        if (window.innerHeight && window.scrollMaxY) {    
            xScroll = window.innerWidth + window.scrollMaxX;
            yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
            xScroll = document.body.scrollWidth;
            yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
            xScroll = document.body.offsetWidth;
            yScroll = document.body.offsetHeight;
        }
        
        var windowWidth, windowHeight;
        
        if (self.innerHeight) {    // all except Explorer
            if(document.documentElement.clientWidth){
                windowWidth = document.documentElement.clientWidth; 
            } else {
                windowWidth = self.innerWidth;
            }
            windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
            windowWidth = document.documentElement.clientWidth;
            windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
            windowWidth = document.body.clientWidth;
            windowHeight = document.body.clientHeight;
        }    
        
        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
            pageHeight = windowHeight;
        } else { 
            pageHeight = yScroll;
        }
    
        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){    
            pageWidth = xScroll;        
        } else {
            pageWidth = windowWidth;
        }

        return [pageWidth,pageHeight];
    }
