// JavaScript Document


var footer_top="";
var path=""

if (navigator.appName=="Netscape") footer_top=window.innerHeight-40;
if ((navigator.appName).indexOf("Microsoft")!=-1) footer_top=document.body.clientHeight-40;

window.onresize = resize_handler;

function write_footer(){
   document.write(' <script language="JavaScript1.2"> if ((navigator.appName).indexOf("Microsoft")!=-1) document.write(get_footer(document.getElementById("page_body").height)); else document.write(get_footer(eval(document.getElementById("page_body").attributes.height.value))); </script>');
}

function write_header( x_path ){
  path=x_path;
  document.write('<script language="JavaScript1.2">  document.write(get_header(path)); </script>');
}
function resize_handler(e) {
var top="";
var client_area="";

if (navigator.appName=="Netscape"){

 client_area=window.innerHeight;
 top=window.innerHeight-40;

// alert(document.getElementById("footer").style.top);

// if (document.getElementById("page_body").height < eval(top)) document.getElementById("footer").style.top=top;
 if (document.getElementById("page_body").attributes.height.value < eval(top)) document.getElementById("footer").style.top=top; 
 else document.getElementById("footer").style.top=eval(document.getElementById("page_body").attributes.height.value)+eval(10);
 }


if ((navigator.appName).indexOf("Microsoft")!=-1){
 client_area=document.body.clientHeight;
 top=document.body.clientHeight-40;

if (document.getElementById("page_body").height < eval(top)) document.getElementById("footer").style.top=top;
else document.getElementById("footer").style.top=eval(document.getElementById("page_body").height)+10;
}

}

function get_header() {
    var header ="";
	
	if (path == undefined) header ='<table width="100%" border="0"  cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="245" rowspan="3"><img src="images/street_perfect_bar_01.gif" width="245" height="100"></td> <td height="51" colspan="2" valign="top" background="images/header_slice_up.gif"><img src="images/street_perfect_bar_02.gif" width="497" height="51"></td> </tr><tr><td height="41" colspan="2" align="left" valign="top" background="images/header_slice_down.gif"><img src="images/street_perfect_bar_04.gif" width="84" height="41" name="menu0" id="menu0" onMouseOver="showMenu(event)" onMouseOut="hideMenu(event)"><img src="images/street_perfect_bar_05.gif" width="88" height="41" name="menu1" id="menu1" onMouseOver="showMenu(event)" onMouseOut="hideMenu(event)"><img src="images/street_perfect_bar_06.gif" width="72" height="41"><img src="images/street_perfect_bar_07.gif" width="253" height="41"></td> </tr> <tr> <td width="100%" rowspan="2" hight="20" valign="top"> </td> <td width="1" height="8"></td></tr> <tr> <td height="4"></td> <td></td> </tr> <tr> <td height="33"></td> <td></td> <td></td> </tr> <tr> <td height="1"></td> <td></td> <td></td> </tr> </table>';
    else header ='<table width="100%" border="0"  cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="245" rowspan="3"><img src="images/street_perfect_bar_01.gif" width="245" height="100"></td> <td height="51" colspan="2" valign="top" background="images/header_slice_up.gif"><img src="images/street_perfect_bar_02.gif" width="497" height="51"></td> </tr><tr><td height="41" colspan="2" align="left" valign="top" background="images/header_slice_down.gif"><img src="images/street_perfect_bar_04.gif" width="84" height="41" name="*menu0" id="menu0" onMouseOver="showMenu(event)" onMouseOut="hideMenu(event)"><img src="images/street_perfect_bar_05.gif" width="88" height="41" name="menu1" id="menu1" onMouseOver="showMenu(event)" onMouseOut="hideMenu(event)"><img src="images/street_perfect_bar_06.gif" width="72" height="41"><img src="images/street_perfect_bar_07.gif" width="253" height="41"></td> </tr> <tr> <td width="100%" rowspan="2"  valign="top"> '+path+' </td> <td width="1" height="8"></td></tr> <tr> <td height="4"></td> <td></td> </tr> <tr> <td height="33"></td> <td></td> <td></td> </tr> <tr> <td height="1"></td> <td></td> <td></td> </tr> </table>';
	return header;
}

//width heith
function get_footer(total_height){
var footer = "";
var position=eval(total_height)+eval(10);
if (total_height > eval(footer_top)) footer='<table id="footer" width="100%" border="0" cellpadding="0" cellspacing="0" style="position:absolute;'+'top:'+position+'"; > <!--DWLayoutTable--> <tr> <td width="100%" height="13" valign="top" background="images/line_blue.gif"><img src="images/line_blue.gif" width="4" height="13"></td> </tr> <tr valign="middle"> <td height="11" width="100%" valign="top"> <p class="foot">Sun Media Corporation</p></td> </tr> <tr valign="middle"> <td height="11" width="100%" valign="top"> <p class="foot">Copyright &copy; 2003 StreetPerfect</p></td> </tr> </table>';
//footer='<table id="footer" width="100%" border="0" cellpadding="0" cellspacing="0" > <!--DWLayoutTable--> <tr> <td width="780" height="13" valign="top" background="images/line_blue.gif"><img src="images/line_blue.gif" width="4" height="13"></td> </tr> <tr valign="middle"> <td height="11" valign="top"> <p class="foot">Toronto Sun a division of Sun Media Corporation</p></td> </tr> <tr valign="middle"> <td height="17" valign="top"> <p class="foot">Copyright &copy; 2003 StreetPerfect</p></td> </tr> </table>';
else footer='<table id="footer" width="100%" border="0" cellpadding="0" cellspacing="0" style="position:absolute;'+'top:'+footer_top+'";'+'> <!--DWLayoutTable--> <tr> <td width="100%" height="13" valign="top" background="images/line_blue.gif"><img src="images/line_blue.gif" width="4" height="13"></td> </tr> <tr valign="middle"> <td height="11" width="100%" valign="top"> <p class="foot">Sun Media Corporation</p></td> </tr> <tr valign="middle"> <td height="11" width="100%" valign="top"> <p class="foot">Copyright &copy; 2003 StreetPerfect</p></td> </tr> </table>';

//document.write(footer);
//alert(document.getElementById("footer"));


return footer;
}

function get_os(){
var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
return OSName;
}

function get_browser(){
var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var sBrowser = "";
var fullVersion = parseFloat(nVer);
var majorVersion = parseInt(nVer);

if ((navigator.userAgent).indexOf("Opera")!=-1) {
sBrowser ="Opera";
}

else if (navigator.appName=="Netscape") {
sBrowser ="Netscape";
}
else if ((navigator.appName).indexOf("Microsoft")!=-1) {
sBrowser ="Internet Explorer";
}

// In Internet Explorer, the true version is after "MSIE" 
if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
 fullVersion = parseFloat(nAgt.substring(verOffset+5,nAgt.length));
 majorVersion = parseInt(''+fullVersion);
}

// In Opera, the true version is after "Opera"
if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
 fullVersion = parseFloat(nAgt.substring(verOffset+6,nAgt.length));
 majorVersion = parseInt(''+fullVersion);
}

sBrowser=sBrowser+": Full version = "+fullVersion;
sBrowser=sBrowser+" - Major version = "+majorVersion;

return sBrowser;
}

