function SwapImage( imageID, image )
{
    var theImage = document.getElementById( imageID );
    theImage.src = "/images/" + image;
}
function ShowSpring06Launch()
{
	var newwin;
	newwin = window.open('/spring_launch.htm','openwin','width=600,height=600,screenX=200,screenY=200,top=200,left=200,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowSizeChart()
{
	var newwin;
	newwin = window.open('/lib/sizechart.aspx','openwin','width=490,height=580,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowGCPrint( id )
{
	var newwin;
	newwin = window.open('/giftcertificates/certificate.aspx?id=' + id,'openwin','width=600,height=300,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowReturnPolicy()
{
	var newwin;
	newwin = window.open('/lib/returnpolicy.aspx','openwin','width=650,height=550,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShareItem(id,img) 
{
	var newwin;
	newwin = window.open('/products/share.aspx?id=' + id + '&img=' + img,'openwin','width=490,height=350,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowAddSize()
{
	var newwin;
	newwin = window.open('/portal/products/addsize.aspx','openwin','width=300,height=200,screenX=200,screenY=200,top=200,left=200,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowAddCategory(gender)
{
	var newwin;
	newwin = window.open('/portal/products/addcategory.aspx?gender=' + gender,'openwin','width=300,height=200,screenX=200,screenY=200,top=200,left=200,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowAddClearanceCategory(season)
{
	var newwin;
	newwin = window.open('/portal/products/addclearancecategory.aspx?season=' + season,'openwin','width=300,height=200,screenX=200,screenY=200,top=200,left=200,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowAddToFavorite(id)
{	
	var newwin;
	newwin = window.open('/portal/products/addtofavorite.aspx?id=' + id,'openwin','width=350,height=300,screenX=200,screenY=200,top=200,left=200,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowAddRelation(id)
{
	var newwin;
	newwin = window.open('/portal/products/newrelated.aspx?id=' + id,'openwin','width=350,height=300,screenX=200,screenY=200,top=200,left=200,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowCardNumber(hash)
{
	var newwin;
	newwin = window.open('/portal/orders/cardnumber.aspx?hash=' + hash,'openwin','width=300,height=200,screenX=200,screenY=200,top=200,left=200,resizable=no,toolbar=no,scrollbars=no')	
}
function ShowProduct(id) {
	var newwin;
	newwin = window.open('/products/product_full_view.aspx?id=' + id,'openwin','width=490,height=500,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowPressViewer(id) {
	var newwin;
	newwin = window.open('/about/press/viewer.aspx?id=' + id,'openwin','width=537,height=700,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowPhotoViewer(id) {
	var newwin;
	newwin = window.open('/about/photos/viewer.aspx?id=' + id,'openwin','width=537,height=600,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}
function ShowProductEx(id,img) {
	var newwin;
	newwin = window.open('/products/product_full_view.aspx?id=' + id + '&img=' + img,'openwin','width=530,height=650,screenX=100,screenY=100,top=100,left=100,resizable=no,toolbar=no,scrollbars=no')
	newwin.focus();
}

function DeleteCartItem(id)
{
	if( confirm( "Are you sure you want to delete this item from your cart?" ) )
	{
		location.href = "/shoppingbag/default.aspx?r=" + id;
	}
}
function CategoryPageAddCategory(gender)
{
	var tbName = document.getElementById( 'tbName' );
	window.opener.DefaultPageAddCategory( tbName.value, gender );
	window.close();
}
function DefaultPageAddCategory(name,gender)
{
	__doPostBack('', '@@@@ADDCATEGORY:' + name + ":" + gender );
}
function SizePageAddSize()
{	
	var tbName = document.getElementById( 'tbName' );
	window.opener.ColorPageAddSize( tbName.value );
	window.close();
}
function ColorPageAddSize(name)
{
	__doPostBack('', '@@@@ADDCOLOR:' + name );
}
function CountryChanged( mode, countryListID, stateListID, stateBoxID )
{
	if( mode == "VIEW" )
	{
		return;
	}
	var ddlCountry = document.getElementById( countryListID );
	var ddlState = document.getElementById( stateListID );
	var tbState = document.getElementById( stateBoxID );
	
	if( ddlCountry.selectedIndex == 0 )
	{
		ddlState.style.display = '';
		tbState.style.display = 'none';
	}
	else
	{
		ddlState.style.display = 'none';		
		tbState.style.display = '';			
	}
}