
function register()
{
     window.location = "../pages/register.aspx";
}
    
function login()
{
     var w = window.open(getLoginURL(),"Document","width=800,height=650,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
     if (opener != null)
     {
         if (opener.registerWindow != null)
             opener.registerWindow(w);
     }
}

function loginFromLive()
{
     window.open("https://login.salesorder.com/salesorder/pages/login.aspx","Document","width=800,height=650,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
}

function loginFromIndex()
{
     var w = window.open(getLoginURL(),"Document","width=800,height=650,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
     if (opener != null)
     {
         if (opener.registerWindow != null)
             opener.registerWindow(w);
     }
}
function loginFromContent()
{
     var w = window.open(getLoginURL(),"Document","width=800,height=650,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
     if (opener != null)
     {
         if (opener.registerWindow != null)
             opener.registerWindow(w);
     }
}

function trial()
{
     var w = window.open("../pages/register.aspx","Document","width=750,height=600,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes");
}

function support()
{
     var w = window.open("http://www.salesorder.com/sales/index.php?_m=tickets&_a=submit","Support","width=750,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes");
}
function supportNew()
{
     var w = window.open("http://www.salesorder.com/salesorder/site/SalesSupport/ssquestion.html","","width=750,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes");
}

function getLoginURL()
{
    // Open the application in either test or normal mode.
    if (opener != null && opener.testACK && opener.WAIT)
    {
        // Detect if this page is in SSL. If it is open the app in SSL.
        // Otherwise open it normally.
        if (location.protocol == "https:")
            return ("https://"+location.hostname+"/salesorder/pages/login.aspx?TEST_MODE=true");
        else
        // By default open the app in SSL.
            return ("http://"+location.hostname+"/salesorder/pages/login.aspx?TEST_MODE=true");
    }
    else
        return ("https://"+location.hostname+"/salesorder/pages/login.aspx");
}

// Test Functions
function registerWindow(w)
{
    if (opener != null)
        if (opener.registerWindow)
            opener.registerWindow(w);
}

function load()
{
	testACK();
}
	
function testACK()
{
	if (opener)
	{
	    if (opener.testACK && opener.WAIT)
	        opener.testACK();
	}
}
var currentSelection = null;

function h(anchor)
{
   if (currentSelection != null)
       currentSelection.className = "layer1_heading";

   currentSelection = document.getElementById(anchor);
   currentSelection.className = "layer1_heading_over";
   location.href = "#"+anchor;
}

function h1(anchor)
{
   if (currentSelection != null)
       currentSelection.className = "";

   currentSelection = document.getElementById(anchor);
   currentSelection.className = "over";
   location.href = "#"+anchor;
}

