﻿  var lastIndex = '';

/* For iamge rotation */
	var imgs = new Array();
	var a=null;
	var n=0;

//    ************************
// ***     Image rollover     ***
//    ************************


var arrow_Over 		= new Image(); 		arrow_Over.src 		= "images/arrowsmall_on.gif";
var arrow_Norm1 	= new Image();		arrow_Norm1.src		= "images/arrowsmall_blue.gif";


  
/******************************************************************************/
/***************************** Show and hide text *****************************/
/******************************************************************************/

function flip(foo) {
	
  //document.getElementById(foo).style.visibility="hidden";
    
  if( document.getElementById(foo).style.display == "none") {
	
    document.getElementById(foo).style.display="block";
  } else {
    document.getElementById(foo).style.display="none";
  }
}
function show(foo) {
    if (lastIndex != '')
      hide(lastIndex);
    document.getElementById(foo).style.display="block";
    lastIndex = foo;
    return true;
}
function hide(foo) {
    document.getElementById(foo).style.display="none";
    return true;
}

/***********************************************************************************/
/***************************** Image rollover function *****************************/
/***********************************************************************************/

function rollover( imagename, objectsrc )
{
	if ( document.images )
		document.images[imagename].src = eval(objectsrc+".src");
}


/*************************************************************************/
/*               Functions for opening popup windows                      */
/*************************************************************************/

function openBrWindow(theURL,winName,features)
{
  window.open(theURL,winName,features);
}

function msgAlert(x) {
  alert(x);
}


/*************************************************************************/
/*			Dynamic Page resize				 */
/*************************************************************************/

function getSize(evt) 
{
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }

	var main = document.getElementById("main");
	var maintable = document.getElementById("maintable");
	var topImage = document.getElementById("topImage");
	var subnav = document.getElementById("Subnavigation2");
	var sub = 286;
	
	if(topImage){
		if(topImage.children.length == 1)
		{
			sub = 282;
		}
	}
	
	if(subnav)
	{
		subnav.style.height = (myHeight-122) + 'px';

	
	}
	if(!maintable){
		main.style.height = (myHeight-122) + 'px';
			}
	else{
		mainTable.style.height = (myHeight-sub) + 'px';
		
	}
 /*
 var main = document.getElementById("main");
 
  var clientHeight = parseInt(document.documentElement.clientHeight);
 //alert(document.documentElement.clientHeight);
 //alert(document.body.clientHeight);  
 main.style.posHeight = clientHeight - 100 - 22;
 */
}

function getSize2() 
{
  
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
   
 e=document.getElementById("main");
 e.style.height = (myHeight-122) + 'px';
 
}

/*****************************************/
/*			Image rotation				 */
/*****************************************/

/* path will be /digimaker/ since imageName contains folders/image name */
function imageRotation(imageNames)
{
	var arrImageNames = imageNames.split(";");
	
	for(var i=0; i < arrImageNames.length; i++)
	{
	  imgs[i] = new Image();
      imgs[i].src = '/digimaker/' + arrImageNames[i];
    }
    rotate();
}

function rotate(){
	n=(n+1)%3;
	document.p1.src=imgs[n].src;
	if(a==null)a=setInterval("rotate()",1500);    
}
