function ConvertLang(langtype)
{
  var strURL=new String(window.location); 
  //change file from xxx_c.html to xxx_e.html or vise verse
  if(strURL.search(/_[ce]\./g)>-1)
  {
    strURL = strURL.replace(/_[ce]\./g,"_" + langtype + ".");
  }
  //update/add language (lang=) query string
  if(strURL.search(/lang=[ce]/g)>-1)
  {
    strURL = strURL.replace(/lang=[ce]/g,"lang=" + langtype);
  }else{
    if(strURL.search(/\?/g)>-1)
    {
      if(strURL.search(/\?[\w\W]/g)>-1) //have ? and more characters
        strURL = strURL + "&lang=" + langtype;
      else				// have ? only
        strURL = strURL + "lang=" + langtype;
    }else{
      strURL = strURL + "?lang=" + langtype;
    }
  }
  //alert(strURL);
  window.location = strURL;
  return false;
}

  
function GetFileName()
{
  var curLocation = new String(window.location);
  //var strArray = curLocation.split("/");
  //var strFile = strArray[strArray.length-1].split("#")[0].split("?")[0];
  var strArray;
   strArray = curLocation.replace("lang=c","");
   strArray = strArray.replace("lang=e","");
   strArray = strArray.replace("content=intro","");
  //var strFile = strArray[strArray.length-1].split("#")[0].split("?")[0];
  var strFile = strArray
  return strFile;
}
function GetLangType()
{
  var curLocation = new String(window.location);
  var strArray = curLocation.split("lang=");
  if(strArray.length==2)
  {   
    return strArray[1].substr(0,1); //'c'	

  }else
  {
    return 'e';	
  }
}
function GetScrollTo()//used for pray page
{
  var curLocation = new String(window.location);
  var strArray = curLocation.split("scrollto=");
  if(strArray.length==2)
  {   
    return strArray[1].split("#")[0].split("&")[0];

  }else
  {
    return '';	
  }
}
function GetContent()
{
  var curLocation = new String(window.location);
  var strArray = curLocation.split("content=");
  if(strArray.length==2)
  {   
    	return strArray[1].split("#")[0].split("&")[0];

  }else
  {
    return 'intro';	
  }
}
var langType = GetLangType();
var pageContent = GetContent();
var strFile = GetFileName();

document.write('<HEAD>');
document.write('<TITLE>Pray For China</TITLE>');
document.write('<STYLE>');
document.write('   A{color:#eae9b9;}');
document.write('   DIV{color:#eae9b9;}');
document.write('   <META name="Keywords" content="pray,prayer,China,Chinese,for">');
document.write('   <META name="Description" content="Pray for China">');
document.write('</STYLE>');
document.write('</HEAD>');
document.write('<BODY bgColor=#990000 leftMargin=0 topMargin=0>');
document.write('');
document.write('<MAP NAME="EnglishChineseMap">');
document.write('<AREA title="Display in Chinese" onClick="ConvertLang(\'c\');" COORDS="93,26,268,75">');
document.write('<AREA title="Display in Chinese" onClick="ConvertLang(\'c\');" COORDS="146,75,312,107">');
document.write('<AREA title="Display in English" onClick="ConvertLang(\'e\');" COORDS="268,43,362,75">');
document.write('<AREA title="Display in English" onClick="ConvertLang(\'e\');" COORDS="310,75,430,108">');
document.write('</MAP>');
document.write('');
document.write('<TABLE cellspacing=0 cellpadding=0 height=100% width="100%">');
document.write('  <TR>');
document.write('    	<TD valign="bottom" align="left" height=120>');
document.write('<div style="margin-top:0px"><IMG border=0 src="images/title.gif" USEMAP="#EnglishChineseMap" style="left:0px;top:0px;position:absolute;z-index: 1;"></div>');

//START Advertisement

/*  
document.write('<br><table width="550" border="0">');
document.write('  <TR>');
document.write('<td width="150" align ="center" valign="bottom">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/2010CCoverS2.JPG" width="134" height="99" style="z-index: 2;"></td>');
document.write('<td width="400">');
document.write('<br><br><br><br><br><br><br><br>');
if(langType=='c')
{
 document.write('    	   <div style="margin-bottom:5px"><a href="orderindex_c.html?lang=c" target="_brank"><strong><font size="5">&#26368;&#26032;&#29256; 2010 &#33707;&#24536;&#20013;&#33775;&#26376;&#26310;&#35338;&#24687;</a></font></strong></div>');
}else{
 document.write('    	   <div style="margin-bottom:5px"><a href="orderindex_e.html?lang=e" target="_brank"><strong><font size="5">NEW! 2010 Calendar Information</a></font></strong></div>');
}
document.write('<div style="margin-bottom:5px"><a href="orderindex_c.html?lang=c" target="_brank">&#35330;&#36092;&#20013;&#25991;&#31153;&#21578;&#26376;&#26310; Order Chinese Calendar</a></div>');
document.write('<div style="margin-bottom:5px"><a href="orderindex_e.html?lang=e" target="_brank">&#35330;&#36092;&#33521;&#25991;&#31153;&#21578;&#26376;&#26310; Order English Calendar</a></div>')
document.write('</td></TR>')
document.write(' </table>');
document.write('<br>');
*/
//END Advertisement


