
function Section(title, subSections){
	this.title = title;
	this.subSections = subSections;
	this.url=subSections[0].url;
}

function SubSection(title, url){
	this.title = title;
	this.url = url;
}

function Menu(){
	this.sectionStyleClass="section";
	this.selectedSectionClass="subsection";
	this.subSectionStyleClass="section_selected";
	this.selectedSubSectionStyleClass="subsection_selected";
	
	this.selectedSection = null;
	this.selectedSubSection = null;
	
	this.sections = new Array();
	
	var subSections = new Array();
	this.home_blog=0;
	subSections[this.home_blog]=new SubSection("Blog", "http://journals.rpungin.fotki.com/blog/");
	this.home_calendar=1;
	subSections[this.home_calendar]=new SubSection("Calendar", "http://raphaelpungin.com/calendar/");
	this.home_search=2;
	subSections[this.home_search]=new SubSection("Search", "http://raphaelpungin.com/search/");
	this.home_about=3;
	subSections[this.home_about]=new SubSection("About Me","http://journals.rpungin.fotki.com/about/");
	this.home_contact=4;
	subSections[this.home_contact]=new SubSection("Contact Me", "http://raphaelpungin.com/contact/");
	this.home_guestbook=5;
	subSections[this.home_guestbook]=new SubSection("Guestbook", "http://guestbook.rpungin.fotki.com/");
	this.home_links=6;
	subSections[this.home_links]=new SubSection("Links", "http://links.rpungin.fotki.com/");
	this.home_webcam=7;
	subSections[this.home_webcam]=new SubSection("Webcam", "http://raphaelpungin.com/webcam/");
	this.home=0;
	this.sections[this.home] = new Section("Home", subSections);
	
	subSections = new Array();
	this.photos_new=0;
	subSections[this.photos_new] = new SubSection("New and Updated Albums", "http://new.rpungin.fotki.com/");
	this.photos_all=1;
	subSections[this.photos_all] = new SubSection("All Albums", "http://rpungin.fotki.com/");
	this.photos_map=2;
	subSections[this.photos_map] = new SubSection("World Map", "http://journals.rpungin.fotki.com/map/");
	this.photos_tags=3;
	subSections[this.photos_tags] = new SubSection("Photo Tags", "http://search.rpungin.fotki.com/");
	this.photos_comments=4;
	subSections[this.photos_comments] = new SubSection("All Photo Comments", "http://comments.rpungin.fotki.com");
	this.photos_prints=5;
	subSections[this.photos_prints] = new SubSection("Buy Prints", "http://cart.fotki.com/prints/");
	this.photos=1;
	this.sections[this.photos] = new Section("Photos", subSections);

	subSections = new Array();
	this.videos_youtube=0;
	subSections[this.videos_youtube] = new SubSection("YouTube.com", "http://raphaelpungin.com/videos/youtube");
	this.videos_posted=1;
	subSections[this.videos_posted] = new SubSection("RealMedia By Date Posted", "http://raphaelpungin.com/videos/");
	this.videos_taken=2;
	subSections[this.videos_taken] = new SubSection("RealMedia By Date Taken", "http://raphaelpungin.com/videos/?sort=taken");
	this.videos=2;
	this.sections[this.videos] = new Section("Videos", subSections);

	subSections = new Array();
	this.dance_blog=0;
	subSections[this.dance_blog] = new SubSection("Dance Blog", "http://journals.rpungin.fotki.com/dance/");
	this.dance_dwts=1;
	subSections[this.dance_dwts] = new SubSection("Dancing With The Stars", "http://journals.rpungin.fotki.com/dwts/");
	this.dance_scd=2;
	subSections[this.dance_scd] = new SubSection("Strictly Come Dancing", "http://journals.rpungin.fotki.com/scd/");
	this.dance_tzg=3;
	subSections[this.dance_tzg] = new SubSection("Taniec z gwiazdami", "http://journals.rpungin.fotki.com/tzg/");
	this.dance_videos=4;
	subSections[this.dance_videos] = new SubSection("Dance Videos", "http://raphaelpungin.com/videos/?category=Dance");
	this.dance_ddr=5;
	subSections[this.dance_ddr] = new SubSection("Dance Dance Revolution", "http://journals.rpungin.fotki.com/ddr/");
	this.dance=3;
	this.sections[this.dance] = new Section("Dance", subSections);

	subSections = new Array();
	this.karaoke_blog=0;
	subSections[this.karaoke_blog] = new SubSection("Karaoke Blog", "http://journals.rpungin.fotki.com/karaoke/");
	this.karaoke_catalog=1;
	subSections[this.karaoke_catalog] = new SubSection("My Song Catalog", "http://raphaelpungin.com/karaoke/catalog/");
	this.karaoke_photos=2;
	subSections[this.karaoke_photos] = new SubSection("Karaoke Photos", "http://rpungin.fotki.com/parties/karaoke/");
	this.karaoke_videos=3;
	subSections[this.karaoke_videos] = new SubSection("Karaoke Videos", "http://raphaelpungin.com/videos/?category=Karaoke");
	this.karaoke_lyrics=4
	subSections[this.karaoke_lyrics] = new SubSection("Lyrics", "http://journals.rpungin.fotki.com/lyrics/");
	this.karaoke=4;
	this.sections[this.karaoke] = new Section("Karaoke", subSections);
	
	subSections = new Array();
	this.music_about=0;
	subSections[this.music_about] = new SubSection("About My Music", "http://journals.rpungin.fotki.com/music/category/about");
	this.music_compositions=1;
	subSections[this.music_compositions] = new SubSection("My Original Compositions", "http://journals.rpungin.fotki.com/music/category/compositions/");
	this.music_covers=2;
	subSections[this.music_covers] = new SubSection("My Covers Of Existing Songs", "http://journals.rpungin.fotki.com/music/category/covers/");
	this.music_midi=3;
	subSections[this.music_midi] = new SubSection("MIDI", "http://journals.rpungin.fotki.com/midi");
	this.music_mp3=4
	subSections[this.music_mp3] = new SubSection("My MP3 Collection", "http://raphaelpungin.com/mp3/");
	this.music=5
	this.sections[this.music] = new Section("Music", subSections);
	
	
	subSections = new Array();
	this.tech_hardware=0;
	subSections[this.tech_hardware] = new SubSection("Hardware", "http://journals.rpungin.fotki.com/hardware/");
	this.tech_software=1;
	subSections[this.tech_software] = new SubSection("Software", "http://journals.rpungin.fotki.com/software/");
	this.tech_programming=2;
	subSections[this.tech_programming] = new SubSection("Programming", "http://journals.rpungin.fotki.com/programming/");
	this.tech=6
	this.sections[this.tech] = new Section("Technology", subSections);

	subSections = new Array();
	this.misc_flash=0;
	subSections[this.misc_flash] = new SubSection("Flash Animations", "http://journals.rpungin.fotki.com/flash/");
	this.misc_radio=1;
	subSections[this.misc_radio] = new SubSection("Internet Radio", "http://journals.rpungin.fotki.com/radio/");
	this.misc_tools=2;
	subSections[this.misc_tools] = new SubSection("Tools", "http://journals.rpungin.fotki.com/tools/");
	this.misc_reference=3;
	subSections[this.misc_reference] = new SubSection("Reference", "http://journals.rpungin.fotki.com/reference/");
	this.misc_movies=4;
	subSections[this.misc_movies] = new SubSection("Movies", "http://raphaelpungin.com/movies/");
	this.misc_fotki=5;
	subSections[this.misc_fotki] = new SubSection("Fotki Related", "http://journals.rpungin.fotki.com/fotki/");
	this.misc=7
	this.sections[this.misc] = new Section("Miscellaneous", subSections);

	this.getHtml = Menu_getHtml;
	this.setSelection = Menu_setSelection;
	this.getMenuHtml = Menu_getMenuHtml;
	this.getRegularHtml = Menu_getRegularHtml;
	this.getPdaHtml = Menu_getPdaHtml;
}


