var numOfItems = null;
var itemArray = new Array();
var more = null;
var readMore = null;
var readLess = null;
var graphic = null;
var hideGraphic = null;
var showGraphic = null;

function setMore(){
	readMore = new makeObjects('readMore');
	readLess = new makeObjects('readLess');
	more = new makeObjects('more');
	readLess.hide();
	more.hide();
}// end setMore()

function setGraphic(){
	graphic = new makeObjects('graphic');
	showGraphic = new makeObjects('showGraphic');
	hideGraphic = new makeObjects('hideGraphic');
	hideGraphic.hide();
	graphic.hide();
}// end setGraphic()

function load(num){
	numOfItems = num;
	for(var i=1; i <= numOfItems; i++){
		itemArray[i] = new makeObjects('itemNum' + i);
		itemArray[i].hide();
	}
}// end load()

function toggleItem(s){
	if(itemArray[s].css.display == 'none'){
		itemArray[s].show();
		for(var i=1; i <= numOfItems; i++){
			if(i != s){ itemArray[i].hide(); }
		}
	}else{ itemArray[s].hide(); }
}// end toggleItem()

function makeObjects(obj){
	this.dom = getDOM(obj,0);
	this.css = this.dom.style;
	this.hide = hideItem;
	this.show = showItem;
	return this;
}// end makeObjects()

function openPrint(){
	for(var i=1; i <= numOfItems; i++){
		itemArray[i].show();
	}
	window.print();
	setTimeout('closeAll()',2500);
}// end openPrint()

function openAll(){
	for(var i=1; i <= numOfItems; i++){
		itemArray[i].show();
	}
}// end closeAll()

function closeAll(){
	for(var i=1; i <= numOfItems; i++){
		itemArray[i].hide();
	}
}// end closeAll()

function showMore(){
	if(more.css.display == 'block'){ more.hide(); }
	else{ more.show(); }
}// end showMore()

//method functions
function hideItem(){ this.css.display = 'none'; } 
function showItem(){ this.css.display = 'block'; }

// Datasheet Menu Builder

var button = new Array();
var states = new Array('_over','_on','_off');
var names = new Array('intro','howitworks','features','specs');

function init(){
	for(var i=0; i < 4; i++){
		button[i] = new makeButton(names[i]);
		button[i].off;
	}
}// end init()

function makeButton(objName){
	this.dom = getDOM(objName, 0);
	this.css = this.dom.style;
	this.off = makeButton_offButton;
	this.on = makeButton_onButton;
	this.over = makeButton_overButton;
	this.name = objName;
}// end makeButton()

// object methods
function makeButton_offButton(){
this.dom.src = '/images/solutions/datasheets/' + this.name + states[2] + '.gif';}
function makeButton_onButton(){
this.dom.src = '/images/solutions/datasheets/' + this.name + states[1] + '.gif'; }
function makeButton_overButton(){ 
this.dom.src = '/images/solutions/datasheets/' + this.name + states[0] + '.gif'; }



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

