// IBS Site Variables
var IBS_Sitekey = 'tor';

if (typeof IBSsite == 'undefined')  IBSsite = new Object();
	IBSsite.siteKey = 'tor';
	IBSsite.city = 'Toronto';
	IBSsite.state = 'Ontario';
	IBSsite.stateAbv = 'ON';

//Validate that the browser can open windows
WindowEnabled =  1;
WindowEnabled = ((navigator.userAgent.indexOf("MSIE 4.0") >= 1))? 0 : 1;
if (document.images)	{

// PRELOAD

	// ON VERSIONS
	newson = new Image(112, 19);          
	newson.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_news_on.gif";
	electionon = new Image(112, 19);          
	electionon.src = "http://toronto.globaltv.com/ca/images/structures/menus/site_navigation_electionon.gif"; 
	weatheron = new Image(112, 19);          
	weatheron.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_weather_on.gif";
	trafficon = new Image(112, 19);          
	trafficon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_traffic_on.gif";
	sportson = new Image(112, 19);          
	sportson.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_sports_on.gif";  
	watercooleron = new Image(112, 19);          
	watercooleron.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_watercooler_on.gif"; 
	entertainmenton = new Image(112, 19);          
	entertainmenton.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_entertainment_on.gif";
	holidayson = new Image(112, 19);          
	holidayson.src = "http://toronto.globaltv.com/ca/images/structures/menus/site_navigation_holidayson.gif";
	tvlistingson = new Image(112, 19);          
	tvlistingson.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_tvlistings_on.gif"; 
	technologyon = new Image(112, 19);          
	technologyon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_technology_on.gif"; 
	healthon = new Image(112, 19);          
	healthon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_health_on.gif";
	insideglobalon = new Image(112, 19);          
	insideglobalon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_insideglobal_on.gif";  
	yellowcaon = new Image(112, 19);          
	yellowcaon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_yellowca_on.gif";
	canewswireon = new Image(112, 19);          
	canewswireon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_canewswire_on.gif";
	careerson = new Image(112, 19);          
	careerson.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_careers_on.gif";
	shoppingon = new Image(112, 19);          
	shoppingon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_shopping_on.gif";
	travelon = new Image(112, 19);
	travelon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_travel_on.gif";
	contestson = new Image(112, 19);
	contestson.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_contests_on.gif";
	realestateon = new Image(112, 19);
	realestateon.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_realestate_on.gif";
	
	
	// OFF VERSIONS
	newsoff = new Image(112, 19);          
	newsoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_news_off.gif";
	electionoff = new Image(112, 19);          
	electionoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/site_navigation_electionoff.gif"; 
	weatheroff = new Image(112, 19);          
	weatheroff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_weather_off.gif";
	trafficoff = new Image(112, 19);          
	trafficoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_traffic_off.gif";
	sportsoff = new Image(112, 19);          
	sportsoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_sports_off.gif";  
	watercooleroff = new Image(112, 19);          
	watercooleroff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_watercooler_off.gif"; 
	entertainmentoff = new Image(112, 19);          
	entertainmentoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_entertainment_off.gif";
	holidaysoff = new Image(112, 19);          
	holidaysoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/site_navigation_holidaysoff.gif";
	tvlistingsoff = new Image(112, 19);          
	tvlistingsoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_tvlistings_off.gif"; 
	technologyoff = new Image(112, 19);          
	technologyoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_technology_off.gif"; 
	healthoff = new Image(112, 19);          
	healthoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_health_off.gif";
	insideglobaloff = new Image(112, 19);          
	insideglobaloff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_insideglobal_off.gif";  
	yellowcaoff = new Image(112, 19);          
	yellowcaoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_yellowca_off.gif";
	canewswireoff = new Image(112, 19);          
	canewswireoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_canewswire_off.gif";
	careersoff = new Image(112, 19);          
	careersoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_careers_off.gif";
	shoppingoff = new Image(112, 19);          
	shoppingoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_shopping_off.gif";
	traveloff = new Image(112, 19);
	traveloff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_travel_off.gif";
	contestsoff = new Image(112, 19);
	contestsoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_contests_off.gif";
	realestateoff = new Image(112, 19);
	realestateoff.src = "http://toronto.globaltv.com/ca/images/structures/menus/button_realestate_off.gif";
}

function Highlight(imgName)
	// HIGHLIGHT
         {
         if (document.images) 
                 {
                 imgOn = eval(imgName + "on.src");
                 document[imgName].src = imgOn;
                 }
         }
		 
function Unhighlight(imgName)
	 // UNHIGHLIGHT
         {
         if (document.images) 
                 {
                 imgOff = eval(imgName + "off.src");
                 document[imgName].src = imgOff;
                 }
         }
 

function popUp(URL, ATTRIBUTES)
	//OPEN WINDOW JS
	// takes all attributes in direct format
{
	DEF_ATTRIB = 'width=200,height=200,top=100,left=100,resizable=yes,scrollbars';
	if (ATTRIBUTES == null) {
	ATTRIBUTES = DEF_ATTRIB;
	}
	if (WindowEnabled){
	child = window.open(URL, "spawn", ATTRIBUTES);
	child.opener = self;
	if	(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '2') {
	// Do Nothing
	} else {
		child.focus();
	}
	} else {
		document.location = URL;
	}
}

function emailafriend(URL, ATTRIBUTES)
	//OPEN WINDOW JS
	// takes all attributes in direct format
{
	ATTRIBUTES = 'width=450,height=225,top=100,left=100,resizable=yes,scrollbars';
	MYURL = "http://weather.toronto.globaltv.com/services/toafriend/index.cfm?page=" + window.location;
	
	if (WindowEnabled){
		child = window.open(MYURL, "spawn", ATTRIBUTES);
		child.opener = self;
		if	(navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) == '2') {
			// Do Nothing
		} else {
			child.focus();
		}
	} else {
		document.location = MYURL;
	}
}

		
function health_archive(day)
	//Function closes Health Daily tips window and redirects user to archive
	{
			window.opener.location=("/sh/health/dailytips/"+day+"-archive.html");
			window.close();
	}	
	
function openVideo(sUrl, sName, sOptions) {
 window.open(sUrl,sName,sOptions+',scrollbars=no,resizable=1,top=50,left=50,width=780,height=504');
}	