function Menu_getHtml(href){
	var html = "";
	try {
		if (href.indexOf("cmd=edit") == -1 && href.indexOf("cmd=new") == -1 && top.location == document.location){
		
			this.setSelection(href);
			
			html += getStylesHtml(href);
			
			if (screen.width <=640) {
				html += this.getPdaHtml();
			}
			else {
				html += this.getRegularHtml();
			}
		} 
	} catch (exception) {	
	}
	return html;
}

function getStylesHtml(href) {
	var html = "";
	//If displaying an entry, hide categories
	if (href.indexOf("/entry/") >= 0) {
		html += '<style type="text/css">#j_categories {display:none}</style>';
	}
	return html;
}
	
function Menu_getPdaHtml() {
	var html='Raphael Pungin\'s Blog - PDA Version<br>';
	html += '<a href="http://journals.rpungin.fotki.com/blog">Blog</a> | ';
	html += '<a href="http://new.rpungin.fotki.com">Photos</a> | ';
	html += '<a href="http://raphaelpungin.com/search">Search</a> | ';
	html += '<a href="http://journals.rpungin.fotki.com/?cmd=comments">Blog Cmts</a> | ';
	html += '<a href="http://comments.rpungin.fotki.com/">Photo Cmts</a>';
	
	return html;
}
var xmasHeaders=[
"xmas-lights.gif|38",
"snow5.gif|66",
"snowflakes.gif|30",
"hohoho.gif|44",
"christmas_bar.gif|15",
"baskets.gif|38",
"holly.gif|22",
"bough-bell.gif|70",
"birds-ornaments.gif|54",
"gifts.gif|56",
"ornaments-bar.gif|25",
"birds-garland.gif|32",
"curvy-lights.gif|46",
"green-bow.gif|40",
"decorations.gif|20",
"santas.gif|40",
"bow-divider.gif|40",
"goldenbell-bar.gif|19",
"toyline.gif|32",
"angela-bar.gif|39",
"xleafln1.gif|54",
"xmlin3.gif|61",
"xmlin4.gif|61",
"xmlin5.gif|61",
"BPTree4.gif|66",
"candydiv.gif|28",
"hol-mis-5.gif|35",
"linehoho.gif|30",
"linelights.gif|29",
"linestock.gif|51",
"linetrees.gif|50",
"sclaus-3.gif|54",
"xmasbar.gif|36",
"xsnow-7.gif|69",
"myspace_christmas_divider08.gif|69",
"myspace_christmas_divider11.gif|87",
"myspace_christmas_divider18.gif|32",
"myspace_christmas_divider19.gif|63",
"myspace_christmas_divider13.gif|65",
"myspace_christmas_divider07.gif|30",
"christmas_dividers2.gif|49",
"christmas_dividers6.gif|80",
"christmas_dividers7.gif|80",
"christmas_dividers8.gif|65",
"christmas_dividers9.gif|66",
"christmas_dividers10.gif|63",
"christmas_dividers14.gif|84"

]

