var windowL = window.location.href;
var pageLoc;
document.write("<meta http-equiv='refresh' content='300'>");
if (windowL.indexOf("CTVE") > 0)
{
withWindow = "CTVE";
pageLoc = "/ctvnews/affiliate/Edmonton/albertaElection2008;/ctvnews/affiliate/Edmonton/albertaElection2008";
document.write('<style type="text/css" media="all">@import "http://www.ctvedmonton.ca/tl/css/home.css";</style>');
document.write('<style type="text/css" media="all">@import "http://www.ctv.ca/mar/css/shared990/ctvlocal990.css";</style>');

}
else if (windowL.indexOf("CTVC") > 0)
{
withWindow = "CTVC";
pageLoc = "/ctvnews/affiliate/Calgary/albertaElection2008;/ctvnews/affiliate/Calgary/albertaElection2008";
document.write("<style>#CalgaryHeader td {margin:0px;padding:0px}</style>");
document.write("<style>#CalgaryHeader table {border-collapse:collapse}</style>");
document.write("<style type='text/css' media='all'>@import 'http://images.ctv.ca/mar/css/ctv.css';</style>");
document.write("<style type='text/css' media='all'>@import 'http://images.ctv.ca/mar/css/top.css';</style>");
document.write("<style>a {font-size:12px!important}</style>");
document.write("<style>#footLogos a{font-size:10px!important}</style>");
document.write("<style>#mainNav a{font-size:10px!important}</style>");



}
else
{
withWindow = "CTVI";
pageLoc = "/ctvnews/albertaElection2008;/ctvnews/albertaElection2008";
document.write("<style type='text/css' media='all'>@import 'http://images.ctv.ca/mar/css/ctv.css';</style>");

document.write("<style type='text/css' media='all'>@import 'http://images.ctv.ca/mar/css/top.css';</style>");
document.write("<style>a {font-size:12px!important}</style>");
document.write("<style>#footLogos a{font-size:10px!important}</style>");
document.write("<style>#mainNav a{font-size:10px!important}</style>");


}
document.write("<link href='http://www.ctv.ca/mini/albertaElection2008/main.css' rel='stylesheet' type='text/css'/>");

function showHomeP()
{
var windowL = window.location.href;

if (windowL.indexOf("CTVE") > 0)
{
document.getElementById("EdmontonMap").style.display = "block";
document.getElementById("EdmTopHeaderBar").style.display = "block";

}
else if (windowL.indexOf("CTVC") > 0)
{
document.getElementById("CalgaryMap").style.display = "block";
document.getElementById("CalTopHeaderBar").style.display = "block";

}
else
{
document.getElementById("CTVMap").style.display = "block";
document.getElementById("EdmTopHeaderBar").style.display = "block";
}



}

function showHeadFoot()
{
var windowL = window.location.href;

if (windowL.indexOf("CTVE") > 0)
{
document.getElementById("EdmontonFooter").style.display = "block";
document.getElementById("EdmontonHeader").style.display = "block";
document.getElementById("edmLead").style.display = "block";

}
else if (windowL.indexOf("CTVC") > 0)
{
document.getElementById("CalgaryFooter").style.display = "block";
document.getElementById("CalgaryHeader").style.display = "block";
document.getElementById("calLead").style.display = "block";
document.getElementById("calTopB").style.display = "block";


}
else
{
document.getElementById("CTVFooter").style.display = "block";
document.getElementById("CTVHeader").style.display = "block";

}
var objs = document.getElementById('mainTableRightContainer');
var totalO = objs.getElementsByTagName('th');
for (i = 0; i < totalO.length; i++)
{
    var totalI = totalO[i].getElementsByTagName('a');
    for (j = 0; j < totalI.length; j++)
    {
         totalI[j].setAttribute('href', totalI[j].getAttribute('href') + withWindow);
    }
}
var totalP = objs.getElementsByTagName('td');
for (i = 0; i < totalP.length; i++)
{
if (totalP[i].innerHTML == "NaN%")
{
totalP[i].innerHTML = "0%";
}
}
document.title = "Alberta Election 2008";
showTabI(1);
}

function showTabI(ID)
{
for (i = 1; i < 6; i++)
{

  if (i != ID) 
  {
    document.getElementById("tabS" + i).style.backgroundImage = "url(/mini/ontarioElection2007/images/white-ugrey-square.gif)";
	document.getElementById("tabS" + i).style.backgroundRepeat = "repeat-x";
 document.getElementById("tabS" + i).style.borderTop  = "0px";
    document.getElementById("tabS" + i).style.borderLeft  = "0px";
 document.getElementById("tabS" + i).style.borderBottom  = "0px";
 document.getElementById("tabS" + i).style.borderRightWidth  = "0px";
document.getElementById("tabS" + i).style.fontWeight = "normal";
document.getElementById("tabS" + i).style.fontStyle = "italic";


  }
  else
  { 
    document.getElementById("tabS" + i).style.backgroundImage = "url(/mini/ontarioElection2007/images/white-blue-box.gif)";
	document.getElementById("tabS" + i).style.backgroundRepeat = "no-repeat";
 document.getElementById("tabS" + i).style.borderTop  = "0px";
    document.getElementById("tabS" + i).style.borderLeft  = "0px";
 document.getElementById("tabS" + i).style.borderRight  = "0px";
 document.getElementById("tabS" + i).style.borderBottom  = "0px";
document.getElementById("tabS" + i).style.fontWeight = "normal";
document.getElementById("tabS" + i).style.fontStyle = "normal"; 

 document.getElementById("dataInfo").innerHTML = document.getElementById(withWindow + i).innerHTML;

  }
}
}


