
/*-----------------------------------------------------------------------------------------------------------
  main.js - method/browser check
------------------------------------------------------------------------------------------------------------*/

if(!document.getElementById)
{
  document.location.replace("nonw3c_browser.html")//pre IE5 and N6 send to landing page
}

/*-----------------------------------------------------------------------------------------------------------
  global variables
------------------------------------------------------------------------------------------------------------*/
var login=false;
var selectedNav="";

/*-----------------------------------------------------------------------------------------------------------
  nav mouse events
------------------------------------------------------------------------------------------------------------*/

function navOver(oTarget) //nav mouseover events
{
  var x=document.getElementById(oTarget);
	x.src="/site/img/nav_"+oTarget+"_s.gif";
}

function navOut(oTarget) //nav mouseout events
{
	var x=document.getElementById(oTarget);
	if(oTarget==selectedNav)
	{
		//do nothing
	}
	else if(oTarget=="bn")
	{
		x.src="/site/img/nav_"+oTarget+"_grey.gif";
	}
	else
	{
		x.src="/site/img/nav_"+oTarget+".gif";
	}
}

function snovr(oTarget) //subnav mouseover events
{
  oTarget.style.color='#ffffff';
  oTarget.style.backgroundColor='#D7B35A'; //ba9b4e
  oTarget.style.cursor='hand';
}

function snout(oTarget) //subnav mouseout events
{
  oTarget.style.color='#373737';
  oTarget.style.backgroundColor='#ffffff';
}

function bnovr(oTarget) //birdseednav mouseover events
{
  oTarget.style.color='#f7f7d8';
  oTarget.style.backgroundColor='#ba9b4e';
  oTarget.style.cursor='hand';
}

function bnout(oTarget) //birdseednav mouseout events
{
  oTarget.style.color='#999999';
  oTarget.style.backgroundColor='#373737';
}

function provr(oTarget) //press release mouseover events
{
  oTarget.style.color='#ffffff';
  oTarget.style.backgroundColor='#009933';
  oTarget.style.cursor='hand';
}

function prout(oTarget) //press release mouseout events
{
  oTarget.style.color='#333333';
  oTarget.style.backgroundColor='#ffffff';
}

function storyOvr(oTarget) //story mouseover events
{
  oTarget.style.backgroundColor='#ffffcc';
  oTarget.style.cursor='hand';
  oTarget.style.borderColor='#cc9900';
  oTarget.style.borderWidth='1px';
  oTarget.style.borderStyle='solid';
}

function storyOut(oTarget) //story mouseout events
{
  oTarget.style.backgroundColor='#ffffff';
  oTarget.style.borderColor='#ffffff';
  oTarget.style.borderWidth='1px';
  oTarget.style.borderStyle='solid';
}

function cartNavOvr2(oTarget)//replace cart nav mouseover events
{
  oTarget.style.cursor='hand';
  oTarget.style.borderColor='#DCC246';
  oTarget.style.borderWidth='1px';
  oTarget.style.borderStyle='solid';
}

function cartNavOut2(oTarget)//replace cart nav mouseout events
{
  oTarget.style.borderColor='#373737';
  oTarget.style.borderWidth='1px';
  oTarget.style.borderStyle='solid';
}

function logo()//for buy now rollover
{
	var x=document.getElementById("logobanner");
	x.style.backgroundImage='url(/site/img/logobar_background_roll.gif)';
}

function logoOut()//for buy now rollover
{
	var x=document.getElementById("logobanner");
	x.style.backgroundImage='url(/site/img/logobar_background.gif)';
}

/*-----------------------------------------------------------------------------------------------------------
  utility functions
------------------------------------------------------------------------------------------------------------*/

function imgCache()
{
	ticN=new Image;
	ticN.src="/site/img/nav_tic.gif";
	ticS=new Image;
	ticS.src="/site/img/nav_tic_s.gif";
	ssN=new Image;
	ssN.src="/site/img/nav_ss.gif";
	ssS=new Image;
	ssS.src="/site/img/nav_ss_s.gif";
	bnN=new Image;
	bnN.src="/site/img/nav_bn.gif";
	bnS=new Image;
	bnS.src="/site/img/nav_bn_s.gif";
	chN=new Image;
	chN.src="/site/img/nav_ch.gif";
	chS=new Image;
	chS.src="/site/img/nav_ch_s.gif";
	naeN=new Image;
	naeN.src="/site/img/nav_nae.gif";
	naeS=new Image;
	naeS.src="/site/img/nav_nae_s.gif";
	cN=new Image;
	cN.src="/site/img/nav_c.gif";
	cS=new Image;
	cS.src="/site/img/nav_c_s.gif";
	logobar_roll=new Image;
	logobar_roll.src="/site/img/logobar_background_roll.gif";
}

function mailer(oName,oDomain)
{
	email="mailto:"+oName+"@"+oDomain;
	window.location=email;
}

function selectNav(oTarget)
{
	var z=document.getElementById("bn");
	var x=document.getElementById(oTarget);
	if(selectedNav=="")
	{
		z.src="/site/img/nav_bn_grey.gif";
		x.src="/site/img/nav_"+oTarget+"_s"+".gif";
	}
	else
	{
		z.src="/site/img/nav_bn_grey.gif";
		var y=document.getElementById(selectedNav);
		y.src="/site/img/nav_"+selectedNav+".gif";
		x.src="/site/img/nav_"+oTarget+"_s"+".gif";
	}
	selectedNav=oTarget;
}

function toggleBlurb(oTarget)
{
	var x=document.getElementById(oTarget);
	if(x.style.display=='none')
	{
		x.style.display='block';
	}
	else
	{
		x.style.display='none';
	}
}

function newWindow(oPage,oName,oWidth,oHeight,oScroll,oResize)
{
  var win=null;
  LeftPosition = (screen.width) ? (screen.width-oWidth)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-oHeight)/2 : 0;
  settings='height='+oHeight+',width='+oWidth+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+oScroll+',resizable='+oResize;
  win = window.open(oPage,oName,settings);
  win.focus();
}