function getXmasHeader() {
  var i = Math.floor(Math.random()*(xmasHeaders.length-1));
  var header=xmasHeaders[i].split("|");
  var imgUrl=header[0];
  var imgHeight=header[1];
  var html='<table width="100%" height="'+imgHeight+'" background="http://raphaelpungin.com/images/xmas/div/'+imgUrl+'"><tr><td>&nbsp;</td></tr></table>'
  return html;
 }
 
function Menu_getRegularHtml() {
	var html = 
	'<table  border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'
	   	+'<td valign="top" bgcolor="#b9c9ef" align="center" width="145">'
	   	+getLeftHtml()
        +'</td>'
    	+'<td valign="top" width="100%">'
//    	+getXmasHeader()
    	+this.getMenuHtml();
    	//snow5.gif
 
	return html;
}	
function getLeftHtml() {
	var html='';
	
/*
	if (new Date() < new Date(2007,0,1)) 
		html +='<iframe width="150" height="70" marginheight="0" marginwidh="0" frameborder="0" scrolling="no" src="http://raphaelpungin.com/countdown.html"></iframe>';
	else
		html +='<img src="http://raphaelpungin.com/images/happy_new_year.jpg">'
		
	html +='<p><span style="font-size:8pt;font-family:arial">www.RaphaelPungin.com</span><br>'
	+'<a href="http://journals.rpungin.fotki.com/blog/">'
	+'<img src="http://raphaelpungin.com/images/raphael.jpg" border="0"><br><br>'
	+'<img src="http://raphaelpungin.com/images/raphael_pungins_blog.jpg" border="0"></a><br>'
	+'<form action=http://raphaelpungin.com/search/>'
	+'<input type="search" name="s" style="font-size:10pt" size="15"><br><input type="submit" style="font-size:10pt" value="Search My Blog"></form><br>'
	+'<a href="http://www.facebook.com/p/Raphael_Pungin/501376301"><img src="http://badge.facebook.com/badge/501376301.91.631493696.png" border="0"></a>'
	+'<br><a href="http://raphaelpungin.com/contact/"><img hspace="4" src="http://opi.yahoo.com/online?u=rpungin&m=g&t=2" align="middle" border="0"></a>'
	+'<br><span style="font-weight:bold;"><a href="http://raphaelpungin.com/contact/">Contact Me</a>'
	+'<br><a href="http://guestbook.rpungin.fotki.com/">Guestbook</a>'
	+'<br><a href="http://journals.rpungin.fotki.com/?cmd=comments">Blog Comments</a>'
	+'<br><a href="http://comments.rpungin.fotki.com">Photo Comments</a>'
	+getWebcam()
	+'</span>'
	+getRecentPosts()
	+getCalendar()
	+getRandomPosts()
	+getSpotlightPosts();
  if (document.location.href.indexOf("dance") >= 0 || document.location.href.indexOf("dwts") >= 0) html += getDanceNycAd();
	html += getSocialNetworks();
	html += getRssHtml()
	+'<br><b>Powered By:</b><br><a href="http://fotki.com" target=_blank><img src="http://images.fotki.com/logo3.gif" border="0" alt="Fotki.com - the ultimate photo sharing site"></a><br>'
	+getFotkiUsersHtml()
	+getSwitchToFotkiHtml()
	+'<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></p>'
*/	
	return html;
}

