// JavaScript Document
function openWindow(location, windowName, settings) {
	window.open(location,windowName,settings);
	return false;
}

function setBrochureWindow() {
	window.resizeTo(600,600);
	window.moveTo(0,0);
	window.focus();
	return false;	
}

function openWin() {
window.open("/top10_movie.html","Top_Ten_Reasons","width=380, height=342, top=0, left=0, toolbar=0, menubar=0, location=0, status=1, scrollbars=1, resizable=1");

}

function demoPop() {
//opens the JMA Connect Demo and keeps focus
	newWindow = window.open("/images/eToolFlash/etools.html","eToolDemo","width=760, height=450, top=0, left=0, toolbar=0, menubar=0, location=0, status=1, scrollbars=1, resizable=1");
	newWindow.focus();
}

////////////////////////////////////////////////////////////////////////////////////////////////////
//What follows are the functions needed for the dynamic display functionality on the product pages//
////////////////////////////////////////////////////////////////////////////////////////////////////

function hideGroup(id, maximum, picId, picOff){
//Hides a group of elements and changes the state of the associated arrows
  var itemId; 
  for (var i = 1; i <= maximum; i++){
	  if (document.getElementById){
	    itemId = id+i;
		obj = document.getElementById(itemId); 
		obj.style.display = "none";
		document.images[picId+i].src = 'images/arrows/' + picOff; 
	  } 
  }
}

function hideGroupExcept(id, number, maximum, picId, picOff, picOn){
//Hides a group of elements except the one referenced by id and changes the state of the associated arrows
  var selectedItemId = id+number;
 
  //alert(selectedItemId);
  for (var i = 1; i <= maximum; i++){
	  itemId = id+i;
	  if (itemId == selectedItemId){
	  var obj = document.getElementById(itemId);
			if (obj.style.display == "none"){ 
				obj.style.display = "";
				document.images[picId+i].src = 'images/arrows/' + picOn; 
			} else { 
				obj.style.display = "none";
				document.images[picId+i].src = 'images/arrows/' + picOff; 
			} 
	  } else {	    
		obj = document.getElementById(itemId); 
		obj.style.display = "none";
		//var sPicSRC = document.images[picId+i].src;
		//sPicSRC.toString();
		document.images[picId+i].src = 'images/arrows/' + picOff; 
	  } 
  }
}


function showhidewImg(id,picId, picOff, picOn){
  showhide(id);
  switchImg(picId, picOff, picOn);
}

function showhide(id){
//Shows or hides an element depending on its current display property 
  if (document.getElementById){ 
	obj = document.getElementById(id); 
	if (obj.style.display == "none"){ 
	  obj.style.display = ""; 
    } else { 
    obj.style.display = "none"; 
    } 
  } 
} 

function switchImg(picId, picOff, picOn) {
	var sPicSRC = document.images[picId].src;
	sPicSRC.toString();
	if (sPicSRC.indexOf(picOff) == -1) {
		document.images[picId].src = 'images/arrows/' + picOff;
	}
	else {
		document.images[picId].src = 'images/arrows/' + picOn;
	}
}


function hide(id){
//Hides an element  
  if (document.getElementById){ 
	obj = document.getElementById(id); 
    obj.style.display = "none"; 
  } 
}

function hideImg(picId,img) {
	var sPicSRC = document.images[picId].src;
	sPicSRC.toString();
	document.images[picId].src = 'images/arrows/' + img;
}



