﻿function default_onload() {
    var links = document.getElementsByTagName('a');
    //alert("entered window.onload");
    for (var i=0;i < links.length;i++) {
        if ((links[i].href.indexOf("http://www.steephill.tv") != 0) && (links[i].onclick == null)) {
            //alert(links[i].href);
            links[i].onclick = click_track; 
        }
    }
    /*
		callback to the "subclass" method of this onload implementation. Instead of using the onload event handler in the body tag create a function in a script and assign it to the custom property window.body_onload so that it will be called at the end of this function. (Any body tag onload event handler will override this method.) This functionality eliminates the need to assign the same onload handler to every page but stills allows subclassing/inheriting the default behavior.
		window.body_onload = function() {
			alert("called body_onload");
		};		
    */
    //turnPage();
    if (window.turnPage)
    	turnPage();
    	//alert("yes");
}

window.onload = default_onload;

/* include the standard header if the <script>OMIT_LOGO_EMAIL_THIS=true;</script> code is not included
in the head element */
if (!window.OMIT_HEADER)
	header();


function header() {
	email_this({include_logo:true, align:"left"});
	document.write('<iframe id="iClickTrack"  style="display:none;visibility:hidden;height:1px;"><\/iframe>'); 
}

function footer() {
	document.write('<br/>');
	email_this({include_logo:true, align:"center"});
	document.write('<br clear="all"/>');
	document.write('<blockquote><blockquote><blockquote><blockquote><b>Sharing These Photos:</b><br/>We have a very simple procedure for sharing these photos -- Individual photos may be posted on team and not-for-profit web sites provided they are unaltered and appropriately credited using (pasting) the following line of html directly underneath: <pre>photo: &lt;a href=\"http://www.steephill.tv\"&gt;steephill.tv&lt;/a&gt;</pre>Once posted you can <a name=\"conditions\" href=\"mailto:info@steephill.tv?subject=Photo usage notification&body=Here is link to your photo: \">send us an email</a> with a link to the photo(s).</blockquote></blockquote></blockquote></blockquote>');


}

function email_this(settings) {
	//var shtv_logo = shtv_logo || true;
	//var email_services = email_services || 3;
	var url = escape(document.URL);
	var title = escape(document.title.replace(/,/g, ' -'));
	
	if (settings.black) {
		bgcolor = "#000000"; // black
		//fgcolor = "#FFFFFF"; // white
		logo = "steephill_tv_logo21_black.gif";		
	}
	else {
		bgcolor = "#FFFFFF"; // white
		//fgcolor = "#000000"; // black
		//logo = "steephill-logo-150.jpg";	
		logo = "steephill_tv_logo21-200.gif";	
		
	}
	
	
	if (settings.include_logo) {
		document.write('<table bgcolor=\"'+bgcolor+'\" align=\"'+settings.align+'\"><tr><td>');
		
		document.write('<a href=\"/\"><img alt=\"steephill logo\" src=\"/img/'+logo+'\" align=\"left\" width=\"200\" xheight=\"100\" border=\"0\"/> <br/></td>');
	}
	
	
	if (settings.target)
		target = ' target="' + settings.target + '" ';
	else
		target = "";
	
	document.write('<td>');
	if (settings.align != "center") {
		document.write('&laquo; <a href=\"/\"' + target + '>steephill.tv home</a>');		
		if (settings.navigation_path)
			document.write(' > ' + settings.navigation_path);	
		document.write('&nbsp;&nbsp; &bull; &nbsp;&nbsp;'); 
	}

	document.write('<img alt=\"email\" src=\"/mailto.gif\" width=\"14\" height=\"10\"/> <a href=\"mailto:?subject=' + title  + '&body=' + url + '\" onclick=\"click_track(\'mailto:\')\">Email This</a>');
	
	document.write('&nbsp;&nbsp; &bull; &nbsp;&nbsp;'); 
	
	document.write('<img alt=\"y!\" src=\"/smilies/yahoo.gif\" align=\"top\" width=\"16\" height=\"16\"> <a href=\"http://compose.mail.yahoo.com/ym/Compose?To=&Subject=' + title + '&Body=' + url + '\"' + target +  'onclick=\"click_track(\'mail.yahoo.com\')\">  Mail This</a>');
	
	document.write('&nbsp;&nbsp; &bull; &nbsp;&nbsp;');
	
	document.write('<img alt=\"t\" src=\"/smilies/twitter-bird-16.gif\" align=\"top\" width=\"16\" height=\"16\"> <a href=\"http://twitter.com/home?status=checkout @steephill: ' + title + ':%20'+ url + '\"' + target + ' onclick=\"click_track(\'twitter.com\')\">  Twitter This</a>');
		
	/*
	document.write('<img alt=\"g\" src=\"/smilies/google.gif\" align=\"top\" width=\"16\" height=\"16\"> <a href=\"https://mail.google.com/mail?view=cm&tf=0&su=' + title + '&body=' + url + '\"' + target + ' onclick=\"click_track(\'mail.google.com\')\">  Mail This</a>');*/

	document.write('&nbsp;&nbsp; &bull; &nbsp;&nbsp;');
	
	
	
	document.write("<a href=\"http://www.addthis.com/bookmark.php\" onclick=\"click_track_explicit(this.href);window.open('http://www.addthis.com/bookmark.php?pub=steephill&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'addthis', 'scrollbars=yes,menubar=no,width=620,height=520,resizable=yes,toolbar=no,location=no,status=no'); return false;\" title=\"Bookmark using any bookmark manager!\" target=\"_blank\"><img src=\"http://s7.addthis.com/static/btn/sm-share-en.gif\" width=\"83\" height=\"16\"  align=\"top\" alt=\"Bookmark and Share\" style=\"border:0\"/></a>");
	
	document.write('&nbsp;&nbsp; &bull; &nbsp;&nbsp;');
	
	document.write("<a href=\"http://feeds.feedburner.com/steephill\" title=\"Subscribe to my feed\"><img src=\"/img/icon_rss.png\" style=\"border:0\"/></a>");

	if (settings.include_logo) {	
		document.write("</td></tr></table>");
		//if (!window.OMIT_EMAILTHIS_BREAK)
			document.write('<br style="clear:both;"/>');

	}
}

