﻿
function searchDealers() {
    var f = document.forms["WhereToBuy"];
    if (f.elements["zipcode"].value != "") {
        var dealerType = (f.elements["dealerType"][0].checked)? "landscape":"masonry";
        //location.href = "/where-to-buy/default.aspx?zipcode=" + f.elements["zipcode"].value + "&dealerType=" + dealerType;
        location.href = "/where-to-buy/default.aspx?dealerType=" + dealerType + "&zipcode=" + f.elements["zipcode"].value;
    }
}

var prodWindow = null;
function printProduct(id) {
    var width = 600;
    var height = 500;
    var win_toolbar = "toolbar=" + "no";
    var win_width = "width=" + width;
    var win_height = "height=" + height;
    var win_left = "left=" + (screen.width - width) / 2;
    var win_top = "top=" + (screen.height - height) / 2;
    var win_status = "status=" + "yes";
    var win_location = "location=" + "no";
    var win_menubar = "menubar=" + "no";
    var win_scrollbars = "scrollbars=" + "yes";
    var win_resizable = "resizable=" + "no";
    var win_parameters = win_toolbar + "," + win_width + "," + win_height + "," + win_left + "," + win_top + "," + win_status + "," + win_location + "," + win_menubar + "," + win_scrollbars + "," + win_resizable;
    prodWindow = window.open("/print-ProductDetail.aspx?id="+id, 'ThisPage', win_parameters);
    if (!prodWindow.closed) { prodWindow.focus(); }    
}

function emailProduct() {
	var title = "";
	var body = "";
	title = document.title.replace(/&/g, "%26");
	body += "\n\n";
	body += "Link:\n";
	body += location.href;
	location.href = "mailto:?subject=Anchor%20Block%20Company:%20%20" + title + "&body=" + escape(body);
}

function emailPhoto(id) {
    var title = "Anchor Block Company: Photo";
	var body = "";
	body += "\n\n";
	body += "Link:\n";
	body += "http://www.anchorblock.com/photo-detail.aspx?id=" + id;
	location.href = "mailto:?subject=" + title + "&body=" + escape(body);
}

function hideProducts() {
	if (document.layers) {
		document.layers['ctl00_header_product_board'].visibility = "hide"
	} else if (document.all) {
		document.all['ctl00_header_product_board'].style.visibility = "hidden"
	} else if (document.getElementById) {
		document.getElementById('ctl00_header_product_board').style.visibility = "hidden"
	}
}

function showSelect() {
	if ($.browser.name == "msie" && $.browser.versionNumber == "6" && location.href.indexOf("/photo-gallery/") > -1) {
		$('#ctl00_cphBody_PhotoGallery_ddlProductName').show();
		$('#ctl00_cphBody_PhotoGallery_ddlProductType').show();
		$('#ctl00_cphBody_PhotoGallery_ddlProjectType').show();
		$('#ctl00_cphBody_PhotoGallery_ddlProjectType').show();
	}
}

function hideSelect() {
	if ($.browser.name == "msie" && $.browser.versionNumber == "6" && location.href.indexOf("/photo-gallery/") > -1) {
		$('#ctl00_cphBody_PhotoGallery_ddlProductName').hide();
		$('#ctl00_cphBody_PhotoGallery_ddlProductType').hide();
		$('#ctl00_cphBody_PhotoGallery_ddlProjectType').hide();
		$('#ctl00_cphBody_PhotoGallery_ddlProjectType').hide();
	}
}

function ListItem(Text, Value) {
	this.Text = Text;
	this.Value = Value;
}

