//=================================================================================================
//	You can delete these three functions if not needed.
//-------------------------------------------------------------------------------------------------
function customBodyLoad( sender )
{
	repositionDiv("languageselect", 298, 955, 835);
}
//=================================================================================================
function customBodyResize( sender, size )
{
	var
		imgPopup       = document.getElementById("imgPopup");

	if( imgPopup )
		imgPopupResize();

	repositionDiv("languageselect", 298, 955, 835);
}
//=================================================================================================
function customBodyScroll( sender )
{
}
//=================================================================================================
function frmSearchProjectsSubmit( sender, event )
{
	return true;
}
//=================================================================================================
function imgPopupResize()
{
	var
		win	= getSize( szWindow ), 
		img	= document.getElementById("imgPopup");
		
	if( img )
	{
		if( isIE )
			window.resizeTo(img.width + 28, img.height + 35);
		else
			window.resizeTo(img.width + 8, img.height + 85);
			
		window.moveTo(0,0);
	}
}
//=================================================================================================
//=================================================================================================
//	E-CARDS
//=================================================================================================
function sendCard( itmID, index )
{
	var
		url = new Url().replacePage("misc/e-card.aspx", true ).add("steID", steID ).add("itmID", itmID ).add("index", index ), 
		win = window.open( url, "frmCard", "width=602,height=440,scrollbars=0,resizable=0");
}
//=================================================================================================
function showTab( tab )
{
	var
		aInformation		= document.getElementById("aInformation"),
		aSpecification		= document.getElementById("aSpecification"),
		aMiscelanious		= document.getElementById("aMiscelanious");
	var
		divInformation		= document.getElementById("divInformation"),
		divSpecification	= document.getElementById("divSpecification"),
		divMiscelanious	= document.getElementById("divMiscelanious");
		
	if( aInformation ) 
		aInformation.className				= "";
	if( aSpecification )
		aSpecification.className			= "";
	if( aMiscelanious )
		aMiscelanious.className				= "";
	
	if( divInformation ) 
		divInformation.style.display		= "none";
	if( divSpecification )
		divSpecification.style.display	= "none";
	if( divMiscelanious )
		divMiscelanious.style.display		= "none";
	
	if( tab == 1)
	{
		aInformation.className				= "current";
		divInformation.style.display		= "block";
	}
	else if( tab == 2)
	{
		aSpecification.className				= "current";
		divSpecification.style.display		= "block";
	}
	else if( tab == 3)
	{
		aMiscelanious.className				= "current";
		divMiscelanious.style.display		= "block";
	}

}
//=================================================================================================
function sizeChange( sender, event )
{
	var
		meters = new Array("", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "70"),
		feet = new Array("", "15", "30", "50", "65", "80", "100", "115", "130", "150", "165", "180", "190", "200");
		
	var
		minLength = document.getElementById("minLength"),
		maxLength = document.getElementById("maxLength");
		
	if( minLength && maxLength)
	{
		var
			ixMinLength = minLength.selectedIndex,
			ixMaxLength = maxLength.selectedIndex;
		
		for( var i = 1; i < minLength.length; i++)
		{
			if( sender.value == 1)
			{
				minLength.options[i].text = meters[i];
				minLength.options[i].value = meters[i];
				
				maxLength.options[i].text = meters[i];
				maxLength.options[i].value = meters[i];
			}
			else
			{
				minLength.options[i].text = feet[i];
				minLength.options[i].value = feet[i];
				
				maxLength.options[i].text = feet[i];
				maxLength.options[i].value = feet[i];
			}
		}
	}
}
//=================================================================================================
function minLengthChange( sender, event )
{
	var
		minLength = document.getElementById("minLength"),
		maxLength = document.getElementById("maxLength");
		
	if( minLength.selectedIndex > maxLength.selectedIndex && minLength.selectedIndex != 0 && maxLength.selectedIndex != 0)
	{
		if( minLength.selectedIndex + 1 < maxLength.length )
			maxLength.selectedIndex = minLength.selectedIndex + 1;
		else
			maxLength.selectedIndex = minLength.selectedIndex;
	}
}
//=================================================================================================
function maxLengthChange( sender, event )
{
	var
		minLength = document.getElementById("minLength"),
		maxLength = document.getElementById("maxLength");
		
	if( maxLength.selectedIndex < minLength.selectedIndex && minLength.selectedIndex != 0 && maxLength.selectedIndex != 0)
	{
		if( maxLength.selectedIndex - 1 >= 0)
			minLength.selectedIndex = maxLength.selectedIndex - 1;
		else
			minLength.selectedIndex = maxLength.selectedIndex;
	}
}
//=================================================================================================
function vpShowImage( link )
{
	var
		win =window.open( "/misc/vpShowImage.aspx?filename=" + link, "frmGA", "menubar=0,location=0,toolbar=0,scrollbars=1,resizable=1,status=0,width=10,height=10");

	if ( win )
		win.focus();
}
//=================================================================================================
function showPictures()
{
	var
		aPictues		= document.getElementById("aPictues"),
		aMovies		= document.getElementById("aMovies");
	var
		divPictures		= document.getElementById("divPictures"),
		divMovies	= document.getElementById("divMovies");

	if( aPictues ) 
		aPictues.className				= "current";
	if( aMovies )
	{
		aMovies.className						= "";
	}
	
	if( divPictures ) 
	{
		divPictures.className = "imageContainer";
		divPictures.style.display		= "block";
	}
	if( divMovies )
	{
		divMovies.className = "";
		divMovies.style.display	= "none";
	}
}
//=================================================================================================
function showMovies()
{
	var
		aPictues		= document.getElementById("aPictues"),
		aMovies		= document.getElementById("aMovies");
	var
		divPictures		= document.getElementById("divPictures"),
		divMovies	= document.getElementById("divMovies");

	if( aPictues ) 
		aPictues.className				= "";
	if( aMovies )
	{
		aMovies.className						= "current";
	}
	
	if( divPictures ) 
	{
		divPictures.className = "";
		divPictures.style.display		= "none";
	}
	if( divMovies )
	{
		divMovies.className = "imageContainer";
		divMovies.style.display	= "block";
	}
}
//=================================================================================================
function toggleLanguageSelect()
{
	var quickSearch = document.getElementById("languageselect");
	
	if (quickSearch)
	{		
		if (quickSearch.style.display == "none")
			quickSearch.style.display = "block"
		else
			quickSearch.style.display = "none"		
	}
}
//=================================================================================================	
function repositionDiv(name, left, width, defaultLeft )
{
	var div = document.getElementById(name);
	 
	if (div)
	{
		if (document.body.offsetWidth > width)
		{			
			div.style.left = Math.round(left + (document.body.offsetWidth / 2)) + "px";
		}
		else
		{		
			div.style.left = defaultLeft + "px";
		}
	}
}
//=================================================================================================	
