document.write("<meta http-equiv='imagetoolbar' content='no'>");
function addFavorite()
{
	    if( confirm( "Would you like to add this album to your favorite albums?" ) )
	    {
		    addFavForm.submit();
	    }
      
}


function strLengthByte(str)
{
	var totLength = 0;
	for (var i=0;i<str.length;i++)
		totLength += strCharByte(escape(str.charAt(i)));
	return totLength;
}

function strCharByte(chStr) {
	if (chStr.substring(0, 2) == '%u')
	{
		if (chStr.substring(2,4) == '00')
			return 1;
		else
			return 2;
	}
	else if (chStr.substring(0,1) == '%')
	{
		if (parseInt(chStr.substring(1,3), 16) > 127)
			return 2;
		else
			return 1;
	}
	else
		return 1;
}

function checkValue() {

	if (commentForm.comment.value=="") {
		alert("Message is needed");
		commentForm.comment.focus();
		return false;
	}
	if (strLengthByte(commentForm.comment.value)>100) {
		alert("No more than 100 characters are allowed");
		commentForm.comment.focus();
		return false;
	}
	return true;		
}

function submitCmt()
{
	if( checkValue() )
		commentForm.submit();
}

function deleteCmt(cmtIdx)
{
	if( confirm( "Would you like to erase this?" ) )
	{
		cmtDelForm.cmtNu.value = cmtIdx
		cmtDelForm.submit();
	}
}

function blockUser( blockId )
{
	if( confirm( "Would you like to block '" + blockId + "'?" ) )
	{
		cmtBlockForm.blockId.value = blockId;
		cmtBlockForm.submit();
	}
}
/*
function recommend( aId )
{
	if( confirm( "Would you like to recommend this album?") )
	{
		addRecommendForm.submit();
	}
}
*/
var imgObj = new Image();
function showImgPop(imgName) {
  imgObj.src = imgName;
  
  setTimeout("createImgWin(imgObj)", 100);
//  imageWin.close(); // A.M. 2/19/09
}
function createImgWin(imgObj) {
  if (! imgObj.complete) {
    setTimeout("createImgWin(imgObj)", 100);
    return;
  }
  
  imageWin = window.open("", "imageWin",
    "width=" + imgObj.width + ",height=" + imgObj.height);
  imageWin.document.write("<html><meta http-equiv='imagetoolbar' content='no'><body style='margin:0' oncontextmenu='return false;'>");
  imageWin.document.write("<a href=javascript:window.close()><img src='" + imgObj.src + "' border=0></a>");
  imageWin.document.write("</body><html>");
  imageWin.document.title = imgObj.src;
  
}