// stores the reference to the XMLHttpRequest object
var xmlHttp = createXmlHttpRequestObject();
// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject() {	
  // will store the reference to the XMLHttpRequest object
	var xmlHttp;
  // if running Internet Explorer
  if (window.ActiveXObject) {
	   try {
		  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	   }
	   catch (e) {
		 xmlHttp = false;
	   }
  }
  // if running Mozilla or other browsers
  else {
    try {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
      xmlHttp = false;
    }
  }
  return xmlHttp;
}


// make asynchronous HTTP request using the XMLHttpRequest object 
// the xmlHttp.onreadystatechange callback doesn't work for links

function click_track(e) {
	if (this.href)// handles formatting inside the anchor
		dest = this.href;
	else if (typeof(e.type) == "undefined") // check for an override string as parameter inside of event
		dest = e;
	else // otherwise use the anchor href attribute
		dest = e.target;
		
	// play video from the onclick event handler instead of the anchor if possible
	var jp = dest.toString().indexOf(":Play");
	if (jp != -1) {
		try {
			//alert(playFunc);
			var playFunc = dest.toString().substring(jp+1);
			eval(playFunc);
		}
		catch (e) {
			jp = -1; // try to play the video the old way... doesn't work with all browsers
			//alert(e);
		}
	}
	
	

	params = "source=" + encodeURIComponent(document.URL) + "&destination=" + encodeURIComponent(dest);
	
	//if ((document.URL.indexOf("giro-d-italia") > -1) || //(document.URL.indexOf("2008/tour-de-france") > -1)) {
			url = "http://www.grassyknolltv.com/phpscripts/update_click_track_v3.php?"+params;
			
			try {
				document.getElementById("iClickTrack").contentWindow.location = url;	
			}
			catch (e) {
				//alert(e);
			}
	//}
	

	 if (xmlHttp && false) { // xmlHttp was succesfully created
			
 		// proceed only if the xmlHttp object isn't busy
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) {
			url = "/phpscripts/update_click_track_v2.php";
			xmlHttp.open("POST", url, true); 
			xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xmlHttp.setRequestHeader("Content-length", params.length);
			xmlHttp.setRequestHeader("Connection", "close");
			//xmlHttp.onreadystatechange = handleServerResponse; // not needed
			xmlHttp.send(params);
			for (i=1; i < 100000; i++)
				; // delay the unloading of the page so the XMLHttpRequest object has a chance to send the ajax request
  		}	
  	}
  	
  	
  	// todo: else {report/mail an error }  

  	if (jp != -1)
  		return false; // the video played so don't execute the link	
  	else
  		return true;
}

function click_track_explicit(dest) {
	params = "source=" + encodeURIComponent(document.URL) + "&destination=" + encodeURIComponent(dest);
	
	//if ((document.URL.indexOf("giro-d-italia") > -1) || //(document.URL.indexOf("2008/tour-de-france") > -1)) {
			url = "http://www.grassyknolltv.com/phpscripts/update_click_track_v3.php?"+params;
			try {
				document.getElementById("iClickTrack").contentWindow.location = url;	
			}
			catch (e) {
				//alert(e);
			}

	//}
	

	if (xmlHttp && false) { // xmlHttp was succesfully created
			
 		// proceed only if the xmlHttp object isn't busy
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) {
			url = "/phpscripts/update_click_track_v2.php";
			xmlHttp.open("POST", url, true); 
			xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xmlHttp.setRequestHeader("Content-length", params.length);
			xmlHttp.setRequestHeader("Connection", "close");
			//xmlHttp.onreadystatechange = handleServerResponse; // not needed
			xmlHttp.send(params);
			for (i=1; i < 100000; i++)
				; // delay the unloading of the page so the XMLHttpRequest object has a chance to send the ajax request
  		}	
  	} 	
  	// todo: else {report/mail an error }  
  	//if (des.toString().indexOf("steephill.tv") > -1)
  	//	return true;
  	//else
  		return false;
}



