function specials() {
var content = '';
content += '<P CLASS="LeftNavHeader">Special Reports</P><P CLASS="LeftNavLink"><A HREF="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1155031315217">AIDS Summit</A></P>';
content += '<P CLASS="LeftNavLink"><A HREF="http://www.thestar.com/gtaelections">GTA Elections</A></P>';
content += '<P CLASS="LeftNavLink"><A HREF="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1153490686657">Mideast Crisis</A></P>';
content += '<P CLASS="LeftNavLink"><A HREF="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1122559085590">Wakestock</A></P>';
content += '<P CLASS="LeftNavLink"><A HREF="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1151402511282">Canada in 2020</A></P>';
content += '<P CLASS="LeftNavLink"><A HREF="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1140433364397">Afghanistan</A></P>';
content += '<P CLASS="LeftNavLink"><A HREF="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1034676683947">[More Specials]</A></P>';
content += '';
content += '';
content += '';
content += '';
content += '';
content += '';
content += '';
document.write(content);
}

function feature() {
var content = '';
content += '<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"><tr><FORM><td colspan="5" class="expull1"><SELECT name="ExtraSections" class="expull1" onChange="MM_jumpMenu(\'parent\',this,0)"> <OPTION VALUE="#">Feature Sections';
content += '<OPTION VALUE="#">----------';
content += '<OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=971794782442">@Biz</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1011789353817">Books</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1105528094507">Buzz</OPTION><OPTION VALUE="">Condos</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=973280119494">Fashion</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=968867496431">Food</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=968867505381">Health</OPTION><OPTION VALUE="">Homes</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=968867505075">I.D.</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1105528093962">Ideas</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=976600361453">Movies</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=968867506610">Travel</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=978552666364">What\'s On</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=968867497088">Wheels</OPTION><OPTION VALUE="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1021543364560">Your Home</OPTION></SELECT></td></FORM></tr><TR><td colspan="5" class="sat1">&nbsp;&nbsp;Today\'s Features</td></TR><TR>  <TD width="14"> <DIV align="right" class="satbull">&gt;&nbsp;</DIV> </TD> <TD class="sat"><a href="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=973280119494">Fashion</a></TD>  <TD width="14"> <DIV align="right" class="satbull">&gt;&nbsp;</DIV> </TD> <TD class="sat"><a href="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=968867506610">Travel</a></TD></TR><TR>  <TD width="14"> <DIV align="right" class="satbull">&gt;&nbsp;</DIV> </TD> <TD class="sat"><a href="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=978552666364">What\'s On</a></TD>  <TD width="14"> <DIV align="right" class="satbull">&gt;&nbsp;</DIV> </TD> <TD class="sat"><a href="/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=1021543364560">Your Home</a></TD></TR></TABLE>';
content += '';
document.write(content);
}

function weather() {
var content = '';
content += '<table width="122" border="0" cellspacing="0" cellpadding="0">';
content += '<tr> ';
content += '<td class="weather1">Mostly Sunny</td>';
content += '<td width="3">&nbsp;</td>';
content += '<td rowspan="3"><img src="http://www.thestar.com/images/thestar/weather/icons/02.GIF" width="40" height="40"></td>';
content += '</tr>';
content += '<tr> ';
content += '<td class="weather1">H 28 / L 17</td>';
content += '<td width="3">&nbsp;</td>';
content += '</tr>';
content += '<tr> ';
content += '<td class="weather2">';
content += '<div align="left">';
content += '<NOBR><a href="http://www.thestar.com/NASApp/cs/ContentServer?pagename=thestar/Render&c=Page&cid=971188561551">4 Day Forecast</a></NOBR></div>';
content += '</td>';
content += '<td width="3">&nbsp;</td>';
content += '</tr>';
content += '</table>';
content += '';
content += '';
content += '';
content += '';
content += '';
document.write(content);
}




function checkforblanks(){
  for (var i = 0; i < arguments.length; i += 2){
    if (!arguments[i])	{
	alert("The search field is empty. Please enter text to search Thestar.com.");
	return false;
    }
  }
  return true;
}