function getWebcam() {
	var url=document.location.href;
	if (true || (url.indexOf("//rpungin.fotki.com") >= 0 && url.indexOf(".html") >= 0) || url.indexOf("webcam") >=0 || url.indexOf("contact") >=0) {
		var html='';					
	} else {
		var html='<embed src="http://www.stickam.com/flashVarChatPlayer/173612226-2" type="application/x-shockwave-flash" width="130" height="130"></embed>'
	}
	html += '<br><a href="http://raphaelpungin.com/webcam">Webcam</a>';
	return html;
}

function getSpotlightPosts() {
	var html = '<br><br><b>Spotlight Posts:</b><br>';
	html +='<br><a href="http://journals.rpungin.fotki.com/blog/entry/wksfwqgqktt/"><img src="http://images17.fotki.com/v309/photos/6/6766/26672/postersm-vi.jpg" border="0"></a>';
	html += '<br><a href="http://dwts.info"><img src="http://images15.fotki.com/v343/photos/6/6766/26672/dwts3-th.jpg" border="0"></a>';
	return html;
}

function getSocialNetworks() {
	var html = '<br><br><b>Social Networks:</b>';
	html += '<a href="http://tagworld.com/raphaelpungin"><img src="http://raphaelpungin.com/images/socinet/tagworld.jpg" border="0" alt="TagWorld"></a>';
	html += '<br><a href="http://myspace.com/rpungin"><img src="http://raphaelpungin.com/images/socinet/myspace.jpg" border="0" alt="MySpace"></a>';
	html += '<br><a href="http://friendster.com/profiles/rpungin"><img src="http://raphaelpungin.com/images/socinet/friendster.jpg" border="0" alt="Friendster"></a>';
	html += '<br><a href="http://linkedin.com/pub/0/8bb/841"><img src="http://raphaelpungin.com/images/socinet/linkedin.jpg" border="0" alt="LinkedIn"></a>';
	html += '<br><a href="http://youtube.com/profile?user=rpungin"><img src="http://raphaelpungin.com/images/socinet/youtube.jpg" border="0" alt="YouTube"></a>';
	html += '<br><a href="http://www.orkut.com/Profile.aspx?uid=7729329153728113477"><img src="http://images16.fotki.com/v30/photos/6/6766/26672/orkut-vi.jpg" border="0" alt="Orkut"></a>';
	html += '<br><a href="http://www.facebook.com/p/Raphael_Pungin/501376301"><img src="http://badge.facebook.com/badge/501376301.6.207993829.png" border="0" alt="Facebook"></a>';
	return html;
}
function getRecentPosts() {
	var html = "";
	if (typeof data == 'undefined') {
		return html;
	}
	html ='<br><br><b>Recent Posts:</b><div style="font-size:8pt;position:relative;left:-10px;text-align:left"><ul>';
	for (var i=data.length-1; i>data.length-6; i--) {
		var entry = data[i];
		var fields = entry.split("|");
		var title = getTitle(fields);
  	var url = getURL(fields);
		html+='<li><a href="'+url+'">'+title+'</a></li>';
  }		
  html +='</ul></div>';
  return html;
}

