
function openWindow(url, windowWidth, windowHeight){

    window.open(url,"popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,fullscreen=no,width=" + windowWidth  +" ,height=" + windowHeight);

}

function openWebDollar_c(url)
{
    if(!url)
        url = "/webdollarpopup.aspx";
        
    webbdollarWin = window.open(url,"webbdollar","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,width=" + 660  +" ,height=" + 550);    

    
}

function openWebDollar(url)
{
    if(!url)
        url = "/webdollarpopup.aspx";
        
    webbdollarWin = window.open(url,"webbdollar","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,width=" + 660  +" ,height=" + 550);        
}

function openGame(url, width, height)
{

    
    return window.open(url, '_blank', 'width=' + width + ',height=' + height + ',scollbars=yes,resizable=yes,location=no,status=no');
    
}

function openBingoGame(url, width, height)
{
        var   winW=screen.width;
        var   winH=screen.height;
            
    
    //add client width
    url = url + '?cw='+winW + '&ch='+winH;
  
    if (winW=="1024"){
        width=900;
        height=670;
    }
    
    
    return window.open(url, '_blank', 'width=' + width + ',height=' + height + ',scollbars=yes,resizable=yes,location=no,status=no');
    
}




   
function updateGames()
{    
     if (false)
         __doPostBack('ctl00_FullContentRegion_LeftContentRegion_gamelist','');  
}

function AvatarUpdate(avatarId)
{
    var div = document.getElementById('avatarPickerDiv');
    var radio;
    var el = div.getElementsByTagName('input');
    for(var i=0; i<el.length; i++)
    {
        radio = el[i];
        if(radio.checked)
        {                        
            var srcimg = radio.previousSibling;
            while(srcimg.tagName!='IMG')
                srcimg = srcimg.previousSibling;
            document.getElementById(avatarId).src=srcimg.src;
        }
    }
}


function attachCallbackEvent(fn)
{
	try {Sys.WebForms.PageRequestManager.getInstance().add_endRequest(fn);}
	catch(e) {} 
	
}

function clearField(field, testfor)
{   
  
  
    if (field.value == testfor){
        field.value ="";
    }
}

function changeTextboxType(box)
{
    var el = box.cloneNode(false);
    el.type = 'password';
    el.onactivate = box.onactivate = null;
    el.onfocus = box.onfocus = null;
    el.value='';
    box.parentNode.insertBefore(el, box);
    box.id = box.id + '_old';
    box.name = box.name + '_old';
    box.style.display='none';

    el.focus();
}