/*
	- it's best to have one handlerServerResponse method for each http send
	- don't use a onreadystatechange callback for anchor objects then leave the page
*/
// executed automatically when a message is received from the server
function handleServerResponse() {
  // move forward only if the transaction has completed
  if (xmlHttp.readyState == 4)  {
    // status of 200 indicates the transaction completed successfully
    if (xmlHttp.status == 200) {
      // extract the XML retrieved from the server
      xmlResponse = xmlHttp.responseXML;
    } 
    // a HTTP status different than 200 signals an error
    else  {
      ;//alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  } // if (xmlHttp.readyState == 4)
} // function handleServerResponse()


function major_race_coverage(align, more_styles) {
	var curdate = new Date();
	var day = curdate.getDate();
	var month = months[curdate.getMonth()].substring(0,3);
	// \r<font color=red>Live Today ' + month + ' ' + day + '</font></td>'+
	//\r<font color=red>Starts This Sunday</font> 
	//\r<font color=red>Live Today ' + month + ' ' + day + '</font>

	if (more_styles) {
		more_styles = ';'+more_styles;
	}
	else {
		more_styles = '';
	}
	document.write('<table bgcolor=\"#dcdcdc\"  align=\"' + align + '\" width=\"200\" style=\"font-family:verdana,san-serif;font-size:12px;font-weight:bold;text-align:center;margin-bottom:5px;border:2px gray solid;line-height:1.5em;' + more_styles + '\">' +  


		
	    '<tr bgcolor=\"#e66000\">'+
			'<td><a style=\"color:white\"  href=\"/tour-down-under/\">Tour Down Under \'10</a> <font color="white">|</font> <a style=\"color:white\"  href=\"/2009/tour-down-under/\">\'09</a></td>'+
		'</tr>'+


		
		
	    '<tr bgcolor=\"#594A2D\">'+
			'<td><a style=\"color:white\"  href=\"/tour-of-qatar/\">Tour of Qatar \'10</a> <font color="white">|</font> <a style=\"color:white\"  href=\"/tour-of-qatar/#2009\">\'09</a></td>'+
		'</tr>'+	
		
			    '<tr bgcolor=\"#00489A\">'+
			'<td><a style=\"color:#74CDF5\"  href=\"/tour-mediterraneen/\">Tour M&eacute;diterran&eacute;en \'10</a></td>'+
		'</tr>'+	
		
	    '<tr bgcolor=\"#016334\">'+
			'<td><a style=\"color:white\"  href=\"/volta-ao-algarve/\">Volta ao Algarve \'10</a> </td>'+
		'</tr>'+
		
		'<tr bgcolor=\"#E7573B\">'+
			'<td style=\"color:black\"><a style=\"color:black\" href=\"/giro-di-sardegna/\">Giro di Sardegna \'10</a></td>'+
		'</tr>'+
		
		'<tr bgcolor=\"#C4B90D\">'+
			'<td><a style=\"color:#A90050\" href=\"/vuelta-a-murcia/\">Vuelta a Murcia \'10</a></td>'+
		'</tr>'+		
		
		'<tr bgcolor=\"#0079db\">'+
			'<td><a style=\"color:#ffbf0d\" href=\"/paris-nice/\">Paris-Nice \'10</a> <font color="#ffbf0d">|</font> <a style=\"color:#ffbf0d\" href=\"/2009/paris-nice/\">\'09</a></tr>'+
			
			
			
		
		'<tr bgcolor=\"#C4C949\">'+
			'<td><a style=\"color:black\" href=\"/tirreno-adriatico/\">Tirreno-Adriatico \'10</a>  <font color="black">|</font> <a style=\"color:black\" href=\"/2009/tirreno-adriatico/\">\'09</a></td>'+
		'</tr>'+	
		
		'<tr bgcolor=\"#ED1C24\">'+
			'<td><a style=\"color:#EAC102\" href=\"/volta-a-catalunya/\">Volta a Catalunya \'10</a></td>'+
		'</tr>'+
		
		'<tr bgcolor=\"#ffd63b\">'+
			'<td><a  href=\"/coppi-e-bartali/\"  style=\"color:#a85868\">Coppi e Bartali \'09</a></td>'+
		'</tr>'+
		
		'<tr bgcolor=\"#56B98D\">'+
			'<td><a  href=\"/criterium-international/\"  style=\"color:red\">Critérium International \'10</a></td>'+
		'</tr>'+
		

		'</tr>'+ 
		'<tr bgcolor=\"#349400\">'+
			'<td><a  href=\"/vuelta-al-pais-vasco/\" style=\"color:#FFE600\" >Vuelta Pais Vasco \'10</a> <font color="#FFE600">|</font> <a style=\"color:#FFE600\" href=\"/vuelta-al-pais-vasco/#2009\">\'09</a></td> '+
		'</tr>'+		
		
		//'<tr bgcolor=\"#002675\">'+
		//	'<td><a style=\"color:#3ec200\" href=\"/2008/tour-de-georgia/\">Tour de Georgia \'08</a> <font color="#3ec200">|</font> <a style=\"color:#3ec200\" href=\"/2007/tour-de-georgia/\">\'07</a></td>'+
		//'</tr>'+
		
		'<tr bgcolor=\"#7D0925\">'+
			'<td><a style=\"color:white\" href=\"/vuelta-castilla-y-leon/\">Vuelta a Castilla y León \'09</a></td>'+
		'</tr>'+
		
		'<tr bgcolor=\"#9dd05b\">'+
			'<td><a style=\"color:#004ecc\" href=\"/giro-del-trentino/\">Giro del Trentino \'10</a> <font color="#004ecc">|</font> <a style=\"color:#004ecc\" href=\"/giro-del-trentino/#2009\">\'09</a></td>'+
		'</tr>'+
		
				'<tr bgcolor=\"black\">'+
			'<td><a style=\"color:#ff0d00\" href=\"/tour-de-romandie/">Tour de Romandie \'09</a></td>'+
		'</tr>'+
		
		'<tr bgcolor=\"#F7B5CB\">'+
			'<td><a href=\"/giro-d-italia/\">Giro d\'Italia \'10</a> <font color="black">|</font> <a href=\"/2009/giro-d-italia/\">\'09</a> <font color="black">|</font> <a href=\"/2008/giro-d-italia/\">\'08</a></td>'+
		'</tr>'+

		'<tr bgcolor=\"#CC9933\">'+
			'<td><a href=\"/tour-of-california/\">Tour of California \'10</a> | <a href=\"/tour-of-california/#summary-09\">\'09</a></td>'+
		'</tr>'+
		
		'<tr bgcolor=\"#000000\">'+
			'<td><a style=\"color:white\"  href=\"/criterium-du-dauphine-libere/\">Dauphin&eacute; Lib&eacute;r&eacute; \'09</a>  <font color="white">|</font> <a style=\"color:white\" href=\"/2008/criterium-du-dauphine-libere/\"> \'08</a></td>'+
		'</tr>'+	
		
		'<tr bgcolor=\"#cc002b\">'+
			'<td><a style=\"color:white\"  href=\"/tour-de-suisse/\">Tour de Suisse \'10</a> <font color="white">|</font> <a style=\"color:white\" href=\"/tour-de-suisse/#2009\">\'09</a></td>'+
		'</tr>'+		
				
		
		'<tr bgcolor=\"#FFD816\">'+
			'<td style=\"color:black\"><a style=\"color:black\" href=\"/tour-de-france/\">Tour de France \'10</a>&nbsp;|&nbsp;<a style=\"color:black\" href=\"/2009/tour-de-france/\">\'09</a></td>'+
		'</tr>'+
		
		/*
		'<tr bgcolor=\"#853241\">'+
			'<td style=\"color:#a33100\"><a style=\"color:#EDD100\" href=\"/tour-of-utah/\">Tour of Utah \'09</a> <font color="#EDD100">|</font> <a style=\"color:#EDD100\" href=\"/tour-of-utah/#2008\">\'08</a></td>'+
		'</tr>'+*/
		
		'<tr bgcolor=\"#009A63\">'+
			'<td><a style=\"color:#FF823D\" href=\"/tour-of-ireland/\">Tour of Ireland \'09</a> </td>'+
		'</tr>'+
		

		
		'<tr bgcolor=\"#d6182a\">'+
			'<td><a style=\"color:#FFCC33\" href=\"/vuelta-a-espana/\">Vuelta a Espa&ntilde;a \'10</a> <font color="#FFCC33">|</font> <a style=\"color:#FFCC33\" href=\"/vuelta-a-espana/\">\'09</a></td>'+
		'</tr>'+
		'<tr bgcolor=\"#00395c\">'+
			'<td style=\"color:#ffa64f\"><a  style=\"color:#ffa64f\" href=\"/tour-of-missouri/\">Tour of Missouri \'09</a> | <a style=\"color:#ffa64f\" href=\"/tour-of-missouri/#2008\">\'08</a></td>'+
		'</tr>'+
	'</table>');
	//  <font color=\"black\">Now On</font>
	/*
				'<tr bgcolor=\"#5ec1f7\">'+
			'<td><a href=\"/2007/usa-cycling-pro-tour/\">USA Pro Tour Calendar \'08</a></td>'+
		'</tr>'+
		
		
		'<tr bgcolor=\"#CCCCCC\">'+
			'<td><a href=\"/deutschland-tour-of-germany/\">Deutschland Tour \'08</a> | <a href=\"/deutschland-tour-of-germany/#2007\">\'07</a></td>'+
		'</tr>'+	
		
		
		<br/><font color=white>Live Today ' + month + ' ' + day + '</font>
		*/
}

function cycling_classics_coverage(align, more_styles) {
	document.write('<table bgcolor=\"#d4c581\" align=\"' + align + '\" width=\"200\" style=\"font-family:verdana,san-serif;font-size:12px;font-weight:bold;text-align:center;margin-bottom:5px;border:2px gray solid;line-height:1.5em;' + more_styles + '\">' +  

	'<tr>'+
			'<td>Cycling Classics 2010:<br/><a  href=\"/classics/milan-san-remo/\">Milan-San Remo</a> Mar 20</td>'+
	'</tr>'+	
	
	'<tr>'+
			'<td><a  href=\"/classics/gent-wevelgem/\">Gent-Wevelgem</a> Mar 28</td>'+
	'</tr>'+
	
	'<tr>'+
			'<td><a  href=\"/classics/tour-of-flanders/\">Tour of Flanders</a> Apr 4</td>'+
	'</tr>'+
	
	'<tr>'+
			'<td><a  href=\"/classics/paris-roubaix/\">Paris-Roubaix</a> Apr 11</td>'+
	'</tr>'+
	
		'<tr>'+
			'<td><a  href=\"/classics/amstel-gold-race/\">Amstel Gold</a> Apr 18</td>'+
	'</tr>'+
	
	

		'<tr>'+
			'<td><a  href=\"/classics/fleche-wallonne/\">Fleche Wallonne</a> Apr 21</td>'+
	'</tr>'+
		'<tr>'+
			'<td><a  href=\"/classics/liege-bastogne-liege/\">Liège-Bastogne-L</a> Apr 25</td>'+
	'</tr>'+
	'</tr>'+
		'<tr>'+
			'<td><a  href=\"/classics/san-sebastian/\">San Sebastian</a> Jul 31</td>'+
	'</tr>'+

	'</tr>'+
		'<tr>'+
			'<td><a  href=\"/road-cycling-world-championships/\">UCI Worlds</a> Sep 29-Oct 3</td>'+
	'</tr>'+
	'<tr>'+
			'<td><a  href=\"/classics/giro-di-lombardia/\">Giro di Lombardia</a> Oct 16</td>'+
	'</tr>'+	
	'</table>');
}

function stage_and_classics_coverage(align, more_styles){
	document.write('<table align=\"' + align + '\" width=\"200\"><tr><td>'); 
	major_race_coverage(align, more_styles);
	cycling_classics_coverage(align, more_styles);
	document.write('</td></tr></table>');
}

function permalink(link) {
	if (link.charAt(0) == '#') {
		var url = document.URL;
		if (url.indexOf("#") > 0)
			url = document.URL.substring(0, (document.URL.indexOf("#")));
		link = url + link;
	}
	document.write('<a href="#" onclick="prompt(\'Here is a link to the current section of this web page:\',\'' + link + '\');return false;"><img src="/img/permalink.gif" width="93" height="16" border="0" align="center"/></a>');		
}

function permalink2(link) {
	if (link.charAt(0) == '#') {
		var url = document.URL;
		if (url.indexOf("#") > 0)
			url = document.URL.substring(0, (document.URL.indexOf("#")));
		link = url + link;
	}
	document.write('<small><a href="#" onclick="prompt(\'Here is a link to the current section of this web page:\',\'' + link + '\');return false;">permanent link</a></small>');		
}



function NewWindow(mypage, title, w, h, scroll) {
        var win = OpenWindow(mypage, title, w, h, scroll);
        win.focus();
}

function OpenWindow(mypage, title, w, h, scroll) {
        var winl = (screen.availWidth - w) / 2;
        var wint = (screen.availHeight - h) / 2;
        winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no';
        return window.open(mypage, title, winprops);
}

function PlayYouTube(title, id) {
		var win = OpenWindow('',title,440,368,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object width="425" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com\/v\/'+ id + '\"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+ id + '" type="application\/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed><\/object></body></html>');
win.window.focus();
return false;
}


function PlayYouTubeVideo(title,id) {
	var absolute  = 'http://www.grassyknolltv.com/movies/2008/youtube/'+id+'.flv';
	//prompt('', absolute);
	PlayFlvVideo(title,absolute,465,350);
}


function PlayFlvVideo(title, url, width, height) {
	var win = OpenWindow('',title,17+width,17+height,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" height="'+ height + '" width="'+width+'"> <br /> <param name="salign" value="lt">  <param name="quality" value="high">  <param name="scale" value="noscale">  <param name="wmode" value="transparent">  <param name="movie" value="http://geekfile.googlepages.com/flvplay.swf">  <param name="FlashVars" value="&streamName='+url+'&amp;skinName=/flash/flvskin&autoPlay=true&amp;autoRewind=true">  <embed flashvars="&streamName='+url+'&amp;autoPlay=true&autoRewind=true&amp;skinName=/flash/flvskin" quality="high" scale="noscale" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="/flash/flvplay.swf" wmode="transparent" height="'+ height + '" width="'+width+'"><\/embed><\/object></body></html>');
win.window.focus();
return false;
}

function PlayGoogleVideo(title, id) {
	var win = OpenWindow('',title,415,340,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><embed style="width:400px; height:326px;" id="VideoPlayback"  flashvars="" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=' + id + '&hl=en"> </embed></body></html>');
win.window.focus();
return false;
}

function PlayVeloNewsVideo(title, articleID, fileTypeID, adID, adObject) {
	var win = OpenWindow('',title,525,425,'no');
	adID=0;
win.document.write('<html><head><title>'+title+'</title></head><body><embed src=\'http://cdn.dayport.com/contagionimg/img/flashEmbedPlayer.swf\' flashVars=\'articleID='+ articleID + '&fileTypeID=' + fileTypeID + '&videoAdConDefID=' + adID + '&videoAdObjectID=' + adObject + '\' name=\'bcPlayerExt\' wmode=\'transparent\' width=\'509\' height=\'409\' allowScriptAccess=\'always\' type=\'application/x-shockwave-flash\' swLiveConnect=\'true\' pluginspage=\'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\'></embed></body></html>');
win.window.focus();
return false;
}

function PlayStreetFilm(title, file, image) {
	var win = OpenWindow('',title,465,385,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object type="application/x-shockwave-flash" height="369" width="450" data="http://www.streetfilms.org/flvplayer.swf"><param name="movie" value="http://www.streetfilms.org/flvplayer.swf" /><param name="bgcolor" value="#000000" /><param name="flashvars" value="displayheight=349&file=http://www.streetfilms.org/wp-content/uploads/' + file + '&image=http://www.streetfilms.org/wp-content/uploads/' + image + '&overstretch=true&showfsbutton=false&showdigits=true&backcolor=0x22313c&frontcolor=0xbfced8&lightcolor=0xc1d72e&volume=90&autostart=true&logo=http://www.streetfilms.org/wp-content/themes/streetfilms/images/streetfilms_watermark.png&link=http://www.streetfilms.org&title=Physically Separated Bike Lanes OFFSITE&id=168&callback=http://www.streetfilms.org/wp-content/plugins/streetfilms/statistics.php" /></object></body></html>');
win.window.focus();
return false;
}


function PlayBreakVideo(title, id) {
	var win = OpenWindow('',title,480,412,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object width="464" height="392"><param name="movie" value="http://embed.break.com/' + id +'"></param><embed src="http://embed.break.com/' + id + '" type="application/x-shockwave-flash" width="464" height="392"></embed></object></body></html>');
win.window.focus();
return false;
}

function PlayLiveVideo(title, id) {
	var win = OpenWindow('',title,460,369,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><embed src="http://www.livevideo.com/flvplayer/embed/'+ id +'" type="application/x-shockwave-flash" quality="high" WIDTH="445" HEIGHT="369" wmode="transparent"></embed></body></html>');
win.window.focus();
return false;
}



function PlayYahooVideo(title, id) {
	var win = OpenWindow('',title,445,370,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><embed src="http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf" flashvars="id=' + id + '&imTitle=' + title +'" type="application/x-shockwave-flash" width="425" height="350"></embed></body></html>');
win.window.focus();
return false;
}

function PlayBrightroomVideo(title, id) {
	var win = OpenWindow('',title,502,428,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><embed src="http://services.brightcove.com/services/viewer/federated_f8/1137883380" bgcolor="#FFFFFF" flashVars="videoId=' + id + '&playerId=1137883380&viewerSecureGatewayURL=https://services.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&" base="http://admin.brightcove.com" name="flashObj" width="486" height="412" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></body></html>');
win.window.focus();
return false;
}

function PlayBlipTvVideo(title, url, brandname, brandlink) {
	var win = OpenWindow('',title,495,415,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=' + url + '&autostart=false&brandname=' + brandname + '&brandlink=' + brandlink + '" width="480" height="392" allowfullscreen="true" id="showplayer"><param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&file=' + url + '&autostart=false&brandname=' + brandname + '&brandlink=' + brandlink + '" /><param name="quality" value="best" /></object></body></html>');
win.window.focus();
return false;
}

function PlayQTVideo(title, url, width, height) {
		var h2 = parseInt(height)+31;
		var h3 = parseInt(height)+16;
		var w2 = parseInt(width)+16;
		var win = OpenWindow('',title,w2,h2,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+h3+'" width="'+width+'"><param name="src" value="'+url+'"><param name="autoplay" value="true"><param name="controller" value="true"><embed pluginspage="http://www.apple.com/quicktime/download/" cache="false" src="'+url+'" type="video/quicktime" height="'+h3+'" width="'+width+'"> </object></body></html>');
win.window.focus();
return false;
}

function PlayRealVideo(title, url, width, height) {
		var win = OpenWindow('',title,15+width,70+height,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object id="myMovie" classid="CLSID:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height="' + height + '" width="' + width + '"> <param name="controls" value="ImageWindow"> <param name="console" value="video"> <param name="center" value="true"> <param name="type" value="audio/x-pn-realaudio-plugin"> <embed name="myMovie" TYPE="audio/x-pn-realaudio-plugin" src="' + url + '" height="' + height + '" width="' + width + '" nojava="true" controls="ImageWindow" console="video" center="true" pluginspage="http://www.real.com/"></embed> </object> <br clear="all"/> <object id="myMovie" classid="CLSID:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height="50" width="' + width + '"> <param name="controls" value="all"> <param name="console" value="video"> <param name="center" value="true"> <param name="type" value="audio/x-pn-realaudio-plugin"> <embed name="myMovie" TYPE="audio/x-pn-realaudio-plugin" src="' + url + '" height="50" width="' + width + '" nojava="true" controls="all" console="video" center="true" pluginspage="http://www.real.com/"></embed> </object></body></html>');
win.window.focus();
return false;
}

function PlayDailyMotion(title, id, width, height) {
		var h2 = parseInt(height)+15;
		var w2 = parseInt(width)+15;
        var winl = (screen.width - w2) / 2;
        var wint = (screen.height - h2) / 2;
        winprops = 'height='+h2+',width='+w2+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
        var win = window.open("",title,winprops);
win.document.write('<html><head><title>'+title+'</title></head><body><object width="520" height="411"><param name="movie" value="http://www.dailymotion.com/swf/'+id+'&v3=1&related=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/'+id+'&v3=1&related=1" type="application/x-shockwave-flash" width="520" height="411" allowFullScreen="true" allowScriptAccess="always"></embed></object></body></html>');
win.window.focus();
return false;
}

function PlayCycleTo(title, id) {
	var win = OpenWindow('',title,501,427,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><embed src="http://www.brightcove.tv/playerswf" bgcolor="#FFFFFF" flashVars="initVideoId=' + id + '&servicesURL=http://www.brightcove.tv&viewerSecureGatewayURL=https://www.brightcove.tv&cdnURL=http://admin.brightcove.com&autoStart=false" base="http://admin.brightcove.com" name="bcPlayer" width="486" height="412" allowFullScreen="true" allowScriptAccess="always" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></body></html>');
win.window.focus();
return false;
}


function PlaySavannahNow(title, id) {
	return PlayCycleTo(title,id);
}



function PlayCosmos(title, id, day, month, year) {
	url = 'http://cosmos.bcst.yahoo.com/up/player/popup/index.php?cl='+id;
	NewWindow(url,title,430,426,'no');
	return false;
	/*
        var winl = (screen.width - 419) / 2;
        var wint = (screen.height - 426) / 2;
        winprops = 'height='+426+',width='+419+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
        win = window.open("",title,winprops);
        
        
win.document.write('<html><head><META HTTP-EQUIV="Refresh" CONTENT="0; URL="http://cosmos.bcst.yahoo.com/up/player/popup/index.php?cl='+id+'"><title>' +title+'</title></head><body></body></html>');       
       
        
win.document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"width="320"height="270"id="yfop"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://cosmos.bcst.yahoo.com/up/fop/embedflv/swf/fop.swf" /><param name="flashvars" value="id='+ id +'" /><embed	src="http://cosmos.bcst.yahoo.com/up/fop/embedflv/swf/fop.swf" width="320" height="270" name="yfop" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id='+ id +'" /></object>');
win.window.focus();*/
}

function PlayCosmos2(obj, title) {
	//alert("test");
	click_track_explicit(obj.href);
	NewWindow(obj.href, title, 430, 426, 'no'); 
	return false;
}


function PlayVersus(title,id,ver) {
	var win = OpenWindow('/players/versus/?title='+title+'&id='+id+'&ver='+ver,title,677,385,'no');
	/*
	win.document.write('<html><head><title>'+title+'</title></head><body><div style="margin-top:-30px"><script language="JavaScript" type="text/javascript" src="http://versus.img.cdn.dayport.com/dayportcore/dpm/DayPortPlayers.js"></script><script language="JavaScript" type="text/javascript">DayPortPlayer.newPlayer({articleID:"69476",playerInstanceID:"85A2AF24-3DB6-B851-C54B-2B44EF9116AA",domain:"oln.dayport.com"});</script></div>');*/
	win.window.focus();
	return false;
/*
	win.document.write('<html><head><title>'+title+'</title></head><body><div style="margin-top:-30px"><script language="JavaScript" type="text/javascript" src="http://versus.img.cdn.dayport.com/dayportcore/dpm/DayPortPlayers.js"></script><script language="JavaScript" type="text/javascript">DayPortPlayer.newPlayer({articleID:"' + id + '",playerInstanceID:"85A2AF24-3DB6-B851-C54B-2B44EF9116AA",domain:"oln.dayport.com"});</script></div></body></html>');
	win.window.focus();*/
}

function PlayInnerTube(title,id) {
	var win = OpenWindow('',title,436,379,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="420" height="365" id="Video'+ id +'"><param name="movie" value="http://theinnertube.cycling.tv/kickapps/flash/premium_drop_v3.swf?b=1&amp;widgetHost=theinnertube.cycling.tv&amp;mediaType=VIDEO&amp;mediaId=189340&amp;as=2501" type="application/x-shockwave-flash"></param><param name="allowScriptAccess" value="always"></param><embed src="http://theinnertube.cycling.tv/kickapps/flash/premium_drop_v3.swf?b=1&amp;widgetHost=theinnertube.cycling.tv&amp;mediaType=VIDEO&amp;mediaId=189340&amp;as=2501" quality="best" width="420" height="365" allowfullscreen="true" allowScriptAccess="always"></embed></object></body></html>');
win.window.focus();
return false;
}

function PlayAOL(title,player_id,pmms) {
	var win = OpenWindow('',title,335,320,'no');
win.document.write('<html><head><title>'+title+'</title></head><body><OBJECT id="player' + player_id +'" codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" height="308" width="320" padding="0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" VIEWASTEXT><PARAM NAME="FlashVars" VALUE="autoplay=false&assetId=video:asset:pmms:' + pmms + '&playerId=player' + player_id +'"><PARAM NAME="Movie" VALUE="http://o.aolcdn.com/mediaplayer/players/fpm/fpm.swf"><PARAM NAME="src" VALUE="http://o.aolcdn.com/mediaplayer/players/fpm/fpm.swf"><PARAM NAME="WMode" VALUE="transparent"><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="AllowNetworking" VALUE="all"><embed src="http://o.aolcdn.com/mediaplayer/players/fpm/fpm.swf" FlashVars="autoplay=false&assetId=video:asset:pmms:' + pmms + '&playerId=player' + player_id +'" quality="high" width="320" height="308" name="player' + player_id +'"  allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  wmode="transparent"></embed></OBJECT></body></html>');
win.window.focus();
return false;
}






// gmt_offset is how many hours the specified time is ahead of GMT or UTC example Germany is 2 hours ahead of GMT; PST minus 7 since it's 7 hours behind GMT
function activate_link(title, href, gmt_offset,  year, month, day, hours, minutes) {
	var finish_date = new Date(Date.UTC(year, month, day, hours, minutes, 0, 0));
	finish_date.setHours(finish_date.getHours() - gmt_offset);
	var current_date = new Date();
	
	var attribute_name = "name";
	if (current_date >= finish_date) {
		attribute_name = "href";
	}
	document.write('<a ' + attribute_name + '="' + href + '">' + title + '<\/a>');
	//document.write(" current: " + current_date.toUTCString() + "; finish: "+ finish_date.toUTCString());
}

// date must be in the form of "March 9, 2007" and  "12:10 pm GMT"
// display_type: full = 0;  March 9, 12:10 pm; time = 1 12:10 
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'Novemer', 'December'];

var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

function gmt_start_to_local_time(display_type, year, month, day, hours, minutes, seconds) {
	
	var d =  new Date(Date.UTC(year, month, day, hours, minutes, seconds, 0));
	var lts = d.toLocaleTimeString();
	if (display_type == 0) { // display full date
		document.write(d.toUTCString());
		document.write(' ('+ lts.substring(0, lts.length) + ' your time)');	
	}
	else if (display_type == 1) { // display full date
		
		document.write(d.format("longTime"));
	}
	
		//document.write(months[d.getUTCMonth()] + ' ' + d.getUTCDay() + ', ');
	//document.write(d.getUTCHours() + ':' +  d.getUTCMinutes());
	
}

/*
	Date Format 1.1
	(c) 2007 Steven Levithan <stevenlevithan.com>
	MIT license
	With code by Scott Trenda (Z and o flags, and enhanced brevity)
*/

/*** dateFormat
	Accepts a date, a mask, or a date and a mask.
	Returns a formatted version of the given date.
	The date defaults to the current date/time.
	The mask defaults ``"ddd mmm d yyyy HH:MM:ss"``.
*/
var dateFormat = function () {
	var	token        = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g,
		timezone     = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
		timezoneClip = /[^-+\dA-Z]/g,
		pad = function (value, length) {
			value = String(value);
			length = parseInt(length) || 2;
			while (value.length < length)
				value = "0" + value;
			return value;
		};

	// Regexes and supporting functions are cached through closure
	return function (date, mask) {
		// Treat the first argument as a mask if it doesn't contain any numbers
		if (
			arguments.length == 1 &&
			(typeof date == "string" || date instanceof String) &&
			!/\d/.test(date)
		) {
			mask = date;
			date = undefined;
		}

		date = date ? new Date(date) : new Date();
		if (isNaN(date))
			throw "invalid date";

		var dF = dateFormat;
		mask   = String(dF.masks[mask] || mask || dF.masks["default"]);

		var	d = date.getDate(),
			D = date.getDay(),
			m = date.getMonth(),
			y = date.getFullYear(),
			H = date.getHours(),
			M = date.getMinutes(),
			s = date.getSeconds(),
			L = date.getMilliseconds(),
			o = date.getTimezoneOffset(),
			flags = {
				d:    d,
				dd:   pad(d),
				ddd:  dF.i18n.dayNames[D],
				dddd: dF.i18n.dayNames[D + 7],
				m:    m + 1,
				mm:   pad(m + 1),
				mmm:  dF.i18n.monthNames[m],
				mmmm: dF.i18n.monthNames[m + 12],
				yy:   String(y).slice(2),
				yyyy: y,
				h:    H % 12 || 12,
				hh:   pad(H % 12 || 12),
				H:    H,
				HH:   pad(H),
				M:    M,
				MM:   pad(M),
				s:    s,
				ss:   pad(s),
				l:    pad(L, 3),
				L:    pad(L > 99 ? Math.round(L / 10) : L),
				t:    H < 12 ? "a"  : "p",
				tt:   H < 12 ? "am" : "pm",
				T:    H < 12 ? "A"  : "P",
				TT:   H < 12 ? "AM" : "PM",
				Z:    (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
				o:    (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4)
			};

		return mask.replace(token, function ($0) {
			return ($0 in flags) ? flags[$0] : $0.slice(1, $0.length - 1);
		});
	};
}();

// Some common format strings
dateFormat.masks = {
	"default":       "ddd mmm d yyyy HH:MM:ss",
	shortDate:       "m/d/yy",
	mediumDate:      "mmm d, yyyy",
	longDate:        "mmmm d, yyyy",
	fullDate:        "dddd, mmmm d, yyyy",
	shortTime:       "h:MM TT",
	mediumTime:      "h:MM:ss TT",
	longTime:        "h:MM:ss TT Z",
	isoDate:         "yyyy-mm-dd",
	isoTime:         "HH:MM:ss",
	isoDateTime:     "yyyy-mm-dd'T'HH:MM:ss",
	isoFullDateTime: "yyyy-mm-dd'T'HH:MM:ss.lo"
};

// Internationalization strings
dateFormat.i18n = {
	dayNames: [
		"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
		"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
	],
	monthNames: [
		"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
	]
};

// For convenience...
Date.prototype.format = function (mask) {
	return dateFormat(this, mask);
}

function caption_image(a) {
	if (a['align'] == undefined) a['align'] = 'left';
	if (a['align'] == 'left')
		margin = 'right';
	else
		margin = 'left';
	document.write('<table width="'+a['width']+'" align="'+a['align']+'" style="margin-'+margin+':10px"><tr><td><img src="'+a['image_url']+'" width="'+a['width']+'" border="1"/><br clear="'+a['align']+'"/><div style="padding:2px 2px 2px 2px;font:bold 11px arial;small;text-align:center;background-color:#B7B7B7">'+a['caption']+' (photo:' + a['credit'].link(a['source_url']) + ')</div></td></tr></table>');
}

function get_url_parameter(name) {
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function loadScript(url) {
   var e = document.createElement("script");
   e.src = url;
   e.type="text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e); 
}
// ------------- load html from server into specified container then hide activating link
function ajaxpage(url, containerid){
	var page_request = false;
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
		var page_request = new XMLHttpRequest();
	else if (window.ActiveXObject){ // if IE
		try {
				page_request = new ActiveXObject("Msxml2.XMLHTTP");
			} 
		catch (e){
				try{
					page_request = new ActiveXObject("Microsoft.XMLHTTP");
					}
				catch (e){}
		}
	}
	else
		return false;
	page_request.onreadystatechange=function(){
		loadpage(page_request, containerid);
	}
	page_request.open('GET', url, true);
	page_request.send(null);
	var hideID = ""+containerid+"_link";
	document.getElementById(hideID).style.display='none';
}

function loadpage(page_request, containerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
		document.getElementById(containerid).innerHTML=unescape(page_request.responseText);
}

var steephill_movie_base_path = "http://www.grassyknolltv.com/movies/steephill/";
function embed_steephill_movie(movie, w, h) {
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="' + h +'" width="' + w + '">');
 document.write('<param name="src" value="'+ steephill_movie_base_path + movie + '">');
 document.write('<param name="autoplay" value="true">');
 document.write('<param name="controller" value="true">');
 document.write('<embed height="'+ h + '" pluginspage="http://www.apple.com/quicktime/download/" src="'+ steephill_movie_base_path + movie +'" type="video/quicktime" width="' + w + '" controller="true" autoplay="true"> </object>');
}

function img(file, caption, settings) {
	if (!settings.width)
		settings.width=320;
	if (!settings.align)
		settings.align = "left";
	if (!settings.margin) {
		if (settings.align == "left")
			settings.margin = "right";
		else
			settings.margin = "left";
	}
	if (!settings.mwidth) {
		settings.mwidth = 10;
	}
		if (!settings.image_name) {
		settings.image_name = file;
	}
		
	document.write('<table width=' + settings.width + ' cellpadding="2" align=' + settings.align + ' style="background-color:#c7c7c7;margin-' + settings.margin + ':' + settings.mwidth +'px">');
	
	document.write('<tr><td>');
	document.write('<img src=' + file + ' name=' + settings.image_name + ' width=' + settings.width + ' />');
	document.write('<br clear=left />');
	document.write('<div style="background-color:#c7c7c7;margin-top:5px;margin-right:0px;font:bold 12px arial;line-height:1.35em">');
	document.write(unescape(caption));
	document.write('<\/div><\/td><\/tr><\/table>');
}

function toggleDisplay(showID, hideID) {
			document.getElementById(showID).style.display='inline';
			document.getElementById(hideID).style.display='none';
}
// -----------




