function gotoURL(pUrl,indexNum) {

		if (pUrl != '') { 
			url = new String(pUrl);
			window.location.href = url;
	}
}

/*
--------------------------------------------------------
Search
--------------------------------------------------------
*/

function postSearch(searchStr){
	document.mainform.method="post";
	document.mainform.action="/search.aspx?search=" + searchStr;
	document.mainform.submit();

}



function checkEnter(e,caller) //e is event object passed from function invocation
{

	var characterCode //literal character code will be stored in this variable

	if(e && e.which)
	{ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else
	{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}

	if(characterCode == 13)//if generated character code is equal to ascii 13 (if enter key)
	{ 
		document.getElementById(caller).click();
		return false
	}
	else
	{
		return true
	}
}


//window.attachEvent('onload', resizeContent);

function changeProdImg(group){
	group = "/images/_testPics/GD930.jpg";
	document.getElementById("productGroupImg").src = group;
	document.getElementById("productGroupImg").className = "productSmall";
	document.getElementById("productGroupImg").align = "right";
	}

/*
Change Picture (Product Introduction page)
*/

function changePicture(src){
	var path = src;
	var image = '<img src='+path+' alt="" class="" />';
	document.getElementById('productImage').innerHTML = image;
}


function changeVideo(src,duration){
	var requiredVersion = 7;
	
	var totalTime	= duration;
	var path		= src;
	// WindowsMedia var video = '&#160;<object width="240" height="320" id="NSPlay" classid="CLSID:2179C5D3-EBFF-11CF-B6FD-00AA00B4E220" codebase="http://www.microsoft.com/netshow/download/en/nsmp2inf.cab#Version= 5,1,51,415" standby="Loading Microsoft Media Player components..." type="application/x-oleobject"><param name="FileName" value="'+src+'" /><param name="ShowControls" value="true" /><param name="ShowDisplay" value="true" /><param name="ShowStatusBar" value="true" /><param name="AutoSize" value="true" /><embed width="240" height="320" src="'+src+'"  showstatusbar="true" type="video/x-ms-wmv" showcontrols="true" showdisplay="true" pluginspage="http://www.microsoft.com/netshow/download/player.htm"></embed></object>';
	if (flashVersion >= requiredVersion) {
	
	var video = '&#160;<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"  width="266" height="280" id="flashvideo" align="middle" VIEWASTEXT><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/images/video.swf?video='+src+'&duration='+totalTime+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="/images/video.swf?video='+src+'&duration='+totalTime+'" quality="high" bgcolor="#ffffff"  width="266" height="280" name="flashvideo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	}
	else{
	
	var video = '<div style="width:240px; height:240px; text-align:center;"><a href="http://www.macromedia.com/go/getflashplayer"><img src="/images/get_flashplayer.gif" width="88" height="31" border="" alt="" /></a></div>';
	}
	//'<img id="productPicture" src='+path+' alt="" class="" />';
	document.getElementById('productMedia').innerHTML = video;
	
	
/*
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="280" id="gd2000" align="middle" VIEWASTEXT>
			<param name="allowScriptAccess" value="sameDomain" />
			<param name="movie" value="gd2000.swf?video=Comp 1.flv" />
			<param name="quality" value="high" />
			<param name="bgcolor" value="#ffffff" />
			<embed src="gd2000.swf?video=GD2000d.flv" quality="high" bgcolor="#ffffff" width="320" height="280" name="gd2000" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
*/
}

// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)


function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;
function getFlashVersion() {
	var latestFlashVersion = 8;
   var agent = navigator.userAgent.toLowerCase(); 
	
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
      
   }
		
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}

	return flashVersion;
}

flashVersion_DONTKNOW = -1;

var flashVersion = getFlashVersion();



// country dropdown
sfHover = function() {
if(document.getElementById("navlist")){
	var sfEls = document.getElementById("navlist").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function openProductComparison(){
	window.open('/Modules/Product Comparison/ProductComparison.aspx','productComparator', 'width=890,height=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes');
}

/*
	The Worldmap
*/

function showContinent(continent) {
	document.getElementById(continent).style.visibility = "visible";
	hideOthers(continent);
}
function hideOthers(continent) {
	elem = document.getElementById('pics');	
	elems = elem.getElementsByTagName('div');	
	for (var i = 0; i < elems.length; i++) {
		if (elems[i].id != continent && elems[i].id != 'pics' && elems[i].id != 'world') {
			//alert(elems[i].id);
			elems[i].style.visibility = "hidden";
		}
	}
}

function showMapList(list) {	
	elem = document.getElementById('maplists');
	elems = elems = elem.getElementsByTagName('div');
	for (var i = 0; i < elems.length; i++) {
		if (elems[i].id != 'maplists') {
			elems[i].style.display = "none";
		}
	}
	theelem = document.getElementById(list);
	if (theelem) {
		theelem.style.display = "block";
	}	
}

/*
/	The Worldmap
*/


/*Product comparator*/

function checkAndCompare(itm){
	
	
	//var showCol document.getElementById(itm);
	
	if(document.forms[0].comparator){
	var max = document.forms[0].comparator.length;
	var totalChecked = 0;
	var areaWidth = 440;
	
	// loop through checkboxes
	for (var idx = 0; idx < max; idx++) {
		
		document.forms[0].comparator[idx].disabled = false;
		document.getElementById("label"+document.forms[0].comparator[idx].value).style.color = "Black";
		
		var tdID = document.getElementById("col"+document.forms[0].comparator[idx].value);
		
		
		// count actives
		if (eval("document.forms[0].comparator[" + idx + "].checked") == true) {
			totalChecked += 1;
			if(document.all){
			tdID.style.display = "block";
			}
			else{
			tdID.style.display = "table-cell";
			}
			
			
		}
		else{
		
			tdID.style.display = "none";
		
		}
		
	}
	
	
	}
	// loop again and put nice width for td's
	for (var idx = 0; idx < max; idx++) {
	var tdID = document.getElementById("col"+document.forms[0].comparator[idx].value);
		var tdID = document.getElementById("col"+document.forms[0].comparator[idx].value);
		var tblID = document.getElementById("tbl"+document.forms[0].comparator[idx].value);
		if(tdID.style.width){
			tdID.style.width = (areaWidth/totalChecked)-2+"px";
			tblID.style.width = (areaWidth/totalChecked)-2+"px";
		}
	}
	
	if(totalChecked > 2){
		disableUnChecked();
	}
}
function disableUnChecked(){
var max = document.forms[0].comparator.length;

	for (var idx = 0; idx < max; idx++) {
	if (eval("document.forms[0].comparator[" + idx + "].checked") != true) {
		document.forms[0].comparator[idx].disabled = true;
		document.getElementById("label"+document.forms[0].comparator[idx].value).style.color = "Gray";
	}
	
	}

}


/**

 {
	window.onload = init;

}

function init() {

	// Resize yellow left column to fill at least height of left menu
	var leftMenuH = document.getElementById("leftcol").offsetHeight;
	var contentH = document.getElementById("contentWide").offsetHeight;
	var leftContent = document.getElementById("contentLeft");

	if(leftMenuH>contentH){

		leftContent.style.height = leftMenuH+"px";
	}
	window.onload = init; {
	
	}
}

**/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function FindDealer(resultLink,value)
{
	window.location = resultLink + "?zipCode=" + value;
}
function FindDealerButton(resultLink,sender)
{

        var e = window.event;
		if (e.keyCode == 13)
		{

			e.returnValue = false;
			e.cancel = true;
			var obj = MM_findObj(sender);
			FindDealer(resultLink,obj.value);
		}

}