function getCalendar() {
	var html='<a href="http://raphaelpungin.com/calendar"><img src="http://raphaelpungin.com/images/calendar.jpg" border="0"><br><br></a>';
	return html;
}

function getRandomPosts() {
	var html = "";
	if (typeof data == 'undefined') {
		return html;
	}
	html +='<b>Random Posts:</b><br>';
	for (var count = 0; count<10; count++) {
		var i = Math.floor(Math.random()*(data.length-1));
		var entry = data[i];
		var fields = entry.split("|");
		var imgURL = getImgURL(fields);
		var title = getTitle(fields);
		if (imgURL != "") {
			var url = getURL(fields);
			html += '<br><a href="'+url+'"><img src="'+imgURL+'"></a>';
		}
	}
	return html;
}


function getRssHtml() {
  var html = '<br><br><a href=http://raphaelpungin.com/rss.xml>'
	+'<img src="http://images8.fotki.com/v128/photos/6/6766/26672/rss1-vi.gif" width="30" height="14" border="0" align="middle"></a><br>'
	+'<a href="http://add.my.yahoo.com/rss?url=http://raphaelpungin.com/rss.xml">'
	+'<img src="http://images9.fotki.com/v176/photos/6/6766/26672/addtomyyahoo4-vi.gif" border="0" width="91" height="17"></a><br>'
	+'<a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http://raphaelpungin.com/rss.xml">'
	+'<img src="http://images9.fotki.com/v173/photos/6/6766/26672/ngsub1-vi.gif" border="0" /></a><br>'
	+'<a href="http://www.homelines.com/sub/http://raphaelpungin.com/rss.xml">'
	+'<img src="http://images9.fotki.com/v174/photos/6/6766/26672/bloglines-vi.gif" border="0" /></a><br>'
	+'<a href="http://my.msn.com/addtomymsn.armx?id=rss&ut=http://raphaelpungin.com/rss.xml">'
	+'<img src="http://images14.fotki.com/v205/photos/6/6766/26672/mymsn-vi.gif" border="0" width=91 height=17></a><br>'
	+'<a href="http://client.pluck.com/pluckit/prompt.aspx?a=http://raphaelpungin.com/rss.xml">'
	+'<img src="http://images14.fotki.com/v258/photos/6/6766/26672/pluspluck-vi.png" border="0" /></a><br>'
	+'<a href="http://www.rojo.com/add-subscription?resource=http://raphaelpungin.com/rss.xml">'
	+'<img src="http://images6.fotki.com/v83/photos/6/6766/26672/RojoWideRed-vi.gif" border="0" /></a><br>'
	+'<a href="http://fusion.google.com/add?feedurl=http://raphaelpungin.com/rss.xml">'
	+'<img src="http://images14.fotki.com/v249/photos/6/6766/26672/addtogoogleplus-vi.gif" border="0" ></a><br>'
	return html;
}	
function getFotkiUsersHtml() {
	var  html ='<a href="http://groups.yahoo.com/group/fotki-users">'
		+'<img src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif" border="0">'
  		+'<br><span style="font-size:10pt">Fotki Users Group</span></a>';
  	return html;
}

