function popLM(szHTML)
{
	var w = 370;
	var h = 400;
	window.open(szHTML,'LrnMr','width='+w+',height='+h+',scrollbars=1,toolbar=0,titlebar=0,menubar=0,resizable=1,status=0,location=0');
	//return false;
}
function popWnd(szHTML,szName,w,h)
{
	if (szName==null) szName='PopWnd';
	window.open(szHTML,szName,'width='+w+',height='+h+',scrollbars=0,toolbar=0,titlebar=0,menubar=0,resizable=0,status=0,location=0');
	return false;
}
function popWndX(szHTML,szName,w,h)
{
	if (szName==null) szName='PopWnd';
	window.open(szHTML,szName,'width='+w+',height='+h+',scrollbars=1,toolbar=0,titlebar=0,menubar=0,resizable=1,status=0,location=0');
	return false;
}
function popWndD(szHTML)
{
	return popWnd(szHTML,null,278,160); //300,100);
}
function approveWnd(szCmd,szTyp,szID)
{
	var szHTML="/Approval/Process.aspx?Cmd="+szCmd+"&Typ="+szTyp+"&ID="+szID;
	return popWnd(szHTML,'AppvWnd',450,100);
}
function approveWndExt(szCmd,szTyp,szID)
{
	var szHTML="/Approval/Process.aspx?Cmd="+szCmd+"&Typ="+szTyp+"&ID="+szID;
	return popWnd(szHTML,'AppvWnd',575,120);
}
function voteWnd(szImg,iValue)
{
	szHTML="/Profile/Vote/"+szImg+"/"+iValue+".aspx";
	return popWndD(szHTML);
}
function setWindowSize_Fixed( w, h )
{
	setWindowSize( w + 8, h + 24 );
}

var isIE = 
	(navigator.appVersion.indexOf("MSIE") != -1) ||
    (navigator.appName.indexOf("Microsoft") != -1);
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1);
var isSafari = navigator.platform.indexOf("Mac") > -1 && navigator.appName == "Netscape";
function setWindowSize( w, h )
{
	if (isIE || isSafari)
	{
		self.resizeTo(w, h);
	}
	else
	{
		window.outerWidth = w; 
		window.outerHeight = h;		
	}
}

function collapseTable( tbl )
{
    if( !tbl || !tbl.rows || tbl.rows.length < 2 )
        return; // can't collapse a table with this few rows

    var ctShowHide = (tbl.rows[1].style.display == "none");
    for( cntr=1; cntr<tbl.rows.length; cntr++ )
    {
        if( ctShowHide )
            tbl.rows[cntr].style.display = "";
        else
            tbl.rows[cntr].style.display = "none";
    }
}

function collapseTableID( tblID )
{
    var tbl = document.getElementById( tblID );
    if( !tbl || !tbl.rows || tbl.rows.length < 2 )
        return; // can't collapse a table with this few rows

    var ctShowHide = (tbl.rows[1].style.display == "none");
    for( cntr=1; cntr<tbl.rows.length; cntr++ )
    {
        if( ctShowHide )
            tbl.rows[cntr].style.display = "";
        else
            tbl.rows[cntr].style.display = "none";
    }
}

function popMsgr()
{
    return false; // popWnd('/Messenger/','MsgWnd',400,250);
}
function popMsgrNR()
{
    // popWnd('/Messenger/','MsgWnd',400,250);
}
function popBroadcast()
{
    return popWnd('/Video/BroadcastTerms.aspx','VidBC',360,360);
}
function popBroadcastNR()
{
    popWnd('/Video/BroadcastTerms.aspx','VidBC',360,360);
}

function selectSetForm(sSelState,sForm)
{
    if ( sForm == null )
        sForm = 0;
        
    var myForm = document.forms[sForm];
    for( i=0; i<myForm.elements.length; i++ )
    {
        if( myForm.elements[i].type == "checkbox" )
        {
            if( sSelState == null )
                myForm.elements[i].checked = !myForm.elements[i].checked;
            else
                myForm.elements[i].checked = sSelState;
        }
    }
}
