	if (document.images) {
			window.name = "BendixWindow";
			window.focus();
	}	
	
	
	/* ******************************************************************************* */	
	
	function siteMap() {
		sitemap = window.open('../sitemap/index.php', 'sitemap', "scrollbars=yes,width=750,height=500");
		sitemap.focus();
	}

	/* ******************************************************************************* */
	
	function joinNewsletter() {
		Newsletter = window.open('/newsletter/index.php', 'Newsletter', "scrollbars=no,width=750,height=465");
		Newsletter.focus();
	}

	/* ******************************************************************************* */
	
	function getSearch(form)
	{
		window.open('/search2/search.php?search=1&query='+searchForm.key.value, 'l', "scrollbars=yes,resizable=yes,location=no,toolbar=no,width=785").focus();
		//alert("The search feature will be activated soon.");
	}

	/* ******************************************************************************* */		
			
	function enlargeView(file)
	{
		window.open(file, 'enlargedView', "scrollbars=auto,width=825,height=625,top=0,left=0");
	}

	/* ******************************************************************************* */
	
	function contactPage() {
		window.open('/contact.php', 'contact', "scrollbars=yes,resizable=yes,location=no,toolbar=no,height=500,width=700").focus();
	}

	/* ******************************************************************************* */	
	
	function getPressRelease(year,article)
	{
		window.open('/company/press.php?year='+year+'&article='+article, 'l', 
			"scrollbars=yes,resizable=yes,location=no,toolbar=no,height=625,width=700").focus();
	}

	/* ******************************************************************************* */	
	function openWin(url, w, h, resize,tools,loc,scrollb) {
		window.open(url, 'popup', 'resizable='+resize+',location='+loc+',toolbar='+tools+',width='+w+',height='+h+',scrollbars='+scrollb).focus();

	}
	/* ******************************************************************************* */	


	<!--
	
	function newImage(arg) {
		if (document.images) {
			rslt = new Image();
			rslt.src = arg;
			return rslt;
		}
	}
	
	/* ******************************************************************************* */
	
	function openWTB(product) {
		if (product != "") {
			window.open('/products/whereToBuy.php?product=' + product, 'popup', 'location=0,menubar=0,titlebar=0,scrollbars=yes,resizable=yes,width=815,height=710');
		}
	}
	
	
	
	/* ******************************************************************************* */
	
	function changeImages() {
		if (document.images && (preloadFlag == true)) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}
	
	/* ******************************************************************************* */
	
	function heroAnimation() {
		openWin('/hero/pop.php?b=fram', '720', '375', 'no', 'no', 'no', 'no');
	}
	
	var preloadFlag = false;
	function preloadImages() {
		if (document.images) {
			menuHome_over = newImage("/images/menuHome_on.jpg");
			menuProducts_over = newImage("/images/menuProducts_on.jpg");
			menuPartsCat_over = newImage("/images/menuPartsCat_on.jpg");
			menuMyGarage_over = newImage("/images/menuMyGarage_on.jpg");
			menuCarCare_over = newImage("/images/menuCarCare_on.jpg");
			menuCompany_over = newImage("/images/menuCompany_on.jpg");
			menuMotorSports_over = newImage("/images/menuMotorSports_on.jpg");
			preloadFlag = true;
		}
	}
	
	/* ******************************************************************************* */
	function toggleVisibile(div) {
		var toggle = document.getElementById(div);
		if(toggle.style.display == 'none') {
			toggle.style.display = '';
		} else {
			toggle.style.display = 'none';
		}
	}
	/* ******************************************************************************* */	
	function makeVisible(div) {
		var toggle = document.getElementById(div);
		toggle.style.display = '';
	}
	/* ******************************************************************************* */	
	
	
	
	
	function init()
	{
		preloadImages();
		homeButtons();
	}
	
	var menuY    		= 77;
	productsMenu    	= new AnimatedMenu("productsMenu", "down", 235, menuY, 150, 120);
	partsCatalogMenu    = new AnimatedMenu("partsCatalogMenu", "down", 315, menuY, 145, 120);
	techCornerMenu		= new AnimatedMenu("techCornerMenu", "down", 377, menuY, 100, 120);
	//promotionsMenu  	= new AnimatedMenu("promotionsMenu", "down", 465, menuY, 100, 120);
	companyMenu			= new AnimatedMenu("companyMenu", "down", 551, menuY, 100, 120);
	motorSportsMenu		= new AnimatedMenu("motorSportsMenu", "down", 620, menuY, 145, 120);
	
function clearTextBox(txtbox, origValue) {		
	if(document.frmMainForm.tbInstlrZipCode.value == origValue) {
		document.frmMainForm.tbInstlrZipCode.value ="";
	}
}