function getDanceNycAd() {
	var html='<br><br><a href="http://journals.rpungin.fotki.com/dance/entry/wdgrtdsksrg/">'
		+'<img src="http://images16.fotki.com/v279/photos/6/6766/26672/dancenyclogo-vi.gif" border="0"'
    +'alt="New York City partner dance events calendar"><br><span style="font-size:8pt">NYC Dance Calendar</span></a>';
    return html;
}
	
function getSwitchToFotkiHtml() {
	var html = "";
	var url = document.location.href;
	if (url.indexOf("//rpungin.fotki.com") > 0) {
		url = url.replace("//rpungin.fotki.com","//public.fotki.com/rpungin");
		html = '<br><a href="'+url+'"><img src="http://raphaelpungin.com/images/transparent-120x50.gif" border="0"></a>';
	}
	return html;
}	
function Menu_getMenuHtml() {
	var html='<div id=tabs style="display:block">'
	+'<table cellspacing=0 cellpadding=0 id=maintabs><tr>';
	for (i=0; i < this.sections.length; i++) {
		var section = this.sections[i];
		var isSelected = section == this.selectedSection;
		html += getTabHTML(section.title, section.url, isSelected);   				
	}
	html+='</tr></table>'
	+'</div>'
	+'<div id="line" class="one"></div>'
	+'<div id=tabs style="display:block">'
		+'<table cellspacing=0 cellpadding=0 id=maintabs><tr>';
				for (i=0; i < this.selectedSection.subSections.length; i++) {
					var subSection = this.selectedSection.subSections[i];
					var isSelected = subSection == this.selectedSubSection; 
					html += getTabHTML(subSection.title, subSection.url, isSelected); 				
				}
		html+='</tr></table>'
	+'</div>'
	+'<div id="line" class="one"></div>';
	if (document.location.href.indexOf("dwts") >=0) 
	  	html += getDwtsHeader();
	  	
	if (document.location.href.indexOf("journals.rpungin.fotki.com/music") >=0) html += getMusicHeader();  	
	return html;
}

function getMusicHeader() {
	var html='<div style="background-color:#b9c9ef; display:inline; position:relative; left:5px; margin-left:2px"><b>&nbsp;Listen to my music on </b>'
	+'<a href="http://tagworld.com/raphaelpungin/music" target="_blank">'
	+'<img src="http://raphaelpungin.com/images/socinet/tagworld.jpg" border="0" align="middle"></a></div>';
	return html;
}

function getDwtsHeader() {
	var html = '&nbsp;<b><a href="http://journals.rpungin.fotki.com/dwts/entry/sfrrdrrqkff/">Weekly Show Videos</a></b> |'
	+'You can access this blog with a short URL <b>dwts.info</b>. '; 
	return html;
}

function getDebsAd() {
	var html='<table bgcolor="white" border="1"><tr><td align="center">'
	+'<a href="http://journals.rpungin.fotki.com/blog/entry/wrddwddbqgk/">'
	+'<img src="http://images15.fotki.com/v230/photos/6/6766/26672/debutants-th.jpg" border="0"></a>'
	+'<br><span style="font-size:8pt">'
	+'<a href="http://journals.rpungin.fotki.com/blog/entry/wrddwddbqgk/">'
	+'Wanna be a<br>debutante?</span></a>'
	+'<br><a href="http://journals.rpungin.fotki.com/blog/entry/wrddwddbqgk/">'
	+'<img src="http://images7.fotki.com/v151/photos/6/6766/26672/finger-vi.gif" border="0"></a>'
	+'</td></tr></table>'
	return html;
}

