var view_enlarged_url;
var email_to_friend_url;
var add_to_favorites_url;

var view_enlarged_window;
var email_to_friend_window;
var add_to_favorites_window;

function openViewEnlargedWindow(zidProductId, intWidth500, intHeight500, blnPrivate)
{
	view_enlarged_url = strPopupDirUrl + 'view_enlarged.asp' + '?product_id=' + zidProductId + '&width=' + intWidth500 + '&height=' + (parseInt(intHeight500) + 43);
	view_enlarged_url = view_enlarged_url + '&side=' + 'front';
	if (blnPrivate) {
		view_enlarged_url = view_enlarged_url + '&private=' + 'true';
	}
	view_enlarged_window = window.open(view_enlarged_url,'view_enlarged_window', 'top='+((screen.availHeight - intHeight500 - 43) / 2)+',left='+((screen.availWidth - intWidth500) / 2)+'+,resizable=yes,status=no,scrollbars=no,location=no,toolbar=no,directories=no,menubar=no,width=' + intWidth500 + ',innerWidth=' + intWidth500 + ',height=' + (intHeight500 + 43) + ',innerHeight=' + (intHeight500 + 43));
	view_enlarged_window.focus();
}

function OpenEmailToFriendWindow(strType, zidProductId, uidDesignId, strSide, strStyle, strColor, strSize, collectionName)
{
	email_to_friend_url = strDisneyPopupDirUrl + 'email.asp' + '?type=' + strType + '&product_id=' + zidProductId + '&collectionName=' + collectionName;

	if (strType == 'design') {
		email_to_friend_url = email_to_friend_url + '&design_id=' + uidDesignId;
	}

	email_to_friend_url = email_to_friend_url + '&side=' + strSide;

	if ((strType == 'design') || (strType == 'realview')) {
		email_to_friend_url = email_to_friend_url + '&style=' + strStyle + '&color=' + strColor + '&size=' + strSize;
	}

	email_to_friend_window = window.open(email_to_friend_url,'email_to_friend_window', 'top='+((screen.availHeight - 550) / 2)+',left='+((screen.availWidth - 455) / 2)+'+,resizable=yes,status=no,scrollbars=no,location=no,toolbar=no,directories=no,menubar=no,width=455,innerWidth=455,height=550,innerHeight=550');
	email_to_friend_window.focus();
}

function OpenAddToFavoritesWindow(zidProductId, strStyle, strColor, strSize, strCollectionName)
{
	add_to_favorites_url = strDisneyPopupDirUrl + 'add_to_favorites.asp';
	add_to_favorites_url = add_to_favorites_url + '?product_id=' + zidProductId;
	add_to_favorites_url = add_to_favorites_url + '&style=' + strStyle;
	add_to_favorites_url = add_to_favorites_url + '&color=' + strColor;
	add_to_favorites_url = add_to_favorites_url + '&size=' + strSize;
	add_to_favorites_url = add_to_favorites_url + '&collectionName=' + strCollectionName;

	add_to_favorites_window = window.open(add_to_favorites_url,'add_to_favorites_window', 'top='+((screen.availHeight - 200) / 2)+',left='+((screen.availWidth - 200) / 2)+'+,resizable=yes,status=no,scrollbars=no,location=no,toolbar=no,directories=no,menubar=no,width=200,innerWidth=200,height=200,innerHeight=200');
	add_to_favorites_window.focus();
}

