// Root Menu
var Channel = new Array();
Channel[1] = new channel('Home','index.html',1,'Homepage');
Channel[2] = new channel('Advice','advice.html',2,'Advice for planning and travelling.');
Channel[3] = new channel('Photos','photo-04-1.html',3,'My photo library.');
Channel[4] = new channel('Books','books.html',4,'Great books to read about Trans-Siberia and the countries it passes.');
Channel[5] = new channel('Tours','tours.html',5,'Ready made tours and useful travel agents.'); 
Channel[6] = new channel('Stories','my2004tour.html',6,'Trans-Siberian stories.'); 
Channel[7] = new channel('Useful sites','links.html',7,'Other useful sites about Trans-Siberia');
Channel[8] = new channel('Guest Book','guestbook.html',8,'Do you have comments or advice for others?');
Channel[9] = new channel('Contact Us','contact.html',9,'Contact us to promote your service or ask advice?');


// menu building
function channel(menuName, url, csn, title)
{
	this.menuName = menuName;
	this.url = url;
	this.csn = csn;
	this.title = title;
}

function createChannels()
{
	document.write('<br><table align="left" width="100" border="0" cellspacing="0" cellpadding="0">');
	for (var i=1; i < Channel.length; i++)
	{

		if (Channel[i].csn == channelid)
		{
			myclass = "leftmenu"
			mybg = "bgcolor=#ffffff"
			document.write('<tr><td valign="middle" height="20px"' + mybg + '>&nbsp;<font class=' + myclass + '>'	+ Channel[i].menuName +	'</font></td></tr>');
			createSubchannels()
		}
		else
		{
			myclass = "leftmenu"
			mybg = "bgcolor=#ffffff"
			document.write('<tr><td valign="middle" height="20px"' + mybg + '>&nbsp;<a href="'
			+ Channel[i].url + '" class="' + myclass + '" title="' + Channel[i].title + '">'	+ Channel[i].menuName +	'</a></td></tr>');
			}
	}
//	WriteGoogleSearch()
	WriteLeftAd();
	document.write('</table>');
}



function createSubchannels()
{
	for (var i=1; i < subChannel.length; i++)
	{

		if (subChannel[i].csn == channelcsn)
		{
			mysubclass = "leftsubmenu"
			mysubbg = "bgcolor=#ffffff"
			bcsc_menuName = subChannel[i].menuName
			bcsc_URL = subChannel[i].url
			document.write('<tr><td valign="middle"' + mysubbg + '>&nbsp;&nbsp;<font size="-3">&raquo;</font><font class=' + mysubclass + '>'+
			subChannel[i].menuName +'</font>&nbsp;</td></tr>');
		}
		else
		{
			mysubclass = "leftsubmenu"
			mysubbgcolor = "#ffffff"
			document.write('<tr><td valign="middle">&nbsp;&nbsp;<font size="-3">&raquo;</font><a href="'
			+ subChannel[i].url + '" class="' + mysubclass +  '" title="' + subChannel[i].title + '">'	+ subChannel[i].menuName +
			'</a>&nbsp;</td></tr>');
		}

	}
}

function faq(question, answer)
{
	this.question = question;
	this.answer = answer;
}


// write HR to space FAQ's
function WriteFAQline()
{
document.write('<table cellspacing="0" cellpadding="1" border="0">');
document.write('<tr>');
document.write('	<td align="center" width="100"><img src="images/1x1-FFFFFF.jpg" width="104" height="1" alt="" border="0"></td>');
document.write('	<td align="center" width="*"><img src="images/1x1-820082.jpg" width="360" height="1" alt="" border="0"></td>');
document.write('	<td align="center" width="100"><img src="images/1x1-FFFFFF.jpg" width="10" height="1" alt="" border="0"></td>');
document.write('</tr>');
document.write('</table>');
}

function WriteFAQ() 
{
	for (var i=1; i < Faq.length; i++)
	{
	document.write('<p><font class="q-question">' +  Faq[i].question + '</font><br><font class="q-answer">' + Faq[i].answer + '</font></p>');
	WriteFAQline()
	}
}



