/* -------------------------------------------------------
 :: e4u.js 3.6.29 :: e4u functions set
                                                            
-------------------------[ (c)2003 nataniel@xpect.pl ]--- */

function IEVersion()
{
	var ua = window.navigator.userAgent;
	var msie = ua.indexOf ( "MSIE " );
	
	if ( msie > 0 )      // If Internet Explorer, return version number
	{
		return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));
	}
	else                 // If another browser, return 0
	{
		return 0;
	}
}

function CreateURI(pRootURI, pTarget, pSession)
{
	return pRootURI + 'e4u.php/' + pTarget;
}

function FriendlyURI(pRootURI, pTarget, pSession)
{
	return pRootURI + 'x.php/' + pTarget + '.html';
}

function ObjectProperties(pObj, pName)
{
	var result = "";
	for (var i in pObj) 
	{
		result += pName + "." + i + " = " + pObj[i] + "\n";
	}
	
	return result;
}

function Execute(pCMD, pFrame, pExclude, pTest)
{
	if (typeof pExclude == 'undefined')
	{
		pExclude = window.name;
		pTest = false;
	}
	
	if (pFrame != window.name)
	{
		var maxFrames = window.frames.length;
		if (maxFrames > 0)
		{
			for (var i = 0; i < maxFrames; i++)
			{
				if (window.frames[i].name != pExclude)
				{
					if (window.frames[i].name == pFrame)
					{
						if (pTest)
						{
							alert(window.frames[i].name + ' (from ' + window.name + '): ' + pCMD);
						}
						else
						{
							window.frames[i].eval(pCMD);
						}
						return true;
						
					}
					else
					{
						if (window.frames[i].Execute(pCMD, pFrame, 'parent', pTest) == true)
						{
							return true;
						}
					}
				}
			}
		}
		
		if (window.name != '')
		{
			if (pExclude != 'parent')
			{
				parent.Execute(pCMD, pFrame, window.name, pTest);
			}
			else
			{
				return false;
			}
		}
		else
		{
			alert(window.name + ': Execute(): Frame ' + pFrame + ' not found.');
			return false;
		}
	}
	else
	{
		if (pTest)
		{
			alert(window.name + ': ' + pCMD);
		}
		else
		{
			eval(pCMD);
		}
		
		return true;
	}
}