<!--
/* copyright: <lamP studio> web design, www.lamp.vze.com, +385 98 165 2510, all rights reserved */
//CLASS DEFINES
function CQuery(name,value)
{
	this.name = new String(name);
	this.value = new String(value);
}
//DECLARES
var QArray = null;
//HELPER FUNCTIONS
function GetFileName(strFileName, bExtension)
{
	if (strFileName == null)
		strFileName = location.pathname;
	if(bExtension==null)
		bExtension = false;
	var rez = new String("");
	if (strFileName.lastIndexOf("/") != -1)
		rez = strFileName.substr(strFileName.lastIndexOf("/")+1)
	if(rez.lastIndexOf("\\") != -1)//4 scripts local hdd
		rez = strFileName.substr(strFileName.lastIndexOf("\\")+1)
	if (bExtension==false && strFileName.lastIndexOf(".") != -1)
		rez = strFileName.substr(0,strFileName.lastIndexOf("."))
	return rez;
}
function GetExtension(strFileName)
{
	if(strFileName==null)
		strFileName = GetFileName(location.pathname,true);
	var rez = new String("");
	if (strFileName.lastIndexOf(".") != -1)
		rez = strFileName.substr(strFileName.lastIndexOf(".")+1);
	return rez;
}
function GetDirectory(strFilePath)
{
	if (strFilePath==null)
		strFilePath = location.href;
	var rez = new String("");
	if (strFilePath.lastIndexOf("/") != -1)
		rez = strFilePath.substr(0,strFilePath.lastIndexOf("/"))
	if (strFilePath.lastIndexOf("\\") != -1)//4 scripts on local hdd
		rez = strFilePath.substr(0,strFilePath.lastIndexOf("\\"))
	return rez;
}
//QueryString FUNCTIONS
function BuildQuery(LocationOfWindow)
{
	var strLocation = new String(""); strLocation = unescape(LocationOfWindow);
	var iStart = strLocation.indexOf("?");
	if(iStart==-1)
		iStart = strLocation.indexOf("&");
	if(iStart != -1)
	{
		var numStrings = 1;
		strLocation = strLocation.slice(iStart);
		for(iStart=1; iStart<=strLocation.length; iStart++)
		{
			if(strLocation.charAt(iStart)=="&")
			numStrings++;
		}
		QArray = new Array(numStrings);
		for(i=0; i<numStrings;i++)
		{
			QArray[i] = new CQuery("null","null");
			if(strLocation.indexOf("=") != -1)
			{
				if(strLocation.indexOf("&",1) != -1)
				{
					QArray[i].name = strLocation.slice(1,strLocation.indexOf("="));
					QArray[i].value = strLocation.slice(strLocation.indexOf("=")+1,strLocation.indexOf("&",1));
					strLocation = strLocation.slice(strLocation.indexOf("&",1));
				}
				else
				{
					QArray[i].name = strLocation.slice(1,strLocation.indexOf("="));
					QArray[i].value = strLocation.slice(strLocation.indexOf("=")+1,strLocation.length);
					strLocation = strLocation.slice(strLocation.indexOf("&"));
				}
			}
			else
			{
				QArray[i].name = "";
				QArray[i].value = "";
			}
			
		}
	}
}
function QueryString(strObjName)
{
	var strName = new String(); strName = strObjName;
	if(QArray != null)
	{
	for(i=0; i<=QArray.length-1; i++)
	{
		if(QArray[i].name.toUpperCase() == strName.toUpperCase())
			return QArray[i].value;
	}
	}
	return "";
}
function GetWholeQuery(strStartText, strMiddleText, strAfterText, bNameThenValue)
{
	var rez = new String("");
	if(QArray != null)
	{
		for(i = 0; i<=QArray.length-1; i++)
		{
			if(bNameThenValue==true)
				rez = rez + strStartText + QArray[i].name + strMiddleText + QArray[i].value + strAfterText;
			else
				rez = rez + strStartText + QArray[i].value + strMiddleText + QArray[i].name + strAfterText;
		}
	}
	return rez;
}
/* copyright: <lamP studio> web design, www.lamp.vze.com, +385 98 165 2510, all rights reserved */
//-->