/************************************************************************************/
//	javascripts92.js
//
//	Purpose: Javascipts for use on HTML pages.
//	Copyright: HMI Marketing Corporation. All rights reserved.
//
//	Created: 2002-08-05
//	Modified: 2008-01-13  file: javascripts92_080113Revised.js
//     Modified: 2008-10-21: /download/javascripts92_081021Revised.js
//     Modified: 2009-01-03: /download/javascripts92_090103Revised.js
//     Modified: 2009-02-22: /download/javascripts92_090222Revised.js
//     Modified: 2009-03-07: /download/javascripts92_090307Revised.js
//     Modified: 2009-05-08: /download/javascripts92_090508Revised.js
//     Modified: 2009-05-18: /download/javascripts92_090518Revised.js
//
//
//
//
//
/************************************************************************************/


/************************************************************************************/
//
// TO USE:
//
// Insert the following line of code into the heading of the
// html page which is going to be using the javascript contained in this file
//
// <SCRIPT LANGUAGE="javascript" SRC="http://www.homesmarketing.com/download/javascripts92.js"></SCRIPT>
//
// Remember to check the absolute or relative path, and filename as it may be
// renamed.
//
/************************************************************************************/


//<SCRIPT LANGUAGE="JAVASCRIPT">
//<!--- Begin Script

/************************************************************************************/
//
// Name: Various names
//
// Type:  function
//
// Purpose : For use in HQ Staff uploaded pages - Lookup coverage and Goto selected page.
//
//
/************************************************************************************/


    function browserWidthAdjustment()
    {
	    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) <= 3))
    	{
 		    //IE 3
 	    	alter = 15;
     	}
	    else
    	{
 		    // All others 15pix less than ie 3
 	    	alter = 0;
    	}
	    return alter;
    }


	function paloPopUp(id, url_to_open, sizeYY, sizeXX)
    {

        if (url_to_open == null)
        {
            url_to_open = "/popup.cgi?id=" + id;
        }

        var sizeY = 400;
        var sizeX = 420;

        if (sizeYY != null)
        {
            sizeY = sizeYY;
        }

        if (sizeXX != null)
        {
            sizeY = sizeXX;
        }

    	// do browser specific processing required to setup the new window properly
	    // use common function to do adjustment
    	alter = browserWidthAdjustment();

	    if (window.named && !(window.named.closed))
		      window.named.close();
    	// open the window
	    named=window.open (url_to_open, "slides", "statusbar=no,location=no,name=HelpPopUp,directories=no,scrollbars=yes,resizable=yes,menubar=no,toolbar=no,height=" + (sizeY - alter) + ",width=" + (sizeX) + "");
    	// all done, if you want to do anthing extra, like close the original window, you would do that here.

    }


    function gotoForSale()
    {
        goto_page = "/?search=sale";
        gotoPage();

    }

	function gotoForRent()
    {
        goto_page = "/?search=rent";
        gotoPage();

    }

    function gotoProducts()
    {
        goto_page = "/?search=bus";
        gotoPage();

    }


    function gotoAdvertisers()
    {
        goto_page = "/adserv/cust_ratelist.cgi";
        gotoPage();

    }


    function gotoAdvertisers212()
    {
        goto_page = "/download/y212cps2.html";
        gotoPage();

    }


    function gotoHome()
    {
        goto_page = "/";
        gotoPage();

    }


    function gotoPayBtns()
    {
        goto_page = "/download/uaa_passcode_3PayBtns.php";
        gotoPage();

    }


    function gotoREPSPC()
    {
        goto_page = "/download/rep_spcADV4_Buttons.php";
        gotoPage();

    }


    function gotoREPTEMP()
    {
        goto_page = "/download/rep_spcADV4_Buttons.html";
        gotoPage();

    }


    function gotoDOITFORME()
    {
        goto_page = "/download/uaa_doitforme_2BUTTONS.php";
        gotoPage();

    }



    function gotoREPVIP()
    {
        goto_page = "/download/rep_vipSTEP04_Buttons.html";
        gotoPage();

    }


    function gotoUXX1()
    {
        goto_page = "/download/uxx_switch1.php";
        gotoPage();

    }


    function gotoUXX2()
    {
        goto_page = "/download/uxx_switch2.php";
        gotoPage();

    }


    function gotoUXX3()
    {
        goto_page = "/download/uxx_switch3.php";
        gotoPage();

    }


    function gotoUXX4()
    {
        goto_page = "/download/uxx_switch4.php";
        gotoPage();

    }


    function gotoUXX5()
    {
        goto_page = "/download/uxx_switch5.php";
        gotoPage();

    }



    function gotoeditMyData()
    {
        goto_page = "/adserv/editprof.cgi";
        gotoPage();

    }


    function gotoPage()
    {
        var selectedValue = document.GOTO_AD.franchise_id[document.GOTO_AD.franchise_id.selectedIndex].value;
        if ((selectedValue != "" ) && (selectedValue != "NULL"))
        {
	    newPageIsLoading = true;
	    status = "Page is Loading... Pleae wait.";
            window.location.href = "/?goto_page=" + goto_page + "&franchise_id=" + selectedValue;
            if (cancelEvent == true)
            {
	        window.event.returnValue = false;
	    }
        }
    }


    function openLookUpRegions()
    {
        var selectedValue = document.GOTO_AD.franchise_id[document.GOTO_AD.franchise_id.selectedIndex].value;
        if ((selectedValue != "") && (selectedValue != "NULL"))
        {
            paloPopUp('', selectedValue + '/lookupCoverage.cgi');
        }
    }




function checkme() {
missinginfo = "";
if (!document.form.agree.checked) {
missinginfo += "\n - You must agree to the terms";
}
if (missinginfo != "") {
missinginfo ="- - - - - - - - - - - - - - - - - - - - - - - - - -\n" +
"Sorry but we could not process your\n" +
"request for the following reason(s):\n" +
missinginfo + "\n- - - - - - - - - - - - - - - - - - - - - - - - - -" +
"\nPlease complete and submit again.";
alert(missinginfo);
return false;
}
else {
return true;
}
}




//-->
//</SCRIPT>


