var photoPopupHeight = 615;
var photoPopupWidth = 600;

var replacementChar = /%s/;
var imgSrcHTMLCode = "<IMG SRC=\"%s\" border=0 class=\"photo_detail\">";

function openPopup(url)
{
	window.open(url, "foto", "top=55,left=150,height=" + photoPopupHeight + ",width=" + photoPopupWidth + ",scrollbars=no,menubar=no,dependent=no,toolbar=no,location=no,help=no,status=no,resizable=yes");
}

function openPopupParam(strURL, width, height)
{
	window.open(strURL, "foto", "top=55,left=150,height=" + height + ",width=" + width + ",scrollbars=no,menubar=no,dependent=no,toolbar=no,location=no,help=no,status=no,resizable=yes");
}

function parseCommandLine(urlToParse) {
	if (urlToParse.indexOf("?") == -1) {
		return 0
	}

		// Parse any command line arguments
	urlQuery = urlToParse.split("?")

	urlTerms = urlQuery[1].split(",")
	if (urlTerms[0] != null) {
		//index = parseInt(urlTerms[0])
		//return urlTerms[0];
		return urlTerms;
	}
}

function getPicName(strToParse) 
{
	if (strToParse.indexOf("=") == -1) {
		return 0;
	}

		// only 1 parameter
	if(strToParse.indexOf("&") == -1)
		picName = strToParse.substring(strToParse.indexOf("=")+1);
	else // more params...
		picName = strToParse.substring(strToParse.indexOf("=")+1, strToParse.indexOf("&"));
		
			
	return picName;
}

function getPicLabel(strToParse) 
{
	if (strToParse.indexOf("=") == -1) {
		return 0;
	}

	picLabel = "";
	
	if(strToParse.indexOf("label=") != -1)
	{
		if(strToParse.lastIndexOf("&") > strToParse.indexOf("label=")) // 1 more param...		
			picLabel = strToParse.substring(strToParse.indexOf("label=")+6, strToParse.lastIndexOf("&"));
		else
			picLabel = strToParse.substring(strToParse.indexOf("label=")+6);
	}

	return picLabel;
}