// write masterhead
function WriteMasterHead()
{
document.write('<table width="760" align="center" cellspacing="0" cellpadding="0" border="0" bordercolor="green">')
document.write('<tr>')
document.write('<td align="center" valign="middle"><a accesskey="1" href="index.html"><img src="images/1997-Trans-Siberia-107.jpg" width="760" height="90" alt="Trans-Siberia.com - all you need to know to help plan your journey across siberia on the Trans-Siberian Railway including tours, books, advice and photos" border="0"></a></td>')
document.write('</tr>')
document.write('</table>')
}


// write masterhead
function WriteMaster()
{
document.write('<table width="760" bgcolor="#cccc99" align="center" cellspacing="0" cellpadding="0" border="0">')
document.write('<tr>')
document.write('<td height="80" width="20" align="left" valign="middle"></td>')
document.write('<td height="80" width="185" align="left" valign="middle"><a accesskey="1" href="index.html"><img src="images/top_logo.jpg" width="185" height="60" alt="Trans-Siberia.com - all you need to know to help plan your journey across siberia on the Trans-Siberian Railway including tours, books, advice and photos" border="0"></a></td>')
document.write('<td height="80" width="*" align="right" valign="middle"><A HREF="http://www.amazon.co.uk/exec/obidos/redirect-home/gm44" target=_blank><img src="images/amazon-co-uk.gif" width="468" height="60" alt="Amazon Books" border="0"></a></td>')
document.write('<td height="80" width="20" align="right" valign="middle"></td>')
document.write('</tr>')
document.write('</table>')
}

//write right hand tower - AMAZON
function WriteRightTower_amazon()
{
document.write('<iframe width="120" height="476" scrolling="no" frameborder=0 src="http://rcm-uk.amazon.co.uk/e/cm?t=gm44&l=st1&search=travel%20siberia&mode=books-uk&p=10&o=2&f=ifr&bg1=F7FFCE&lt1=_blank"> <table border="0" cellpadding="0" cellspacing="0" width="120" height="476"><tr><td><A HREF="http://www.amazon.co.uk/exec/obidos/redirect-home/gm44" target=_blank><img src="http://images-eu.amazon.com/images/G/02/associates/recommends/default_120x476.gif" width="120" height="476" border="0" access=regular></a></td></tr></table></iframe>')
}

//write left hand tower - TRE brochure
function WriteLeftAd()
{
if ((channelid != 1) )
	{
	document.write('<tr><td>')
	document.write('<br>')
	document.write('<div id="brochureAd"><a href="tours-brochure-tre.html"><img src="images/brochure-cover-tre.jpg" width="69" height="89" alt="Free 2008-9 Brochure now available" border="0"><br>Free Tour Brochure</a></div>')
	document.write('<tr><td>')
	}
}

//write left hand tower - AMAZON
function WriteLeftAdAmazon()
{
if ((channelid != 1) && (channelid != 4) )
	{
	document.write('<tr><td>')
	document.write('<br>')
	document.write('<iframe width="120" height="268" scrolling="no" frameborder=0 src="http://rcm-uk.amazon.co.uk/e/cm?t=gm44&l=st1&search=trans-siberia&mode=books-uk&p=8&o=2&f=ifr"> <table border="0" cellpadding="0" cellspacing="0" width="120" height="268"><tr><td><A HREF="http://www.amazon.co.uk/exec/obidos/redirect-home/gm44" target=_blank><img src="http://images-eu.amazon.com/images/G/02/associates/recommends/default_120x268.gif" width=120 height=268 border="0" access=regular></a></td></tr></table></iframe> ')
	document.write('<tr><td>')
	}
}




//write right hand tower - GOOGLE
function WriteRightTower()
{
google_ad_client = "pub-6925367576614524";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_channel ="1264868930";
google_ad_type = "text";
google_color_border = "006600";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr' + 'ipt>')
}


//write right hand tower - GOOGLE
function WriteRightTowerBooks()
{
google_ad_client = "pub-6925367576614524";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_channel ="5611321931";
google_ad_type = "text";
google_color_border = "006600";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr' + 'ipt>')
}



