/*-----------------------Image Roll Over --------------------*/

function roll(img_name, img_src)
   {
   document[img_name].src = img_src;
   }
   
 /* --------------------------------- Show hide Row------------------*/
function show_area( show_area_id )
{
//	alert('Show Area : ' + show_area_id);
	document.getElementById(show_area_id).style.display = '';
}
function hide_area( hide_area_id )
{
//	alert('Hide Area : ' + hide_area_id);
	document.getElementById(hide_area_id).style.display = 'none';
}

function show_hide( show_hide_id )
{
	if ( (document.getElementById(show_hide_id).style.display) && (document.getElementById(show_hide_id).style.display == 'none') )
	{
		show_area(show_hide_id);
	}
	else
	{
		hide_area(show_hide_id);
	}
}
/*-------------------------------  PopUp Display Start -----------------------------------------*/
function display_pop_up( id )
{	
	// Do not remove parseInt function from height and width calculation
	var pop_up_width = parseInt(document.getElementById(id).style.width || document.getElementById(id).width);
	var pop_up_height = parseInt(document.getElementById(id).style.height || document.getElementById(id).height);
	
	var win_width = getPageWidthWithScroll();
//	var win_height = getPageHeightWithScroll();
	
	/* Special Handling for pop_up having no width / no height defined */
	if (! pop_up_width )
	{
		pop_up_width = win_width - 200;		// Default pop width if not defined in pop_id
	}
	if (! pop_up_height )
	{
		pop_up_height = 250;	// Default pop height if not defined in pop_id
	}
	/*------------------------------------------------------*/
	var scrollXY = new Array();
	scrollXY = getScrollXY();
	var y_offset_by_scroll = scrollXY[1];
	var popupYpos = y_offset_by_scroll + 25;
	if ( parseInt(600-(pop_up_height * 2)) > 0 )	// 800 is Min Height
	{
		popupYpos = y_offset_by_scroll + (600-(pop_up_height * 2));
	}
	
	var popupXpos = (win_width - pop_up_width) / 2;

	document.getElementById(id).style.top = popupYpos;
	document.getElementById(id).style.left = popupXpos;
	
	document.getElementById(id).style.display = 'block';
}

function getScrollXY() { 
  var scrOfX = 0, scrOfY = 0; 
  if( typeof( window.pageYOffset ) == 'number' ) { 
    //Netscape compliant 
    scrOfY = window.pageYOffset; 
    scrOfX = window.pageXOffset; 
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { 
    //DOM compliant 
    scrOfY = document.body.scrollTop; 
    scrOfX = document.body.scrollLeft; 
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { 
    //IE6 standards compliant mode 
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

//------------------------------------ Footer, Panel and other Height and width Adjustments -----------------------------
function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}

function getPageWidthWithScroll()
{
	var windowPos = getPageSizeWithScroll();
	var win_width = parseInt(windowPos[0]);
	return win_width;
}

function getPageHeightWithScroll()
{
	var windowPos = getPageSizeWithScroll();
	var win_height = parseInt(windowPos[1]);
	return win_height;
}