function TrustLogo(dummy)
{
    // do nothing
}

function rollover(imgName, imgUrl)
{
	if (document.images && typeof imgUrl != 'undefined')
		document[imgName].src = imgUrl.src;
}

function productPhotoPopup(productID)
{
	var windowURL = "/pages/ProductPhotoPopup.aspx?productID="+productID;
	var windowOptions = "resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,width=655,height=668";
	retval = window.open(windowURL,'ProductPhotoPopup',windowOptions);
}

function productPhotoDetailsPopup(productGroupID, productGroupImageID)
{
	var windowURL = "/pages/ProductPhotoPopup.aspx?productGroupID="+productGroupID+"&imageID="+productGroupImageID;
	var windowOptions = "resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,width=655,height=668";
	retval = window.open(windowURL,'ProductPhotoPopup',windowOptions);
}

function productAccessoryPhotoPopup(productAccessoryGroupID)
{
	var windowURL = "/pages/ProductPhotoPopup.aspx?productGroupID="+productAccessoryGroupID+"&accessory=true" //"&imageID="+productGroupImageID;
	var windowOptions = "resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,width=655,height=668";
	retval = window.open(windowURL,'ProductPhotoPopup',windowOptions);
}

function emailPopup(department)
{
	var windowWidth = 400;
	var windowHeight = 460;
	
	var margin = 60;

	var w = (screen.width)/2-windowWidth/2;
	var h = (screen.height)/2-windowHeight/2 - 60;

	var winName = "EmailPopup";
	var windowURL = "/pages/EmailPopup.aspx?department=" + department;
	var windowOptions = "resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,top=" + h + ",left=" + w + ",scrollbars=no, width=" + (windowWidth + margin) + ",height=" + (windowHeight + margin) ;
	var popupWindow = window.open(windowURL,winName,windowOptions);
	popupWindow.focus();

	return false;
}


function messageWindow(messagePage)
{
	windowURL = messagePage;	
	var windowOptions = "resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,width=550,height=620";
	retval = window.open(windowURL, 'MessageWindow', windowOptions);
}

function message(messageType)
{
	var windowURL = "testurl";
	if (messageType == "aboutcookies")
	{
		windowURL = "/pages/message.aspx?type=cookies";	
	}
	else if (messageType == "aboutshipping")
	{
		windowURL = "/pages/message.aspx?type=shipping";
	}	
	var windowOptions = "resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,width=300,height=400";
	retval = window.open(windowURL, 'MessagePopup', windowOptions);
}

function CloseWithESCKey(evt)
{
	if (evt.keyCode == 27)
	{
		window.close();
	}
}

function RepositionPhotoPopupScroller()
{
	$_GET = new Array;
	$argstr = location.search.substring( 1, location.search.length );

	if( $argstr.indexOf( '%26' ) > 0 )
	{
		$args = $argstr.split( '%26' );
	}
	else
	{
		$args = $argstr.split( '&' );
	}
	
	$newPosition = 0;

	for( $i = 0; $i < $args.length; $i++ )
	{
		$list = $args[$i].split('=');
		$_GET[$list[0]] = $list[1];
		if ($list[0] == 'scrollPosition')
		{
			if (parseInt($list[1]) > 9)
			{
				$newPosition = parseInt($list[1] - 9) * 56 + 8;
			}
		}
		//alert("query: " + $list[0]);
		//alert('newPosition: ' + $newPosition);
	}

	document.getElementById('Thumbnails').scrollTop = $newPosition;
}

function hideUnhideText(textBlockID, clickTextLinkID, clickTextImageID)
{
	var textBlock = document.getElementById(textBlockID);
	var clickTextLink = document.getElementById(clickTextLinkID);
	var clickTextImage = document.getElementById(clickTextImageID);
	
	//alert('clickTextLink: ' + clickTextLink.innerHTML = 'close');
	//alert('clickTextImage: ' + clickTextImage.src.Replace('click-for-more-arrow-down.gif','click-for-more-arrow-up.gif'));

	if (textBlock != null)
	{
		if (textBlock.style.display == 'block' || textBlock.style.display == '')
		{
			textBlock.style.display = 'none';
			if (clickTextLink != null)
				clickTextLink.innerHTML = 'Details';
				
			if (clickTextImage != null)
				clickTextImage.src = clickTextImage.src.replace('click-for-more-arrow-up.gif','click-for-more-arrow-down.gif');
		}
		else
		{
			textBlock.style.display = 'block';
			if (clickTextLink != null)
				clickTextLink.innerHTML = 'Close';
				
			if (clickTextImage != null)
				clickTextImage.src = clickTextImage.src.replace('click-for-more-arrow-down.gif','click-for-more-arrow-up.gif');
		}
	}
}
