/* Exyst Custom */
$(document).ready(function() {
	if ( $("#home_msg_wrapper").length > 0 ) { 
		$('#home_msg_wrapper').cycle({fx:'fade', timeout:5000, cleartype: 1, pause: 0});
	}
	
  $('a.popup').click(function(){
    window.open($(this).attr('href'));
    return false;
  });
	// dealer locatoer
	if ( $("#ex_dealer_locator").length > 0 ) { 
		$("#dl_results").hide();
		// hijack form
		$("#dl_submit_dl_form").click(function(){
			$("#dl_results").fadeIn();
			ZIP = document.getElementById('zip').value;
			RADIUS = document.getElementById('radius').value;
			$("#dl_results").load("http://www.standoffsystems.com/dealer_locator/dealer_locator.php?zip="+ZIP+"&radius="+RADIUS);
			return false;
		});
	}
});
function myHide(obj)
{
	$("#"+obj).hide();
	return false;
}
/*
function showHide(myAnchor, myObj)
{
	var myObj = "#"+myObj;
	var myAnchor = "#"+myAnchor;
	$(".ex_icon_popup").hide();
	$(myObj).show();
	
	// position popup next to the anchor that requested it
	var p = $("#ex_icon_nav").position();
	var p2 = $(myAnchor).position(); 
	var myTop = p.top - $(myObj).height();
	var myLeft = p.left + p2.left;
	$(myObj).css({
		top: myTop,
		left: myLeft
	});
	
	// if popup is out side of site frame move it back inside

	var o = $(myObj).offset();
	var objLeft = o.left;
	var objWidth = $(myObj).width();
	var bodyWidth = $('body').width();
	if ((objWidth + objLeft + 50) > bodyWidth)
	{
		var overlap = ( objWidth + objLeft ) - bodyWidth;
		$(myObj).css({
			left: objLeft - overlap - 50
		});
	}
}
*/
	
//pic1= new Image(); 
//pic1.src="/catalog/skin1/custom/i/ex_info.png"; 
	
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
