var strTrans = "images/trans.gif";


//-------------------------
function Alert(pstrIn)
{
	var blnShow = false;
	if (blnShow)
		alert(pstrIn);
}


//-------------------------
function SwapIn()
{
	var tempSrc, tempExt
	tempSrc = window.event.srcElement.src;
	tempExt = tempSrc.substring(tempSrc.length-4)
	window.event.srcElement.src = tempSrc.substring(0,tempSrc.length-4) + '01' + tempExt;
}


//-------------------------
function SwapOut()
{
	var tempSrc, tempExt
	tempSrc = window.event.srcElement.src;
	tempExt = tempSrc.substring(tempSrc.length-4)
	window.event.srcElement.src = tempSrc.substring(0,tempSrc.length-6) + tempExt;
}


//-------------------------
function MenuTop()
{
	var strMenuTop	= "images/PageTop/Menu/";
	var intHSpaceSidOdd= -1;
	var intHSpaceSidEvn= 0;
	// /* -- 1st Level -- //
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' height='18' align='center' name='TBTopMenu'>");
	document.write("	<tr>");
	
	document.write("		<td width='100%' align=left>");
	if (blnIsHome)
	{
		document.write("		<img border='0' src='"+strTrans+"' width='230' height='18' title='Quest of Persia'></td>");
	}
	else
	{
		document.write("		<a href='index.html'><img border='0' src='"+strTrans+"' width='230' height='18' title='Quest of Persia Homepage'></a></td>");
	}
	
	if (intPageId != "01")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='01News.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='News'><img border='0' src='"+strMenuTop+"01.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0101.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +" title='News'></td>");
	}
	
	if (intPageId != "02")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='02Overview.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Overview'><img border='0' src='"+strMenuTop+"02.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0201.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +" title='Overview'></td>");
	}
	
	if (intPageId != "03")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='03History.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='History'><img border='0' src='"+strMenuTop+"03.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0301.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +" title='History'></td>");
	}
	
	document.write("		<td width='80'><img border='0' src='"+strTrans+"' width='80' height='18'></td>");
	
	document.write("	</tr>");
	document.write("</table>");
	// -- 1st Level -- */ //
	// /* -- 2nd Level -- //
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' height='18' align='center' name='TBTopMenu'>");
	document.write("	<tr>");
	
	document.write("		<td width='100%' align=left>");
	if (blnIsHome)
	{
		document.write("		<img border='0' src='"+strTrans+"' width='230' height='18' title='Quest of Persia'></td>");
	}
	else
	{
		document.write("		<a href='index.html'><img border='0' src='"+strTrans+"' width='230' height='18' title='Quest of Persia Homepage'></a></td>");
	}
	
	if (intPageId != "04")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='04Puyaarts.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Puya Arts'><img border='0' src='"+strMenuTop+"04.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0401.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +" title='Puya Arts'></td>");
	}
	
	if (intPageId != "05")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='05QoP.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Quest of Persia'><img border='0' src='"+strMenuTop+"05.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0501.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +" title='Quest of Persia'></td>");
	}
	
	if (intPageId != "06")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='06Art.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Art'><img border='0' src='"+strMenuTop+"06.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0601.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +" title='Art'></td>");
	}
	
	if (intPageId != "07")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='07Technology.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Technology'><img border='0' src='"+strMenuTop+"07.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0701.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +" title='Technology'></td>");
	}
	
	document.write("		<td width='45'><img border='0' src='"+strTrans+"' width='45' height='18'></td>");
	
	document.write("	</tr>");
	document.write("</table>");
	// -- 2nd Level -- */ //
	// /* -- 3rd Level -- //
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' height='18' align='center' name='TBTopMenu'>");
	document.write("	<tr>");
	
	document.write("		<td width='100%' align=left>");
	if (blnIsHome)
	{
		document.write("		<img border='0' src='"+strTrans+"' width='230' height='18' title='Quest of Persia'></td>");
	}
	else
	{
		document.write("		<a href='index.html'><img border='0' src='"+strTrans+"' width='230' height='18' title='Quest of Persia Homepage'></a></td>");
	}
	
	if (intPageId != "08")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='08Games.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Games'><img border='0' src='"+strMenuTop+"08.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0801.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +" title='Games'></td>");
	}
	
	if (intPageId != "09")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='09Links.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Links'><img border='0' src='"+strMenuTop+"09.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0901.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +" title='Links'></td>");
	}
	
	if (intPageId != "10")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='10Downloads.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Downloads'><img border='0' src='"+strMenuTop+"10.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"1001.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +" title='Music'></td>");
	}
	
	if (intPageId != "11")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='11Careers.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Careers'><img border='0' src='"+strMenuTop+"11.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"1101.gif' width='71' height='18' hspace="+ (intHSpaceSidEvn) +" title='Careers'></td>");
	}
	
	if (intPageId != "12")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='12Contacts.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Contacts'><img border='0' src='"+strMenuTop+"12.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +"></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"1201.gif' width='71' height='18' hspace="+ (intHSpaceSidOdd+1) +" title='Contacts'></td>");
	}
	
	document.write("		<td width='10'><img border='0' src='"+strTrans+"' width='10' height='18'></td>");
	
	document.write("	</tr>");
	document.write("</table>");
	// -- 3rd Level -- */ //