function GenerateGalleryProduct(zidProductId, strImgUrl)
{
	var strHtmlResult;
	var strMakeItLink;

	strMakeItLink = '/collections/disneyinkshop/product.asp?product_id=' + zidProductId;

	strHtmlResult = '';
	
	strHtmlResult = strHtmlResult + '<A HREF=\"' + strMakeItLink + '\">';
	strHtmlResult = strHtmlResult + '<IMG SRC=\"' + RlvAst(strImgUrl, 90, 'pre')+ '" WIDTH=\"77\" HEIGHT=\"90\" BORDER=\"0\">';
	strHtmlResult = strHtmlResult + '</A><BR>';
	
	strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: openViewEnlargedWindow(\'' + zidProductId + '\', 429, 500, false);\">';
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_enlarge_new_off.gif\" WIDTH=\"15\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_enlarge_on.src\" onMouseOut=\"this.src=btn_enlarge_off.src\" ALT=\"Enlarge\">';
	strHtmlResult = strHtmlResult + '</A>';

	strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: OpenAddToFavoritesWindow(\'' + zidProductId + '\',\'\',\'\',\'\');\">';
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_favorites_new_off.gif\" WIDTH=\"17\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_favorites_on.src\" onMouseOut=\"this.src=btn_favorites_off.src\" ALT=\"Save\">';
	strHtmlResult = strHtmlResult + '</A>';

	strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: OpenEmailToFriendWindow(\'image\',\'' + zidProductId + '\',\'\',\'front\',\'\',\'\',\'\');\">';
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_email_new_off.gif\" WIDTH=\"19\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_email_on.src\" onMouseOut=\"this.src=btn_email_off.src\" ALT=\"Email\">';
	strHtmlResult = strHtmlResult + '</A>';

	strHtmlResult = strHtmlResult + '<A HREF=\"' + strMakeItLink + '\">';
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_make_new_off.gif\" WIDTH=\"18\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_make_on.src\" onMouseOut=\"this.src=btn_make_off.src\" ALT=\"Make It\">';
	strHtmlResult = strHtmlResult + '</A><BR>';

	return strHtmlResult;
}

function GenerateQuickPick(zidProductId, intIndex, strDesignId, strStyle, strColor, strSize)
{
	var strHtmlResult;
	var strMakeItLink;

	if (strDesignId != '') {
		strMakeItLink = '/collections/disneyinkshop/product.asp?product_id=' + zidProductId + '&design_id=' + strDesignId + '&style=' + strStyle + '&color=' + strColor + '&size=' + strSize;
	} else {
		strMakeItLink = '/collections/disneyinkshop/product.asp?product_id=' + zidProductId + '&style=' + strStyle + '&color=' + strColor + '&size=' + strSize;
	}

	strHtmlResult = '';
	
	strHtmlResult = strHtmlResult + '<A HREF=\"' + strMakeItLink + '\">';
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/quick_picks/shirts3/' + intIndex + '.jpg\" WIDTH=\"125\" HEIGHT=\"125\" BORDER=\"0\">';
	strHtmlResult = strHtmlResult + '</A><BR>';
	
	//ENLARGE
	if (strDesignId != '') {
		strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: if (confirm(\'Because this shirt is customized, it must be viewed from the MAKEit page. \n\nContinue to the MAKEit page?\') == true) window.location=\'' + strMakeItLink + '\';\">';
	} else {
		strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: openViewEnlargedWindow(\'' + zidProductId + '\', 429, 500, false);\">';
	}
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_enlarge_new_off.gif\" WIDTH=\"15\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_enlarge_on.src\" onMouseOut=\"this.src=btn_enlarge_off.src\" ALT=\"Enlarge\">';
	strHtmlResult = strHtmlResult + '</A>';

	//SAVE
	if (strDesignId != '') {
		strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: if (confirm(\'Because this shirt is customized, you must save it from the MAKEit page. \n\nContinue to the MAKEit page?\') == true) window.location=\'' + strMakeItLink + '\';\">';
	} else {
		strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: OpenAddToFavoritesWindow(\'' + zidProductId + '\',\'' + strStyle + '\',\'' + strColor + '\',\'' + strSize + '\');\">';
	}
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_favorites_new_off.gif\" WIDTH=\"17\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_favorites_on.src\" onMouseOut=\"this.src=btn_favorites_off.src\" ALT=\"Save\">';
	strHtmlResult = strHtmlResult + '</A>';

	//EMAIL
	if (strDesignId != '') {
		strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: OpenEmailToFriendWindow(\'design\',\'' + zidProductId + '\',\'' + strDesignId + '\',\'front\',\'' + strStyle + '\',\'' + strColor + '\',\'' + strSize + '\');\">';
	} else {
		strHtmlResult = strHtmlResult + '<A HREF=\"Javascript: OpenEmailToFriendWindow(\'realview\',\'' + zidProductId + '\',\'\',\'front\',\'' + strStyle + '\',\'' + strColor + '\',\'' + strSize + '\');\">';
	}
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_email_new_off.gif\" WIDTH=\"19\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_email_on.src\" onMouseOut=\"this.src=btn_email_off.src\" ALT=\"Email\">';
	strHtmlResult = strHtmlResult + '</A>';

	//MAKE IT
	strHtmlResult = strHtmlResult + '<A HREF=\"' + strMakeItLink + '\">';
	strHtmlResult = strHtmlResult + '<IMG SRC=\"/assets/graphics/collections/disneyinkshop/btn_make_new_off.gif\" WIDTH=\"18\" HEIGHT=\"20\" BORDER=\"0\" HSPACE=\"1\" onMouseOver=\"this.src=btn_make_on.src\" onMouseOut=\"this.src=btn_make_off.src\" ALT=\"Make It\">';
	strHtmlResult = strHtmlResult + '</A><BR>';

	return strHtmlResult;
}
