var gAutoPrint = true; // Tells whether to automatically call the print function
function rotate(){
var cur=Math.round(20*Math.random())
var now =new Date();
var hour = now.getHours();
if (hour >=5 && hour <=19) {
document.write('<!--DAYTIME--><a href="http://www.thepilot.com"><img src="http://www.thepilot.com//banners/day/'+cur+'.jpg" WIDTH="685" HEIGHT="80" BORDER="0"></A>')
}else{
document.write('<!--NIGHTTIME--><a href="http://www.thepilot.com"><img src="http://www.thepilot.com/banners/night/'+cur+'.jpg" WIDTH="685" HEIGHT="80" BORDER="0"</A>')

}
}
function poptastic(url) 
{
        var newwindow;  
        newwindow=window.open(url,'name','height=125,width=500');
        if (window.focus) {newwindow.focus()}
}
function popspecific(url,width,height)
{
        var newwindow;
        newwindow=window.open(url,'name','height='+height+',width='+width);
        if (window.focus) {newwindow.focus()}
} 
function entsub(event,ourform) {
  if (event && event.which == 13)
    ourform.submit();
  else
    return true;
}



function printSpecial()
{
if (document.getElementById != null)
{
var html = '<HTML>\n<HEAD>\n';

if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}

html += '\n</HE>\n<BODY>\n';

var printReadyElem = document.getElementById("printReady");
var printReadyElem1 = document.getElementById("printReady1");
var cur=Math.round(20*Math.random())

if (printReadyElem != null)
{
html += "<CENTER><IMG SRC=\"/banners/day/" + cur + ".jpg\" WIDTH=685 HEIGHT=80></CENTER><BR><BR>";
html += printReadyElem.innerHTML;
html += printReadyElem1.innerHTML;
html += "<BR><CENTER><FONT FACE=ARIAL SIZE=2><B>All contents &copy; The PIlot LLC. Contents cannot be reproduced or used without express written consent of the publisher.<br></B></FONT></CENTER><BR>";}
else
{
alert("Could not find the printReady function");
return;
}

html += '\n</BO>\n</HT>';

var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("The print ready feature is only available if you are using an browser. Please update your browswer.");
}
}
/* AUDIO LOADER */
function loadAudio(fName,track,options) {
        if (!options) options = {};
        options.width = options.width || 150;
        options.height = options.height || 21;
        var url = "http://audio.thepilot.com/files/"+fName;
        var player = "http://www.thepilot.com/widgets/PilotPlayer1.swf?src=";
        var embed = '<object type="application/x-shockwave-flash" ';
        embed += 'data="' + player+url+'" ';
        embed += 'width="'+options.width+'" ';
        embed += 'height="'+options.height+'" ';
        embed += '/>'+"\n";
        embed += ' <param name="movie" ';
        embed += 'value="' + player+url+'" ';
        embed += '/>'+"\n";
        embed += ' <param name="quality" value="high" />'+"\n";
        embed += '</object>'+"\n";
        document.write(embed);
}