document.write('    	</TD>');
document.write('    	<TD valign="top" align="center" height=120>');
document.write('		<div align="right" style=" width:400px;">');
document.write('			<br><b>');
if(langType=='c')
{
  document.write('      			<IMG src="Images/ChineseMenu2.gif" Border="0" onClick="ConvertLang(\'c\');"></IMG>&nbsp;<IMG src="Images/EnglishMenu2.gif" Border="0" onClick="ConvertLang(\'e\');"></IMG><br>');
  //document.write('      			<FONT><a href="Intro.html?lang=c&content=intro' + '">&#26412;&#31449;&#20171;&#32057;</a></FONT><br>');  //John asked to removed it on 1/6/2010
  //document.write('      			<FONT><a href="Intro.html?lang=c&content=why' + '">&#28858;&#20309;&#20351;&#29992;&#26412;&#26376;&#26310;</a></FONT><br>');
  document.write('      			<FONT><a href="Why.html?lang=c' + '">&#28858;&#20309;&#20351;&#29992;&#26412;&#26376;&#26310;</a></FONT><br>');
  document.write('      			<FONT><a href="Index.asp?lang=c">&#26412;&#26085;&#20195;&#31153;&#20107;&#38917;</a></FONT><br>');
  //document.write('      			<FONT><a href="Order_c.html?lang=c" target="_blank"><img src="images/new1.gif" align="absMiddle" border="0" />&#35330;&#36092;&#20195;&#31153;&#26376;&#26310;</a></FONT><br>');	
  document.write('      			<FONT><a href="Order_c.html?lang=c" target="_blank">&#35330;&#36092;&#20195;&#31153;&#26376;&#26310;</a></FONT><br>');
  document.write('      			<FONT><a href="Intro.html?lang=c&content=cover' + '">&#23553;&#38754;&#27171;&#21697;</a></FONT><br>');
  document.write('      			<FONT><a href="calendar.asp?lang=c">&#26376;&#26310;</a></FONT><br>');
  document.write('      			<FONT><a href="Map.htm?lang=c">&#22320;&#22294;</a></FONT><br>');
  document.write('      			<FONT><a href="Profiles_c.htm?lang=c">&#26377;&#24433;&#38911;&#21147;&#30340;&#20013;&#22283;&#22522;&#30563;&#24466;</a></FONT><br>');  
  document.write('      			<FONT><a href="ProfilesW_c.htm?lang=c">&#20358;&#33775;&#22522;&#30563;&#23459;&#25945;&#22763;&#31777;&#20171;</a></FONT><br>');  
  document.write('      			<FONT><a href="GBooks.asp?lang=c">&#35370;&#23458;&#30331;&#35352;</a></FONT><br>');  
  document.write('      			<FONT><a href="links.html?lang=c">&#32178;&#31449;&#36899;&#32080;</a></FONT>');
}else
{
  document.write('      			<IMG src="Images/ChineseMenu2.gif" Border="0" onClick="ConvertLang(\'c\');"></IMG>&nbsp;<IMG src="Images/EnglishMenu2.gif" Border="0" onClick="ConvertLang(\'e\');"></IMG><br>');
  //document.write('      			<FONT><a href="Intro.html?lang=e&content=intro' + '">Introduction</a></FONT><br>');  //John asked to remove it on 1/6/2010
  //document.write('      			<FONT><a href="Intro.html?lang=e&content=why' + '">Why use this calendar?</a></FONT><br>');
  document.write('      			<FONT><a href="Why.html?lang=e' + '">Why use this calendar?</a></FONT><br>');
  document.write('      			<FONT><a href="Index.asp?lang=e">Today\'s Prayer Item</a></FONT><br>');
  //document.write('      			<FONT><a href="Order_e.html?lang=e" target="_blank"><img src="images/new1.gif" align="absMiddle" border="0" />Order a Prayer Calendar</a></FONT><br>');
  document.write('      			<FONT><a href="Order_e.html?lang=e" target="_blank">Order a Prayer Calendar</a></FONT><br>');
  document.write('      			<FONT><a href="Intro.html?lang=e&content=cover' + '">Calendar Cover</a></FONT><br>');
  document.write('      			<FONT><a href="calendar.asp?lang=e">Prayer Items by Month</a></FONT><br>');
  document.write('      			<FONT><a href="Map.htm?lang=e">Prayer Items by Region</a></FONT><br>');
  document.write('      			<FONT><a href="Profiles_e.htm?lang=e">Profiles of Famous Chinese Christians</a></FONT><br>');
  document.write('      			<FONT><a href="ProfilesW_e.htm?lang=e">Profiles of Missionaries</a></FONT><br>');
  document.write('      			<FONT><a href="GBooks.asp?lang=e">&#71;&#117;&#101;&#115;&#116;&#32;&#66;&#111;&#111;&#107;</a></FONT><br>');
  document.write('      			<FONT><a href="links.html?lang=e">Links</a></FONT>');
}
document.write('			</b>');
document.write('		</div>');
document.write('	</TD>');
document.write('');
document.write('  </TR>');
document.write('  <TR>');
document.write('    	<TD align="center" colSpan="2">');