//alert messages specific to locators
var strInstlrZipAlert = 'Please enter the zip code for locating Technicians';
var strRtlrZipAlert = 'Please enter the zip code for locating Retailers';
var strZipCodeFormatAlert = 'Please enter only numbers for ZipCode';
var strZipLengthAlert		= "Please enter a 5-digit Zip Code";

/**
*   This function is used to submit a form after checking mandatory fields
*
*   @param strFormName String contains the form name to be submitted.
*   @param strAction String contains the Action Id
*   @param strScreenId String contains the Screen Id.
*   @returns boolean
*/
function instlrLocatorFormSubmit()
{
	if (trim(document.frmMainForm.tbInstlrZipCode.value) == "")
    {
        alert(strInstlrZipAlert);
        document.frmMainForm.tbInstlrZipCode.focus();
        return false;
    }

    if (!isNumber(trim(document.frmMainForm.tbInstlrZipCode.value)))
    {
		alert(strZipCodeFormatAlert);
		document.frmMainForm.tbInstlrZipCode.focus();
		return false;
	}
	if(trim(document.frmMainForm.tbInstlrZipCode.value).length < 5)
	{
		alert(strZipLengthAlert);
		document.frmMainForm.tbInstlrZipCode.focus();
		return false;
	}

    userPopUp('Installer', document.frmMainForm.tbInstlrZipCode.value,1001,5)
    return false;
}

/**
*   This function is used to submit a form after checking mandatory fields
*
*   @param strFormName String contains the form name to be submitted.
*   @param strAction String contains the Action Id
*   @param strScreenId String contains the Screen Id.
*   @returns boolean
*/
function rtlrLocatorFormSubmit()
{
	if (trim(document.frmMainForm.tbInstlrZipCode.value) == "")
    {
		alert(strRtlrZipAlert);
        document.frmMainForm.tbInstlrZipCode.focus();
        return false;
    }

    if (!isNumber(trim(document.frmMainForm.tbInstlrZipCode.value)))
	{
		alert(strZipCodeFormatAlert);
		document.frmMainForm.tbInstlrZipCode.focus();
		return false;
	}
	if(trim(document.frmMainForm.tbInstlrZipCode.value).length < 5)
	{
		alert(strZipLengthAlert);
		document.frmMainForm.tbInstlrZipCode.focus();
		return false;
	}

	userPopUp('Retailer', document.frmMainForm.tbInstlrZipCode.value,1001,5)
    return false;
}


/**
*   Function to check if the entered value is Numeric and positive integer
*   @param strVal String is the input values
*   @return boolean
*/
function isNumber(strValue)
{
    var strChar;
    var intLen = strValue.length;
    for (var i=0; i<intLen; i++)
    {
        strChar = strValue.charAt(i);
        if (strChar < "0" || strChar > "9")
        {
            return false;
        }
    }
    return true;
}

/**
*   Function to trim leading and trailing blan spaces
*   @param strValue String is the input values
*   @return strValue String after removing blanks
*/
function trim(strValue)
{
    var strValue    = ''+strValue;
    var startIndex  = 0;
    var endIndex    = 0;
    for (startIndex=0; strValue.length > startIndex && (strValue.charAt(startIndex) == ' ' || strValue.charCodeAt(startIndex) == 32);startIndex++);
    for (endIndex = strValue.length - 1; endIndex > startIndex && (strValue.charAt(endIndex) == ' '  || strValue.charCodeAt(endIndex) == 32); endIndex--);
    return strValue.substring(startIndex,endIndex+1);
}

/**
*   This function is used to display pop up window
*   @param String strScreenId
*   @param String strAction
*   @returns boolean
*/
function userPopUp(strCategory, strZipCode, hdScreenId, hdAction)
{
	//URL for Locator module
	//var strLink = 'http://10.252.1.36/proj1/bbrc/jsp/Index.jsp';
	var strLink = 'http://www.bendixbprp.com/bbrc/jsp/Index.jsp';

	strLink = strLink + '?hdCategory='+strCategory+'&hdZipCode='+strZipCode+'&hdScreenId='+hdScreenId+'&hdAction='+hdAction;
	var winpop = "toolbar=1,location=0,directories=0,status=1, " + ",left=50,top=50,menubar=1,scrollbars=1,resizable=1,width=780,height=400";
    testwindow= window.open (strLink,"accept",winpop);
    //window.location.href=strLink;
    return false;
}



/* ********************************************************************************* */

/* HOME PAGE BUTTON POPUPS */

function homeButtons () {

	$('#homeMain #btn_5 a').click(
		function (){
			var href = $(this).attr('href');
			
			var newWindow = window.open(href,'newWin','width=750,height=450,left=0,top=0,toolbar=No,location=No,status=No,resizable=yes,scrollbars=yes,fullscreen=No');  
			newWindow.focus();
			
			return false;
		}
	);
	
}

