﻿// JavaScript File
function openlargeimgwin(title,largerimage)
{		
	var myRegExp = /&/g;
	var newtitle = title.replace(myRegExp, "and");
	var myurl = "largerpic.aspx?t="+newtitle+"&lpic="+largerimage;
	var mywin = window.open(myurl, 'bpicwin', 'personalbar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,alwaysRaised=yes,width=400,height=300');
	mywin.moveTo(0,0);
	mywin.focus();
}	

function loadPrices(val) {
	document.prodform.country.value = val;
	document.prodform.submit();
} // end loadProces

function showMessage()
{
	var msg = 'Our online store is temporarily unavailable.' + '\n\n' + 'Please contact Crossbow sales at sales@xbow.com or at 1-800-926-9832';
	alert(msg);
}

function FocusPrices()
{
	
	if(document.aspnetForm.ctl00$AllContent$country_list != null)
	{
		document.aspnetForm.ctl00$AllContent$country_list.focus();
		document.aspnetForm.ctl00$AllContent$country_list.selectedIndex = 0;
	}
	
	if(document.getElementById('ctl00_AllContent_bdtable') != null)
	{
		var tablebgcolor =  '#F9F0C5';//'#000000';
		var tbl = document.getElementById('ctl00_AllContent_bdtable');
		tbl.style.backgroundColor = tablebgcolor;
		tbl.style.border = 5;
	}
	
	
	
	/*if(document.getElementById('bd1table') != null)
	{
		var tablebgcolor =  '#7E96B5';//'#000000';
		var tbl = document.getElementById('bd1table');
		tbl.style.backgroundColor = tablebgcolor;
	} */


	document.location.href="#pricebox";
}

/*function getHeight()
{
    h = document.getElementById("Content").offsetHeight;
    if (h < 500)
        document.getElementById("Content").style.height = "500px";
}*/

function getHeight2()
{
    h = document.getElementById("Content").offsetHeight;
    if (h < 500)
        document.getElementById("Content").style.height = "500px";
}

function getHeight3()
{
    h = document.getElementById("Content").offsetHeight;
    if (h < 500)
        document.getElementById("Content").style.height = "500px";
}


function getHeight()
{
	var box = new Array("Content"); //list of DIV ids
	for(x=0;x<box.length;x++){ //determine the tallest div
		h = document.getElementById(box[x]).offsetHeight;
		for(y=0;y<box.length;y++){
		test_h = document.getElementById(box[y]).offsetHeight;
		if(h<test_h) h = test_h; 
		}  
	}
	if (h < 500)
        document.getElementById("Content").style.height = "500px";
    else
    {
		for(x=0;x<box.length;x++) document.getElementById(box[x]).style.height = h +"px"; //set the height of all divs to the tallest
	}
	
}