// write page footer - Amazon
function WriteFooterAd()
{

document.write('<div align="center"><!--START MERCHANT:merchant name Buyagift.co.uk from affiliatewindow.com.--><a href="http://www.awin1.com/cread.php?s=32943&v=273&q=2447&r=73555"><img src="http://www.awin1.com/cshow.php?s=32943&v=273&q=2447&r=73555" border="0" /></a> <!--END MERCHANT:merchant name Buyagift.co.uk from affiliatewindow.com--></div>')


if (channelid != 4)
	{
	document.write('<iframe width="468" height="82" scrolling="no" frameborder=0 src="http://rcm-uk.amazon.co.uk/e/cm?t=gm44&l=st1&search=trans-siberia&mode=books-uk&p=13&o=2&f=ifr"> <table border="0" cellpadding="0" cellspacing="0" width="468" height="82"><tr><td><A HREF="http://www.amazon.co.uk/exec/obidos/redirect-home/gm44" target=_blank><img src="http://images-eu.amazon.com/images/G/02/associates/recommends/default_468x82.gif" width="468" height="82" border="0" access=regular></a></td></tr></table></iframe>')
	}
}


// write page footer - Google
function WriteFooterAd_google()
{
google_ad_client = "pub-6925367576614524";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_ad_type = "text";
document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr' + 'ipt><br>');
}


// write page footer
function WriteFooter()
{
document.write('<br><p><a class="footer" href="index.html" accesskey="h" title="Trans-Siberia.com homepage">Home</a> | <a class="footer" href="privacy.html" accesskey="p" title="Our website privacy policy">Privacy Policy</a> | <a class="footer" href="disclaimer.html" accesskey="d" title="Ensure you read this discaimer">Disclaimer</a> | <a class="footer" href="contact.html" accesskey="c" title="Who do I contact for more information?">Contact Us</a><br><font class="footer">&copy; John Pannell 2010</font></p>');
}

// Popup window
function pop(url, name, width, height, features) {
	popWin = window.open(url, name, 'width=' + width + ',height=' + height + ',resizable' + ((features) ? ',' + features : ''));
	if (window.focus) setTimeout("popWin.focus()",100);
	}

// Show time
function showTime()
{
  var days = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
  var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
  var now = new Date();
  var day = now.getDay();
  var today = now.getDate();
  var month = now.getMonth();
  var year = now.getFullYear();
	dateStamp = days[day] + ' ' + two_digit(today) + ' ' + months[month] + ' ' + year; document.write('<span class="clock">' + dateStamp + '</span>');
}

// convert to 2-digits
function two_digit(value)
{
    var s = value + '';
    if (s.length == 1)
      return('0' + s); else
        return(s);
}	
	
// Write Google search in left menu table
function WriteGoogleSearch()
{
document.write('<tr><td>')
document.write('<br>')
document.write('<!-- SiteSearch Google -->')
document.write('<form method="get" action="http://www.google.com/custom" target="_top">')
document.write('<tr><td nowrap="nowrap" valign="top" align="left" height="32">')
document.write('<a href="http://www.google.com/">')
document.write('<img src="http://www.google.com/logos/Logo_25wht.gif"')
document.write('border="0" alt="Google"></img></a>')
document.write('</td>')
document.write('<td nowrap="nowrap">')
document.write('<input type="hidden" name="domains" value="www.trans-siberia.com"></input>')
document.write('<input type="text" name="q" size="50" maxlength="255" value=""></input>')
document.write('<input type="submit" name="sa" value="Search"></input>')
document.write('</td></tr>')
document.write('<tr>')
document.write('<td nowrap="nowrap">')
document.write('<table>')
document.write('<tr>')
document.write('<td>')
document.write('<input type="radio" name="sitesearch" value="" checked="checked"></input>')
document.write('<font size="-1" color="#000000">Web</font>')
document.write('</td>')
document.write('<td>')
document.write('<input type="radio" name="sitesearch" value="www.trans-siberia.com"></input>')
document.write('<font size="-1" color="#000000">www.trans-siberia.com</font>')
document.write('</td>')
document.write('</tr>')
document.write('</table>')
document.write('<input type="hidden" name="client" value="pub-6925367576614524"></input>')
document.write('<input type="hidden" name="forid" value="1"></input>')
document.write('<input type="hidden" name="ie" value="ISO-8859-1"></input>')
document.write('<input type="hidden" name="oe" value="ISO-8859-1"></input>')
document.write('<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>')
document.write('<input type="hidden" name="hl" value="en"></input>')
document.write('</td></tr></table>')
document.write('</form>')
document.write('<!-- SiteSearch Google -->')
document.write('</td></tr>')
}

