// Opens new window with location
function openNewWin(addr, height, width)
{
	window.open(addr, 'WCDBPopUp', 'top=25, left=25, height='+height+', width='+width+', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes').focus();
}

function refreshParent(refreshButton)
{
    var elem = $get(refreshButton);
    elem.click();
}

function getElement(id) 
{
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

//  FS 01/07/2008 - Currently in use
function ListenLiveWindow(type, speed) 
{
	var path = 'ListenLive/ListenLivePlayer.aspx?Type=' + type + '&Speed=' + speed;
	window.open(path, 'ListenLive', 'width=655, height=275, left=20, top=20, location=no, scrollbars=no, menubars=no,  toolbars=no, resizable=yes').focus();
}

//  FS 01/07/2008 - Currently in use
function fnPollWindow(Mode, PollID, PollChoiceID)	
{	
	window.open('PollWindow.aspx?Mode='+Mode+'&PollID='+PollID+'&PollChoiceID='+PollChoiceID, 'PollResultsWindow', 'width=575, height=300, left=10, top=10, location=no, scrollbars=yes, menubars=no,  toolbars=no, resizable=yes').focus();
}

//  FS 01/07/2008 - Currently in use
function EditEBoard(in_intEBoardID)
{
	window.open("Admin_EBoard_Edit.aspx?PosID="+in_intEBoardID,"EditEBoard","width=400,height=160,top=100,left=100,scrollbars=yes").focus();
}

//  FS 01/07/2008 - Currently in use
function PrintDJList()
{
	var Today = new Date();
	var DJList = $get("DJList");
	var PageContent = DJList.innerHTML;
	PageContent = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><link rel='stylesheet' href='../common/printstyle.css'></head><body class='center'><table align='center' border='0'><tr><td align='left' width='130'><img src='../images/WCDB_Menu.png'></td><td align='center' width='290' class='heading'>90.9FM WCDB Albany, New York<br />DJ Roster as of: " +
					(Number(Today.getMonth())+Number(1)) + "/" + Today.getDate() + "/" + Today.getYear() + 
					"<br /><br /></td><td align='right' width='130'><img src='../images/WCDB_Menu.png'></td></tr></table>" +
					PageContent + 
					"</body></html>";
	var PrintWindow = window.open();
	PrintWindow.document.write(PageContent);		
}

//  FS 01/07/2008 - Currently in use
function PrintSchedule()
{
	var Today = new Date();
	var Schedule = $get("Schedule");
	var PageContent = Schedule.innerHTML;
	PageContent = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><link rel=\"stylesheet\" type=\"text/css\" href=\"common/printstyle.css\"></head><body class='center'><table class='center' border='0'><tr><td align='left' style='width: 130px;'><img alt='WCDB' src='images/WCDB_Menu.png' /></td><td class='heading' align='center' style='width: 325px;'>90.9FM WCDB Albany, New York<br/>Programming Schedule as of " + 
					(Number(Today.getMonth())+Number(1)) + "/" + Today.getDate() + "/" + Today.getYear() + 
					"<br /><br />Visit us online at http://www.WCDBFM.com</td><td align='right' style='width: 130px;'><img alt='WCDB' src='images/WCDB_Menu.png' /></td></tr></table>" +
					PageContent + 
					"</body></html>";
	PrintWindow = window.open();
	PrintWindow.document.write(PageContent);			
}	

//  FS 01/07/2008 - Currently in use
function progressBar_onUpdating(_pnlPopup, _centerControl, centerX, centerY)
{
    // get the update progress div
    var pnlPopup = $get(_pnlPopup); 

    //  get the center control element        
    var centerControl = $get(_centerControl);
    
    // make it visible
    pnlPopup.style.display = '';	    
    
    // get the bounds of both the gridview and the progress div
    var centerControlBounds = Sys.UI.DomElement.getBounds(centerControl);
    var pnlPopupBounds = Sys.UI.DomElement.getBounds(pnlPopup);
    
    //  center of control
    var x = 0;
    var y = 0;
    
    if (centerX == true)
    {
        x = centerControlBounds.x + Math.round(centerControlBounds.width / 2) - Math.round(pnlPopupBounds.width / 2);
    }
    else
    {
        x = centerControlBounds.x - Math.round(pnlPopupBounds.width / 2);
    }
    
    if (centerY == true)
    {
        y = centerControlBounds.y + Math.round(centerControlBounds.height / 2) - Math.round(pnlPopupBounds.height / 2);	    
    }
    else
    {
        y = centerControlBounds.y - Math.round(pnlPopupBounds.height / 2)
    }

    //	set the progress element to this position
    Sys.UI.DomElement.setLocation(pnlPopup, x, y);           
}

//  FS 01/07/2008 - Currently in use
function progressBar_onUpdated(_pnlPopup) 
{
    // get the update progress div
    var pnlPopup = $get(_pnlPopup); 
    // make it invisible
    pnlPopup.style.display = 'none';
}       