function getTabHTML(title, href, isSelected) {
	var html='<td id=' + (isSelected ? 'tabNMselected' : 'tabNM') +'>'
      +'<div id="rnd"><b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>'
      +'<ul><li><p id=commtab class=text3><a href="'+href+'">'+title+'</a></p></li></ul>'
      +'</div></td>';
    return html;
}

function Menu_setSelection(href) {
	href = href.toLowerCase();
	
	//Default to main blog page
	this.selectedSection=this.sections[this.home];
	this.selectedSubSection=this.selectedSection.subSections[this.home_blog];
	
	if (href.indexOf("raphaelpungin.com/search") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_search];
	} else
	if (href.indexOf("raphaelpungin.com/calendar") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_calendar];
	} else
	if (href.indexOf("raphaelpungin.com/webcam") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_webcam];
	} else
	if (href.indexOf("raphaelpungin.com/contact") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_contact];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/about") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_about];
	} else
	if (href.indexOf("guestbook") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_guestbook];
	} else
	if (href.indexOf("//links.rpungin.fotki.com") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_links];
	} else
	if (href.indexOf("//search.rpungin.fotki.com") >=0) {
		this.selectedSection=this.sections[this.photos];
		this.selectedSubSection=this.selectedSection.subSections[this.photos_tags];
	} else
	if (href.indexOf("//rpungin.fotki.com/") >=0) {
		this.selectedSection=this.sections[this.photos];
		this.selectedSubSection=this.selectedSection.subSections[this.photos_all];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/map") >=0) {
		this.selectedSection=this.sections[this.photos];
		this.selectedSubSection=this.selectedSection.subSections[this.photos_map];
	} else
	if (href.indexOf("//new.rpungin.fotki.com/") >=0) {
		this.selectedSection=this.sections[this.photos];
		this.selectedSubSection=this.selectedSection.subSections[this.photos_new];
	} else
	if (href.indexOf("//comments.rpungin.fotki.com/") >=0) {
		this.selectedSection=this.sections[this.photos];
		this.selectedSubSection=this.selectedSection.subSections[this.photos_comments];
	} else
	if (href.indexOf("raphaelpungin.com/videos/youtube") >=0) {
		this.selectedSection=this.sections[this.videos];
		this.selectedSubSection=this.selectedSection.subSections[this.videos_youtube];
	} else
	if (href.indexOf("raphaelpungin.com/videos/") >=0 && href.indexOf("sort=taken") >= 0) {
		this.selectedSection=this.sections[this.videos];
		this.selectedSubSection=this.selectedSection.subSections[this.videos_taken];
	} else
	if (href.indexOf("raphaelpungin.com/videos/") >=0) {
		this.selectedSection=this.sections[this.videos];
		this.selectedSubSection=this.selectedSection.subSections[this.videos_posted];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/music/category/about") >=0) {
		this.selectedSection=this.sections[this.music];
		this.selectedSubSection=this.selectedSection.subSections[this.music_about];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/music/category/compositions") >=0) {
		this.selectedSection=this.sections[this.music];
		this.selectedSubSection=this.selectedSection.subSections[this.music_compositions];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/music/category/covers") >=0) {
		this.selectedSection=this.sections[this.music];
		this.selectedSubSection=this.selectedSection.subSections[this.music_covers];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/music") >=0) {
		this.selectedSection=this.sections[this.music];
		this.selectedSubSection=this.selectedSection.subSections[this.music_about];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/midi") >=0) {
		this.selectedSection=this.sections[this.music];
		this.selectedSubSection=this.selectedSection.subSections[this.music_midi];
	} else
	if (href.indexOf("raphaelpungin.com/mp3") >=0) {
		this.selectedSection=this.sections[this.music];
		this.selectedSubSection=this.selectedSection.subSections[this.music_mp3];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/karaoke") >=0) {
		this.selectedSection=this.sections[this.karaoke];
		this.selectedSubSection=this.selectedSection.subSections[this.karaoke_blog];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/lyrics") >=0) {
		this.selectedSection=this.sections[this.karaoke];
		this.selectedSubSection=this.selectedSection.subSections[this.karaoke_lyrics];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/flash") >=0) {
		this.selectedSection=this.sections[this.misc];
		this.selectedSubSection=this.selectedSection.subSections[this.misc_flash];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/reference") >=0) {
		this.selectedSection=this.sections[this.misc];
		this.selectedSubSection=this.selectedSection.subSections[this.misc_reference];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/fotki") >=0) {
		this.selectedSection=this.sections[this.misc];
		this.selectedSubSection=this.selectedSection.subSections[this.misc_fotki];
	} else
	if (href.indexOf("raphaelpungin.com/movies/") >=0) {
		this.selectedSection=this.sections[this.misc];
		this.selectedSubSection=this.selectedSection.subSections[this.misc_movies];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/radio") >=0) {
		this.selectedSection=this.sections[this.misc];
		this.selectedSubSection=this.selectedSection.subSections[this.misc_radio];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/tools") >=0) {
		this.selectedSection=this.sections[this.misc];
		this.selectedSubSection=this.selectedSection.subSections[this.misc_tools];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/software") >=0) {
		this.selectedSection=this.sections[this.tech];
		this.selectedSubSection=this.selectedSection.subSections[this.tech_software];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/programming") >=0) {
		this.selectedSection=this.sections[this.tech];
		this.selectedSubSection=this.selectedSection.subSections[this.tech_programming];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/hardware") >=0) {
		this.selectedSection=this.sections[this.tech];
		this.selectedSubSection=this.selectedSection.subSections[this.tech_hardware];
	} else
	if (href.indexOf("/karaoke/catalog") >=0) {
		this.selectedSection=this.sections[this.karaoke];
		this.selectedSubSection=this.selectedSection.subSections[this.karaoke_catalog];		
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/dance") >=0
      || href.indexOf("raphaelpungin.com/dance") >=0) {
		this.selectedSection=this.sections[this.dance];
		this.selectedSubSection=this.selectedSection.subSections[this.dance_blog];
	} else
	if (href.indexOf("//journals.rpungin.fotki.com/dwts") >=0) {
		this.selectedSection=this.sections[this.dance];
		this.selectedSubSection=this.selectedSection.subSections[this.dance_dwts];
	} else 
	if (href.indexOf("//journals.rpungin.fotki.com/scd") >=0) {
		this.selectedSection=this.sections[this.dance];
		this.selectedSubSection=this.selectedSection.subSections[this.dance_scd];
	} else 
	if (href.indexOf("//journals.rpungin.fotki.com/tzg") >=0) {
		this.selectedSection=this.sections[this.dance];
		this.selectedSubSection=this.selectedSection.subSections[this.dance_tzg];
	} else 
	if (href.indexOf("//journals.rpungin.fotki.com/ddr") >=0) {
		this.selectedSection=this.sections[this.dance];
		this.selectedSubSection=this.selectedSection.subSections[this.dance_ddr];
	} else 
	if (href.indexOf("raphaelpungin.com/forum") >=0) {
		this.selectedSection=this.sections[this.home];
		this.selectedSubSection=this.selectedSection.subSections[this.home_forum];
	}
	if (this.selectedSubSection.title != "Blog") { 
    	document.title=this.selectedSubSection.title+" - Raphael Pungin's Blog";
    }
}

function writeAlbumIcon(thumbnailURL, clickURL, align) {
  document.write('<table border="0" cellspacing="0" cellpadding="0" width="150" align="'+align+'">');
  document.write('<tr><td colspan="3"><img src="http://raphaelpungin.com/images/album_t.gif" width="100%" height="18"></td></tr>');
  document.write('<tr><td><img src="http://raphaelpungin.com/images/album_l.gif" width="12" height="91"></td>');
  document.write('<td width="120" align="center" bgcolor="white"><a href="'+clickURL+'" >');
  document.write('<img border=0  src="'+thumbnailURL+'">');
  document.write('</a></td> <td><img src="http://raphaelpungin.com/images/album_r.gif" width="18" height="91"></td></tr>');
  document.write('<tr><td colspan="3"><img src="http://raphaelpungin.com/images/album_b.gif" width="100%" height="16"></td></tr> </table>');
}	
	