var StatesList = new Array(
	new ListItem('Please Select...', ''),
	new ListItem('Alaska', 'Alaska'),
	new ListItem('Alabama', 'Alabama'),
	new ListItem('Arkansas', 'Arkansas'),
	new ListItem('Arizona', 'Arizona'),
//new ListItem('British Columbia', 'British Columbia'),
	new ListItem('California', 'California'),
	new ListItem('Colorado', 'Colorado'),
	new ListItem('Connecticut', 'Connecticut'),
//new ListItem('District of Columbia', 'District of Columbia'),
	new ListItem('Delaware', 'Delaware'),
	new ListItem('Florida', 'Florida'),
	new ListItem('Georgia', 'Georgia'),
	new ListItem('Hawaii', 'Hawaii'),
	new ListItem('Iowa', 'Iowa'),
	new ListItem('Idaho', 'Idaho'),
	new ListItem('Illinois', 'Illinois'),
	new ListItem('Indiana', 'Indiana'),
	new ListItem('Kansas', 'Kansas'),
	new ListItem('Kentucky', 'Kentucky'),
	new ListItem('Louisiana', 'Louisiana'),
	new ListItem('Massachusetts', 'Massachusetts'),
//new ListItem('Manitoba', 'Manitoba'),
	new ListItem('Maryland', 'Maryland'),
	new ListItem('Maine', 'Maine'),
	new ListItem('Michigan', 'Michigan'),
	new ListItem('Minnesota', 'Minnesota'),
	new ListItem('Missouri', 'Missouri'),
	new ListItem('Mississippi', 'Mississippi'),
	new ListItem('Montana', 'Montana'),
//new ListItem('New Brunswick', 'New Brunswick'),
	new ListItem('North Carolina', 'North Carolina'),
	new ListItem('North Dakota', 'North Dakota'),
	new ListItem('Nebraska', 'Nebraska'),
	new ListItem('New Hampshire', 'New Hampshire'),
	new ListItem('New Jersey', 'New Jersey'),
//new ListItem('Newfoundland and Labrador', 'Newfoundland and Labrador'),
	new ListItem('New Mexico', 'New Mexico'),
//new ListItem('Nova Scotia', 'Nova Scotia'),
//new ListItem('Northwest Territories', 'Northwest Territories'),
//new ListItem('Nunavut', 'Nunavut'),
	new ListItem('Nevada', 'Nevada'),
	new ListItem('New York', 'New York'),
	new ListItem('Ohio', 'Ohio'),
	new ListItem('Oklahoma', 'Oklahoma'),
//new ListItem('Ontario', 'Ontario'),
	new ListItem('Oregon', 'Oregon'),
	new ListItem('Pennsylvania', 'Pennsylvania'),
//new ListItem('Prince Edward Island', 'Prince Edward Island'),
//new ListItem('Quebec', 'Quebec'),
	new ListItem('Rhode Island', 'Rhode Island'),
	new ListItem('South Carolina', 'South Carolina'),
	new ListItem('South Dakota', 'South Dakota'),
//new ListItem('Saskatchewan', 'Saskatchewan'),
	new ListItem('Tennessee', 'Tennessee'),
	new ListItem('Texas', 'Texas'),
	new ListItem('Utah', 'Utah'),
	new ListItem('Virginia', 'Virginia'),
	new ListItem('Vermont', 'Vermont'),
	new ListItem('Washington', 'Washington'),
	new ListItem('Wisconsin', 'Wisconsin'),
	new ListItem('West Virginia', 'West Virginia'),
	new ListItem('Wyoming', 'Wyoming')
//new ListItem('Yukon', 'Yukon')
);

if ($.browser.name == "msie" && $.browser.versionNumber == "6") {
	$(document).ready(function() {
		$('.callout').css('margin', '0px 0px 5px 0px');
		$('.callout').css('padding', '15px 15px 15px 15px');
		$('.callout').css('height', '137px');
		$('.callout-spacer').hide();		
	});
}

if ($.browser.name == "msie" && $.browser.versionNumber == "6") {
	$(document).ready(function() {
		$('.callout').css('margin', '0px 0px 5px 0px');
		$('.callout').css('padding', '15px 15px 15px 15px');
		$('.callout').css('height', '137px');
		$('.callout-spacer').hide();
	});
}

if ($.browser.name == "firefox") {
	$(document).ready(function() {
		$('.callout').css('margin', '0px 0px 5px 0px');
		$('.callout').css('padding', '15px 15px 15px 15px');
		$('.callout').css('height', '120px');
		$('.callout-spacer').hide();
	});
}

if ($.browser.name == "safari") {
	$(document).ready(function() {
		$('.callout').css('margin', '0px 0px 5px 0px');
		$('.callout').css('padding', '15px 15px 15px 15px');
		$('.callout').css('height', '136px');
		$('.callout-spacer').hide();
	});
}

function showProducts() {
//Disable per client 6/5/2009
/*
	if (document.layers) {
		document.layers['ctl00_header_product_board'].visibility = "show"
	} else if (document.all) {
		document.all['ctl00_header_product_board'].style.visibility = "visible"
	} else if (document.getElementById) {
		document.getElementById('ctl00_header_product_board').style.visibility = "visible"
	}
	hideSelect();
*/
}

function hideProducts() {
	if (document.layers) {
		document.layers['ctl00_header_product_board'].visibility = "hide"
	} else if (document.all) {
		document.all['ctl00_header_product_board'].style.visibility = "hidden"
	} else if (document.getElementById) {
		document.getElementById('ctl00_header_product_board').style.visibility = "hidden"
	}
	showSelect();
}

