// JavaScript Document

//global variables
var original_image = "url(http://welcome.hp-ww.com/img/beta_header-grey.gif)";
var original_color = "#333333";
var active_image = "url(http://welcome.hp-ww.com/img/header_0066FF.gif)";
var active_color = "#FFFFFF";
var active = 0;

function window_shade(obj)
	{
		var shadeNum = obj.slice(obj.indexOf("acc") + 3);
		
		if (active == 0)
			{			
				active = shadeNum;
				change_window_shade_header_color(shadeNum);
			}
		else if (active == shadeNum)
			{
				return_header_color();
				active = 0;
			}
		else
			{
				active = shadeNum;
				change_window_shade_header_color(shadeNum);
			}
			
						
					//alert(shadeNum);
		/*
		//fill the array with the offset locations of each shade
		//will only run when the array is empty
		if(locArr[0] == null)
			{				
			for(i = 0; i < locArr.length; i++)
				{
					myObj = document.getElementById('window_shade' + (i + 1));
					locArr[i] = myObj.offsetTop;
				}
			}	*/
	}

function change_window_shade_header_color(active_window_shade) 
	{
				
		
		//alert(active_window_shade);
		document.getElementById("acc" + active_window_shade).style.backgroundImage = active_image;
		document.getElementById("acc" + active_window_shade).style.color = active_color;
						
		for(i = 1; i < 4; i++)
			{
				if(parseInt(active_window_shade) != i)
					{
						document.getElementById("acc" + i).style.backgroundImage = original_image;
						document.getElementById("acc" + i).style.color = original_color;
					}
			}
	}
	
function return_header_color() 
	{		
		for(i = 1; i < 4; i++)
			{				
				document.getElementById("acc" + i).style.backgroundImage = original_image;
				document.getElementById("acc" + i).style.color = original_color;
					
			}
				
	}
	
function prnFam()
{
	myVal = 0;
	for(i = 0; i < document.frmPrint.pfamily.length; i++)
		{
			if(document.frmPrint.pfamily[i].checked)
				{
					myval = i + 1;	
					document.getElementById("tbllj" + myval).style.visibility='visible';
					document.getElementById("tbllj" + myval).style.position='absolute';				
				}
			else
				{
					document.getElementById("tbllj" + (i+1)).style.visibility='hidden';
					document.getElementById("tbllj" + (i+1)).style.position='absolute';
				}
		}	
}

function ddprnFam()
{	
	//get the selected value from the drop down list
	var dropdownIndex = document.frmPrint.products.selectedIndex;	
		
	for(i = 0; i < document.frmPrint.products.length; i++)
		{			
			
			if(i == dropdownIndex)
				{
					document.getElementById("tbllj" + (i+1)).style.visibility='visible';
					document.getElementById("tbllj" + (i+1)).style.top='absolute';		
				}
			else
				{
					document.getElementById("tbllj" + (i+1)).style.visibility='hidden';
					document.getElementById("tbllj" + (i+1)).style.position='absolute';
				}
		}	
}