function visit( elem ) { 
    i = 0;
    while (i < elem.options.length) {
        if (elem.options[i].selected) {
            newURL = elem.options[i].value;
            break;
        }
        i++;
    }
  if (newURL != "") {
    document.location.href=newURL;
  } else {
        return 0;
  }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function validate(theform) {
  var isFull = checkforblanks(theform.query.value, "Search String");
  if (!isFull)
    {return false;}
}		

function gallery_open( sitename, galleryid, h, w ) {
        var GalleryWindow;
        var pagename = sitename + '/Render';
        if (h == null) {
            h = 650;
        }
        if (w == null) {
            w = 620;
        }
        pagename='thestar/Render';
        var url = 'http://www.lisashore.com/NASApp/cs/ContentServer?pagename='+pagename+'&c=Gallery&cid=' + galleryid;
        GalleryWindow = window.open( url, 'gallery_window', 'height=' + h + ',width=' + w + ',screenX=10,screenY=10,top=10,left=100,resizable=yes,scrollbars=yes' );
        if (GalleryWindow.opener == null) {
                GalleryWindow.opener = self;
        }

        GalleryWindow.focus();

}

function goTo( url ){
        document.location= url;
        return 1;
}

function view_gallery( sitename, galleryid, h, w, t, iid ) {
        var GalleryWindow;
        var pagename = sitename + '/Render';
        if (h == null) {
            h = 500;
        }
        if (w == null) {
            w = 488;
        }
        pagename='thestar/Render';
        var url = 'http://www.lisashore.com/NASApp/cs/ContentServer?pagename='+pagename+'&c=Gallery&cid=' + galleryid + '&t=' + t + '&colid=' + iid;
        GalleryWindow = window.open( url, 'gallery_window', 'height=' + h + ',width=' + w + ',screenX=10,screenY=10,top=10,left=100,resizable=yes,scrollbars=yes' );
        if (GalleryWindow.opener == null) {
                GalleryWindow.opener = self;
        }

        GalleryWindow.focus();

}

function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
if(dc.length >0){
   begin = dc.indexOf(cname);
   if(begin != -1 ) {
      begin += cname.length;
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin,end));
      }
   }
return null;
}

function setLongCookie(name, value) {
 var today=new Date();
 var expiry = new Date(today.getTime() + 366*24*3600*1000);
  if(value !=null && value != "")
   document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString()+"; path=/";
}

function getDomain(){
        url=document.location+"";
        if(url.indexOf("://")==-1){return "-";}
        rest=url.substring(url.indexOf("://")+3);
        domain=rest.substring(0,rest.indexOf("/"));
        return domain;
}

if(getCookie("gx_session_id_")){
        if(!getCookie("starAccess")){
                setLongCookie("starAccess", "Star-"+getCookie("gx_session_id_")+"||"+getDomain());
        }
        else{
                oldCookie=getCookie("starAccess");
                if(oldCookie.indexOf("||")==-1){ thisCookie=oldCookie+"||"+getDomain();}
                else{thisCookie=oldCookie;}
                setLongCookie("starAccess", thisCookie);
        }
}

  IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
  IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
  IE5plus = IE5 || IE6;

  if(IE5plus) {
    window.onbeforeprint = trackPrint;

    function trackPrint() {
      var printimg = new Image();
      printimg.src="http://www3.thestar.com/print/page_printed.gif";
    }
  }

function firstpopup( iUrl ) {
	var params = 'left=10,top=10,width='+(window.screen.width-50)+',height='+(window.screen.height-50)+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes';
	this.open(iUrl,'',params);
}

function getRandom() {
	return Math.floor(1000000*Math.random());
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var W = 275;
var H = 300;
var X = screen.width - W - 10;
var Y = 1;
var winprefs = "width="+W+",height="+H+",left="+X+",top="+Y+",screenX="+X+",screeY="+Y;
var winprefs2 = "resizable,scrollbars,width="+W+",height="+H+",left="+X+",top="+Y+",screenX="+X+",screeY="+Y;
var winprefs3 = "resizable,scrollbars,width=640,height=480,toolbar=yes,menubar=yes,location=yes";

function noRetWOpen(url, name, pref){
  window.open(url, name, pref);
}

function setCookie(name, value, expires){
document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

function doSurvey5() {
    currentpop="20060320";
    currentpage="http://www.thestar.com/survey/asksurvey.htm";
    sizex=400;
    sizey=210;
    var ExpireDate = new Date ();
    var expiredays = 365;
    ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
    var curLoc = location.href;
    if((curLoc.indexOf('http://www.thestar.com/NASApp/cs/ContentServer?pagename=thestar/Render&inifile=futuretense.ini&c=Page&cid=968332188492&pubid=968163964505')==-1) || (curLoc.indexOf("http://www.lisashore.com/Media/Star/TorStar060817_files/test.html")==-1)) {
        setCookie('cookieEnabled', 'true', ExpireDate);
        var cookieEnabled = getCookie('cookieEnabled');
        if (cookieEnabled == 'true'){
            nth = 5;
        }
        else{
            nth = 150;
        }

        var rnd = Math.floor(Math.random() * nth) + 1;
        if (rnd == nth){
            if(getCookie("popup")!=currentpop){
                setLongCookie("popup",currentpop);
                window.open(currentpage, "aaa", "width="+sizex+",height="+sizey+",location=no,resizable=yes,scrollbars=yes");
            }
        }
    }
}


function setSimpleForm( searchString, indexname ) {
        if( document.SimpleSearch.query ) {
                document.SimpleSearch.query.value = searchString;
		document.SimpleSearch.query.focus();
        }
	if( indexname ) {
		if( document.SimpleSearch.elements['http://www.lisashore.com/Media/Star/TorStar060817_files/index.name'] ) {
			document.SimpleSearch.elements['http://www.lisashore.com/Media/Star/TorStar060817_files/index.name'].value = indexname;
		}
	}
}

