

function printUpHistory()
{
factory.printing.header = " ";
factory.printing.footer = " ";
factory.printing.portrait = false;
factory.printing.Print(false);
window.close()
}

function openWindow(pageName)
{
    var nW = window.open("", "popupWindow", "resizable=no,scrollbars=yes,width=600,height=460");
    nW.location.href = "SetThresholds.aspx?page=" + pageName
    nW = null;
}

function OpenDemo()
{    
    var nW = window.open("", "Demo", 
	"resizable=yes,scrollbars=no,width=640,height=480");
    nW.location.href = "/demo/demo.aspx"
    nW = null;    
}

function AboutUs()
{
    var nW = window.open("", "AboutUs",
        "resizable=no,scrollbars=no,width=340,height=200");
    nW.location.href = "AboutUsPopup.htm"
    nW = null;
}


function OpenUserGuide()
{
    var nW = window.open("", "adduser",
        "resizable=yes,scrollbars=yes,width=650,height=550");
    nW.location.href = "/UserGuide.aspx?id=1"
    nW = null;
}


function OpenFAQ()
{
    var nW = window.open("", "adduser",
        "resizable=yes,scrollbars=yes,width=650,height=550");
    nW.location.href = "/UserGuide.aspx?id=3"
    nW = null;
}


function CalPopup()
{
    var nW = window.open("", "adduser",
        "resizable=no,scrollbars=no,width=380,height=220");
    nW.location.href = "Calendar.aspx"
    nW = null;
}

function goback()
{
	if (document.layers)
	history.back(1)
	else if (document.all)
	history.back(1)
}


function GetDate(CtrlName, sdate, pid)    
{
	ChildWindow = window.open('CalendarPopup.aspx?pid=' + pid + '&date=' + sdate + '&FormName=ctrPeriods_Periods__' + document.forms[0].name + '&CtrlName=' + CtrlName, "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");    
}   


function CheckWindow()   

{
      ChildWindow.close();   
}

function contact()
{    
    var nW = window.open("", "Contact", 
	"resizable=yes,scrollbars=no,width=640,height=480");
    nW.location.href = "/contact.aspx"
    nW = null;    
}

function alertbx(txt)
{
alert(txt)
}


function toggle(tName)
{
	var item = document.getElementById(tName);
	if (item == null) return;
//	item.style.display = '';
	if (item.style.display == '')
	{
		item.style.display = 'none';
	}
	else
	{
		item.style.display = '';
	}
}


//
//
//
//
//
//
//
//
//
                function toggleQuestion(tName, qName, aName)
                {
                    var title = document.getElementById(tName);
                    if (title == null) return;
                    var ans = document.getElementById(aName);
                    if (ans == null) return;
                    var que = document.getElementById(qName);
                    if (ans.style.display == '')
                    {
                      if (que != null) que.style.display = 'none';
	                    ans.style.display = 'none';
	                    var sa = document.getElementById("chkViewAll");
	                    sa.checked = false;
                    }
                    else
                    {
                        if (que != null) que.style.display = '';
	                    ans.style.display = '';
                    }
                }