//Alert('hi');
}


//-------------------------
function MenuRight()
{
	var strMenuRight = "images/PageRight/Menu/";
	document.write("<TABLE WIDTH=100% ALIGN=center BORDER=0 CELLSPACING=0 CELLPADDING=0 NAME=TBMenuRight>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='9'><br>");
	if (intPageId != "13")
	{
		document.write("		<a href='13Awards.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Awards'>");
		document.write("		<img border='0' src='"+strMenuRight+"13.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"1301.gif' width='130' height='18' hspace='6' title='Awards'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"13Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");

	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	if (intPageId != "14")
	{
		document.write("		<a href='14Press.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Press'>");
		document.write("		<img border='0' src='"+strMenuRight+"14.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"1401.gif' width='130' height='18' hspace='6' title='Press'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"14Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	if (intPageId != "15")
	{
		document.write("		<a href='15Posters.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Posters'>");
		document.write("		<img border='0' src='"+strMenuRight+"15.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"1501.gif' width='130' height='18' hspace='6' title='Posters'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"15Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
		document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	if (intPageId != "16")
	{
		document.write("		<a href='16Screenshots.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Screenshots'>");
		document.write("		<img border='0' src='"+strMenuRight+"16.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"1601.gif' width='130' height='18' hspace='6' title='Screenshots'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"16Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	
	if (intPageId != "17")
	{
		document.write("		<a href='17Trailers.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Trailers'>");
		document.write("		<img border='0' src='"+strMenuRight+"17.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"1701.gif' width='130' height='18' hspace='6' title='Trailers'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"17Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	
	document.write("	<TR>");
	document.write("	</TR>");
	document.write(" </TABLE>");
Alert('hey hi');
}


//-------------------------
function TBTopMenuTitle()
{
	document.write("<table border='0' width='100%' cellpadding='0' cellspacing='0' align='center' name='TBTopMenuTitle'>");
	document.write("	<tr>");
	document.write("		<td width='100%' valign='bottom' align='center' height='65' style=\"background-image: url('images/PageTop/Menu/background.jpg'); background-repeat: no-repeat; background-position: left top\">");
	MenuTop();
	document.write("		</td>");
	document.write("	</tr>");
	document.write("</table>");
Alert('TBTopMenuTitle');
}


//-------------------------
function TBTopPicsHome()
{
	var intFlashWidth = strFlashWidth * 1;
	intFlashWidth = ( ((intFlashWidth <= 0) || (intFlashWidth >= 604)) ? 604 : intFlashWidth );
	var intFlashHeight = strFlashHeight * 1;
	intFlashHeight = ( ((intFlashHeight <= 0) || (intFlashHeight >= 74)) ? 74 : intFlashHeight );
	strFlashFileSrc = ( IsEmpty(strFlashFileSrc) ? "images/PageTop/PageTop.gif" : strFlashFileSrc )
	document.write("<div align='center'>");
	document.write("<center>");
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' name='TBTopPics'>");
	document.write("	<tr>");
	document.write("		<td width='100%' valign='bottom' align='center' height='65' style=\"background-image: url('images/PageTop/Home/PageTop.jpg'); background-repeat: no-repeat; background-position: left top\">");
	document.write("	</tr>");
	document.write("</table>");
	document.write("</center>");
	document.write("</div>");
Alert('TBTopPicsHome');
}


//-------------------------
function TBTopPicsSecond()
{
	var intFlashWidth = strFlashWidth * 1;
	intFlashWidth = ( ((intFlashWidth <= 0) || (intFlashWidth >= 604)) ? 604 : intFlashWidth );
	var intFlashHeight = strFlashHeight * 1;
	intFlashHeight =  ( ((intFlashHeight <= 0) || (intFlashHeight >= 74)) ? 74 : intFlashHeight );
	strFlashFileSrc = ( IsEmpty(strFlashFileSrc) ? "images/PageTop/PageTop.gif" : strFlashFileSrc )
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' name='TBTopPics' align='center'>");
	document.write("	<tr align='left' valign='top'>");
	document.write("		<td width='100%' valign='bottom' align='center' height='65' style=\"background-image: url('images/PageTop/Home/PageTop.jpg'); background-repeat: no-repeat; background-position: left top\">");
	document.write("	</tr>");
	document.write("	<tr align='left' valign='top'>");
	document.write("		<td width='100%' height='2' class='TDBlackBorder' name='TDBlackBorderH'><img border='0' src='"+strTrans+"' width='20' height='2'></td>");
	document.write("	</tr>");
	document.write("</table>");
Alert('TBTopPicsSecond');
}


//-------------------------
function TBUnderTopMenuTitle_Top()
{
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%'  align='center' name='TBUnderTopMenuTitle'>");
	document.write("	<tr>");
	document.write("		<td width='6' valign='top' align='center' style=\"background-image: url('images/Home/lefttile.gif'); background-repeat: repeat-y; background-position: center top\"><img border='0' src='images/Home/lefttile.gif' width='6' height='25'></td>");
	document.write("		<td width='100%' bgcolor='#247C84' valign='top' align='center'>");
	if (blnIsHome)
		TBTopPicsHome();
	else
		TBTopPicsSecond();
	document.write("		</td>");
	document.write("		<td width='6' valign='top' align='center' style=\"background-image: url('images/Home/righttile.gif'); background-repeat: repeat-y; background-position: center top\"><img border='0' src='images/Home/righttile.gif' width='6' height='25'></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td width='6' valign='top' align='center' style=\"background-image: url('images/Home/lefttile.gif'); background-repeat: repeat-y; background-position: center top\"><img border='0' src='images/Home/lefttile.gif' width='6' height='25'></td>");
	document.write("		<td width='100%' valign='top' align='center'>");
Alert('TBUnderTopMenuTitle_Top');
}


//-------------------------
function TBUnderTopMenuTitle_Bottom()
{
	document.write("		</td>");
	document.write("		<td width='6' valign='top' align='center' style=\"background-image: url('images/Home/righttile.gif'); background-repeat: repeat-y; background-position: center top\"><img border='0' src='images/Home/righttile.gif' width='6' height='25'></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td width='6' valign='top' align='center' style=\"background-image: url('images/Home/lefttile.gif'); background-repeat: repeat-y; background-position: center top\"><img border='0' src='images/Home/lefttile.gif' width='6' height='25'></td>");
	document.write("		<td width='100%' valign='top' align='center'>");
	document.write("			<img border='0' src='images/Home/LineCopyright.gif' width='593' height='1'><br>");
	document.write("			<img border='0' src='"+strTrans+"' width='50' height='6'><br>");
	//document.write("			<img border='0' src='images/Copyright.gif' width='164' height='16'></td>");
	document.write("			<div align='center'><font class='SmallFont'><i>Copyright 2010 - Puya Arts Software, Inc.</i></font></div></td>");
	document.write("		<td width='6' valign='top' align='center' style=\"background-image: url('images/Home/righttile.gif'); background-repeat: repeat-y; background-position: center top\"><img border='0' src='images/Home/righttile.gif' width='6' height='25'></td>");
	document.write("	</tr>");
	document.write("</table>");
Alert('TBUnderTopMenuTitle_Bottom');
}


//-------------------------
function TBKolli01_Top()
{
	document.write("<div align='center'>");
	document.write("<table width='750' height='100%' border='0' cellspacing='0' cellpadding='0' align='center' name='TBKolli01'>");
	document.write("	<tr>");
	document.write("		<td>");
	document.write("		<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' xheight='658' name='TBKolli02'>");
	document.write("			<tr>");
	document.write("				<td width='100%' height='101' align=center valign=top><img src='images/Home/CurveTop.jpg' width='750' height='101'></td>");
	document.write("			</tr>");
	document.write("			<tr>");
	document.write("				<td width='100%' xheight='550' align=center valign=top>");
	document.write("				<table width='100%' border='0' cellspacing='0' cellpadding='0' name='TBKolli03'>");
	document.write("					<tr>");
	document.write("						<td width='66' align=center valign=top><img src='images/Home/CurveBackLeft.jpg' width='66' height='149'></td>");
	document.write("						<td width='100%' align=center valign=top bgcolor='#0A2C48'>");
	TBTopMenuTitle();
	TBUnderTopMenuTitle_Top();
Alert('TBKolli01_Top');
}


//-------------------------
function TBKolli01_Bottom()
{
	TBUnderTopMenuTitle_Bottom();
	document.write("						</td>");
	document.write("						<td width='68' align=center valign=top><img src='images/Home/CurveBackRight.jpg' width='68' height='149'></td>");
	document.write("					</tr>");
	document.write("				</table></td>");	//TBKolli03
	document.write("			</tr>");
	document.write("			<tr>");
	document.write("				<td width='100%' height='7' align=center valign=top><img border=0 src='images/Home/LineEnd.gif' width='750' height='7'></td>");
	document.write("			</tr>");
	document.write("		</table></td>");	//TBKolli02
	document.write("	</tr>");
	document.write("</table>");	//TBKolli01
	document.write("</div>");
Alert('TBKolli01_Bottom');
}


//-------------------------
function PageTop()
{
	TBKolli01_Top();
}


//-------------------------
function PageBottom()
{
	TBKolli01_Bottom();
}



//-------------------------
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


//-------------------------
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//-------------------------
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


//-------------------------
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//-------------------------
function DoPreloadImages()
{
	MM_preloadImages('images/PageTop/Menu/0101.jpg','images/PageTop/Menu/0201.gif','images/PageTop/Menu/0301.gif','images/PageTop/Menu/0401.gif','images/PageTop/Menu/0501.gif','images/PageRight/Menu/0601.gif','images/PageRight/Menu/0701.gif','images/PageRight/Menu/0801.gif','images/PageRight/Menu/0901.gif','images/trans.gif');
}


//-------------------------
function Trim(StrValue)
{
	var st = StrValue;
	while ((st.length > 0) && (st.charAt(0) == " ")) 
		st = st.substring(1, st.length);
	while ((st.length > 0) && (st.charAt(st.length-1) == " "))    
		st = st.substring(0, st.length-1);  
	return st;
}


//-----------------------------------
function IsEmpty(st)
{
	st = Trim(st);
	return (st.length == 0);
}




//---------------------------------------------- ver. 1.5 functions ----------------------------------------------
//-------------------------
function x1p5_TBTopMenuTitle()
{
	document.write("<table border='0' width='100%' cellpadding='0' cellspacing='0' align='center' name='TBTopMenuTitle'>");
	document.write("	<tr>");
	document.write("		<td width='100%' valign='bottom' align='center' height='65' style=\"background-image: url('images/PageTop/Menu/background.jpg'); background-repeat: no-repeat; background-position: left top\">");
	if (blnIsHome)
	{
		document.write("			<img border='0' src='"+strTrans+"' width='616' height='47'>");
	}
	else
	{
		document.write("			<map name='FPMap0'><area href='index.html' shape='rect' coords='20, 10, 210, 40' title='Quest of Persia Homepage'></map>");
		document.write("			<img border='0' src='"+strTrans+"' width='616' height='47' usemap='#FPMap0'>");
	}
	MenuTop();
	document.write("		</td>");
	document.write("	</tr>");
	document.write("</table>");
Alert('TBTopMenuTitle');
}
//-------------------------
function x1p5_MenuTop()
{
	var strMenuTop = "images/PageTop/Menu/";
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' height='18' align='center' name='TBTopMenu'>");
	document.write("	<tr>");
	
	document.write("		<td width='100%'>&nbsp;</td>");
	
	if (intPageId != "01")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='01News.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='News'><img border='0' src='"+strMenuTop+"01.gif' width='71' height='18' hspace=2></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0101.gif' width='71' height='18' hspace=2></td>");
	}
	
	if (intPageId != "02")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='02Story.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Story'><img border='0' src='"+strMenuTop+"02.gif' width='71' height='18' hspace=1></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0201.gif' width='71' height='18' hspace=1></td>");
	}
	
	if (intPageId != "03")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='03GameDemo.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Game Demo'><img border='0' src='"+strMenuTop+"03.gif' width='71' height='18' hspace=2></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0301.gif' width='71' height='18' hspace=2></td>");
	}
	
	if (intPageId != "04")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='04DevTeam.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Dev Team'><img border='0' src='"+strMenuTop+"04.gif' width='71' height='18' hspace=1></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0401.gif' width='71' height='18' hspace=1></td>");
	}
	
	if (intPageId != "05")
	{
		document.write("	<td width='71'>");
		document.write("		<a href='05Contact.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Contact'><img border='0' src='"+strMenuTop+"05.gif' width='71' height='18' hspace=2></a></td>");
	}
	else
	{
		document.write("	<td width='71'>");
		document.write("		<img border='0' src='"+strMenuTop+"0501.gif' width='71' height='18' hspace=2></td>");
	}
	
	document.write("		<td width='10'><img border='0' src='"+strTrans+"' width='10' height='18'></td>");
	
	document.write("	</tr>");
	document.write("</table>");
Alert('hi');
}
//-------------------------
function x1p5_MenuRight()
{
	var strMenuRight = "images/PageRight/Menu/";
	document.write("<TABLE WIDTH=100% ALIGN=center BORDER=0 CELLSPACING=0 CELLPADDING=0 name=TBMenuRight>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='9'><br>");
	if (intPageId != "06")
	{
		document.write("		<a href='06Characters.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Characters'>");
		document.write("		<img border='0' src='"+strMenuRight+"06.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"0601.gif' width='130' height='18' hspace='6'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"06Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");

	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	if (intPageId != "07")
	{
		document.write("		<a href='07ArgEBam.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Arg-e-Bam'>");
		document.write("		<img border='0' src='"+strMenuRight+"07.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"0701.gif' width='130' height='18' hspace='6'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"07Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	if (intPageId != "08")
	{
		document.write("		<a href='08Weapons.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Weapons'>");
		document.write("		<img border='0' src='"+strMenuRight+"08.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"0801.gif' width='130' height='18' hspace='6'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"08Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	if (intPageId != "10")
	{
		document.write("		<a href='103dmodels.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='3D Models'>");
		document.write("		<img border='0' src='"+strMenuRight+"10.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"1001.gif' width='130' height='18' hspace='6'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"10Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	
	if (intPageId != "11")
	{
		document.write("		<a href='11animations.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Animations'>");
		document.write("		<img border='0' src='"+strMenuRight+"11.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"1101.gif' width='130' height='18' hspace='6'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"11Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
	document.write("	<TR>");
	document.write("		<TD width=100% align=center valign=top>");
	document.write("			<img border='0' src='"+strTrans+"' width='130' height='7'><br>");
	
	if (intPageId != "09")
	{
		document.write("		<a href='09Objects.htm' onMouseOver='SwapIn()' onMouseOut='SwapOut()' title='Objects'>");
		document.write("		<img border='0' src='"+strMenuRight+"09.gif' width='130' height='18' hspace='6'></a><br>");
	}
	else
	{
		document.write("		<img border='0' src='"+strMenuRight+"0901.gif' width='130' height='18' hspace='6'><br>");
	}
	document.write("			<img border='0' src='"+strMenuRight+"09Pic.gif' width='130' height='56' hspace='6'></TD>");
	document.write("	</TR>");
	
	document.write("	<TR>");
	document.write("	</TR>");
	document.write(" </TABLE>");
Alert('hey hi');
}
//-------------------------
function x1p5_TBTopPicsHome()
{
	document.write("<div align='center'>");
	document.write("<center>");
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' name='TBTopPics'>");
	document.write("	<tr>");
	document.write("		<td width='100%'>");
	document.write("			<p style='margin-left: 15; margin-right: 15'><font class='SmallFont'>");
	document.write("			Quest of Persia is a game series about Persian history and civilization, it starts from the Ghajar- Zand era and goes back all the way to ancient Iran. The game covers wide range of adventures, and game play based on the historic events.</font></p></td>");
	document.write("		<td width='105'><img border='0' src='images/PageTop/Home/pic01.jpg' width='105' height='77' vspace=2 hspace=6></td>");
	document.write("		<td width='105'><img border='0' src='images/PageTop/Home/pic02.jpg' width='105' height='77' vspace=2 hspace=2></td>");
	document.write("		<td width='105'><img border='0' src='images/PageTop/Home/pic03.jpg' width='105' height='77' vspace=2 hspace=6></td>");
	document.write("	</tr>");
	document.write("</table>");
	document.write("</center>");
	document.write("</div>");
Alert('TBTopPicsHome');
}
//-------------------------
function x1p5_TBTopPicsSecond()
{
	document.write("<table border='0' cellpadding='0' cellspacing='0' width='100%' name='TBTopPics' align='center'>");
	document.write("	<tr align='left' valign='top'>");
	document.write("		<td width='11'><img border='0' src='"+strTrans+"' width='11' height='11'></td>");
	document.write("		<td width='67'><img border='0' src='" +strTBTopPics+ "pic01.jpg' width='61' height='61' vspace=8 hspace=4></td>");
	document.write("		<td width='33%'>");
	document.write("			<img border='0' src='"+strTrans+"' width='17' height='17'><br>");
	document.write("			<img border='0' src='images/PageTop/Second/Xsmall.jpg' width='9' height='10'><font class='TBTopPicsTitle'>&nbsp;&nbsp;" +strTitle01+ "</font><br>");
	document.write("			<font class='TBTopPicsText'>" +strText01+ "</font></td>");
	document.write("		<td width='11'><img border='0' src='"+strTrans+"' width='11' height='11'></td>");
	document.write("		<td width='67'><img border='0' src='" +strTBTopPics+ "pic02.jpg' width='61' height='61' vspace=8 hspace=4></td>");
	document.write("		<td width='34%'>");
	document.write("			<img border='0' src='"+strTrans+"' width='17' height='17'><br>");
	document.write("			<img border='0' src='images/PageTop/Second/Xsmall.jpg' width='9' height='10'><font class='TBTopPicsTitle'>&nbsp;&nbsp;" +strTitle02+ "</font><br>");
	document.write("			<font class='TBTopPicsText'>" +strText02+ "</font></td>");
	document.write("		<td width='11'><img border='0' src='"+strTrans+"' width='11' height='11'></td>");
	document.write("		<td width='67'><img border='0' src='" +strTBTopPics+ "pic03.jpg' width='61' height='61' vspace=8 hspace=4></td>");
	document.write("		<td width='33%'>");
	document.write("			<img border='0' src='"+strTrans+"' width='17' height='17'><br>");
	document.write("			<img border='0' src='images/PageTop/Second/Xsmall.jpg' width='9' height='10'><font class='TBTopPicsTitle'>&nbsp;&nbsp;" +strTitle03+ "</font><br>");
	document.write("			<font class='TBTopPicsText'>" +strText03+ "</font></td>");
	document.write("		<td width='11'><img border='0' src='"+strTrans+"' width='11' height='11'></td>");
	document.write("	</tr>");
	document.write("	<tr align='left' valign='top'>");
	document.write("		<td width='100%' height='2' colspan=10 class='TDBlackBorder' name='TDBlackBorderH'><img border='0' src='"+strTrans+"' width='20' height='2'></td>");
	document.write("	</tr>");
	document.write("</table>");
Alert('TBTopPicsSecond');
}