function swapLiBg(id) {
	$('#' + id + '').css('background-image', 'url(/themes/01/images/main-nav-li-brown.jpg)');
	$('#' + id + ' a').css('color', '#ffffff');
	$('#' + id + '_arrow').css('visibility', 'visible');
	if (id == 'ctl00_header_mn5') {
		$('#ctl00_header_mn5').css('background-image', 'url(/themes/01/images/main-nav-li-fp-05415d.jpg)');
		$('#ctl00_header_mn5_arrow').attr('src', '/themes/01/images/main-nav-li-arrow-blue-right-05415d.jpg');
	}
	if (id == 'ctl00_header_mn1') {
		$('#ctl00_header_mn1').css('height', '35px');
	}
}

function restoreLiBg(id) {
	$('#' + id + '').css('background-image', 'url(/themes/01/images/main-nav-li-silver.jpg)');
	$('#' + id + ' a').css('color', '#3d3013');
	$('#' + id + '_arrow').css('visibility', 'hidden');

	if (id == 'ctl00_header_mn5') {
		$('#ctl00_header_mn5').css('background-image', 'url(/themes/01/images/main-nav-li-fp-006595.jpg)');
		$('#ctl00_header_mn5').css('background-color', '#05415d');
		$('#ctl00_header_mn5 a').css('color', '#ffffff');
		$('#ctl00_header_mn5_arrow').css('visibility', 'visible');
		$('#ctl00_header_mn5_arrow').attr('src', '/themes/01/images/main-nav-li-arrow-white-right.jpg');
	}
}

$(document).ready(function() {
	if (location.href.indexOf("/products/") > -1 || location.href == "http://abc.bolindigital.com/" || location.href == "http://www.anchorblock.com") {
		$('#ctl00_header_mn1').css('background-image', 'url(/themes/01/images/main-nav-li-brown.jpg)');
		$('#ctl00_header_mn1').css('height', '35px');
		$('#ctl00_header_mn1 a').css('color', '#ffffff');
		$('#ctl00_header_mn1_arrow').css('visibility', 'visible');

	} else if (location.href.indexOf("/photo-gallery/") > -1) {
		$('#ctl00_header_mn2').css('background-image', 'url(/themes/01/images/main-nav-li-brown.jpg)');
		$('#ctl00_header_mn2').css('height', '35px');
		$('#ctl00_header_mn2 a').css('color', '#ffffff');
		$('#ctl00_header_mn2_arrow').css('visibility', 'visible');
		
	} else if (location.href.indexOf("/literature/") > -1) {
		$('#ctl00_header_mn3').css('background-image', 'url(/themes/01/images/main-nav-li-brown.jpg)');
		//$('#ctl00_header_mn3').css('height', '35px');
		$('#ctl00_header_mn3 a').css('color', '#ffffff');
		$('#ctl00_header_ns').css('visibility', 'hidden');
		$('#ctl00_header_mn3_arrow').css('visibility', 'visible');
		$('#containerHeader').css('height', '121px');
		$('#ctl00_header_ns').css('visibility', 'hidden');
	
	} else if (location.href.indexOf("/where-to-buy/") > -1) {
		$('#ctl00_header_mn4').css('background-image', 'url(/themes/01/images/main-nav-li-brown.jpg)');
		//$('#ctl00_header_mn3').css('height', '35px');
		$('#ctl00_header_mn4 a').css('color', '#ffffff');
		$('#ctl00_header_mn4_arrow').css('visibility', 'visible');
		$('#containerHeader').css('height', '121px');
		$('#ctl00_header_ns').css('visibility', 'hidden');
	
	} else if (location.href.indexOf("/for-professionals/") > -1) {
		$('#ctl00_header_mn5').css('background-image', 'url(/themes/01/images/main-nav-li-fp-05415d.jpg)');
		$('#ctl00_header_mn5_arrow').attr('src', '/themes/01/images/main-nav-li-arrow-blue-bottom-05415d.jpg');
		$('#ctl00_header_mn5').css('height', '35px');
		//$('#ctl00_header_mn5').css('z-index', '-1');
		$('#ctl00_header_mn5').css('background-color', '#05415d');
		$('#ctl00_header_mn5 a').css('color', '#ffffff');
		$('#ctl00_header_mn5_arrow').css('visibility', 'visible');
		$('#ctl00_header_ns').css('background-color', '#05415d');
	}
});
	
