/* Video player function from vp.js */
/*function oMvsLink(gPV,sGuid,bDck,sMenu,sSubM,sURL,sPL,bRP,bStatic,sList)
{
	bDck=(bDck==1||bDck==true)?0:Math.min((bDck*1)+1,2);	
	if (gPV.indexOf("/")<1){gPV+="/64";}
	var sLink="http://g.msn.com/0VD0/"+gPV+"?t="+bDck;
	if (arguments.length>1)
	{
		sLink+=(sList)?"&p="+escape(sList):"";
		sLink+=((sMenu)?("&m="+sMenu+"&mi="+sSubM):"");
		sPL=sGuid+((sPL)?","+sPL:"");
		sLink+=((!bRP)?"&i=":"&r=")+sPL;
	}
	if (bDck)
	{
		var ovp=window.open(sLink,"ovp","width=788,height=598,status=1");
		if (sURL){location.href=sURL;}
	}
	else
	{
		location.href=sLink;
	}
}*/


function fnLaunchVideo(url)
{	
	window.open(url,'event','height=615,width=800,toolbar=no,status=no,menubar=no,scrollbars=yes,,resizable=yes');
}


function goToPrinterFriendlyPage(sQueryString)
{	
	window.open('http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/Print.aspx'+sQueryString,'PrintThisPage','height=460,width=685,left=0,top=0,toolbar=no,status=no,menubar=yes,scrollbars=yes,noresize');
}


function launchEmailPage(sQueryString, sPagePath, sPageName, sChannelName)
{
	thePageName = URLencode(sPageName);
	theChannelName = URLencode(sChannelName);
	thePagePath = URLencode(sPagePath);
	
	sQueryString += "&pageName="+thePageName+"&channelName="+theChannelName+"&pagePath="+thePagePath;

	window.open('http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/EmailAFriend.aspx'+sQueryString, 'EmailThisPage', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,history=no,resizable=no,width=450,height=460,left=0,top=0');
}

function launchTerms()
{
	window.open('http://11cameras.com/Privacy/TOU', 'TermsAndConditions', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,history=no,resizable=yes,width=800,height=460,left=100,top=100');
	//alert("ok");
	
}

function launchEmailPage11cameras(sQueryString, sPagePath, sPageName, sChannelName)
{
	thePageName = URLencode(sPageName);
	theChannelName = URLencode(sChannelName);
	thePagePath = URLencode(sPagePath);
	
	sQueryString += "&pageName="+thePageName+"&channelName="+theChannelName+"&pagePath="+thePagePath;

	window.open('http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/EmailAFriend11cameras.aspx'+sQueryString, 'EmailThisPage', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,history=no,resizable=no,width=450,height=460,left=0,top=0');
}

function URLencode(sStr) 
{   
	return escape(sStr).replace(/\+/g, '%20').replace(/\"/g,'%22').replace(/\'/g, '%27');
}


function URLexternal(externalURL)
{
	window.location.href = externalURL;
}


/* OnlineOpinion (S3t,1424b) */
/* This product and other products of OpinionLab, Inc. are protected by U.S. Patent No. 6606581, 6421724, 6785717 B1 and other patents pending. */
/*
var custom_var,_sp='%3A\\/\\/',_rp='%3A//',_poE=0.0, _poX=0.0,_sH=screen.height,_d=document,_w=window,_ht=escape(_w.location.href),_hr=_d.referrer,_tm=(new Date()).getTime(),_kp=0,_sW=screen.width;_d.onkeypress=_fK;function _fK(_e){if(!_e)_e=_w.event;var _k=(typeof _e.which=='number')?_e.which:_e.keyCode;if((_kp==15&&_k==12))_w.open('http://www.opinionlab.com/ozone/24-7.asp?referer='+_fC(_ht),'Report','width=370,height=200,resizable=no,copyhistory=no,scrollbars=no');_kp=_k};function _fC(_u){_aT=_sp+',\\/,\\.,-,_,'+_rp+',%2F,%2E,%2D,%5F';_aA=_aT.split(',');for(i=0;i<5;i++){eval('_u=_u.replace(/'+_aA[i]+'/g,_aA[i+5])')}return _u};function O_LC(){_w.open('http://ccc01.opinionlab.com/comment_card.asp?time1='+_tm+'&time2='+(new Date()).getTime()+'&prev='+_fC(escape(_hr))+'&referer='+_fC(_ht)+'&height='+_sH+'&width='+_sW+'&custom_var='+custom_var,'comments','width=535,height=192,screenX='+((_sW-535)/2)+',screenY='+((_sH-192)/2)+',top='+((_sH-192)/2)+',left='+((_sW-535)/2)+',resizable=yes,copyhistory=yes,scrollbars=no')};function _fPe(){if(Math.random()>=1.0-_poE){O_LC();_poX=0.0}};function _fPx(){if(Math.random()>=1.0-_poX)O_LC()};window.onunload=_fPx;function O_GoT(_p){_d.write('<a href=\'javascript:O_LC()\'>'+_p+'</a>');_fPe()}
*/
//DK20071011 vvv
//The above line has been replaced by the following code.
//The issues: if document, screen.height, screen.width undefined, unhandled error pops up.
//To be reviewed.
var custom_var;
var _sp='%3A\\/\\/';
var _rp='%3A//'
var _poE=0.0;
var _poX=0.0;
var _sH=0;
if (screen!=undefined)
{
    try
    {
        _sH=screen.height;
    }
    catch(ex)
    {
        _sH=0;
    }
}
var _w=window;
var _ht=escape(_w.location.href);
var _tm=(new Date()).getTime();
var _kp=0;
var _sW=0;
if (screen!=undefined)
{
    try
    {
        _sW=screen.width;
    }
    catch(ex)
    {
        _sW=0;
    }
}
function _fK(_e){if(!_e)_e=_w.event;var _k=(typeof _e.which=='number')?_e.which:_e.keyCode;if((_kp==15&&_k==12))_w.open('http://www.opinionlab.com/ozone/24-7.asp?referer='+_fC(_ht),'Report','width=370,height=200,resizable=no,copyhistory=no,scrollbars=no');_kp=_k};
var _d = null;
var _hr = null;
if (document != undefined)
{
    _d=document;
    _hr=_d.referrer;
    _d.onkeypress=_fK;
}
function _fC(_u){_aT=_sp+',\\/,\\.,-,_,'+_rp+',%2F,%2E,%2D,%5F';_aA=_aT.split(',');for(i=0;i<5;i++){eval('_u=_u.replace(/'+_aA[i]+'/g,_aA[i+5])')}return _u};
function O_LC(){_w.open('http://ccc01.opinionlab.com/comment_card.asp?time1='+_tm+'&time2='+(new Date()).getTime()+'&prev='+_fC(escape(_hr))+'&referer='+_fC(_ht)+'&height='+_sH+'&width='+_sW+'&custom_var='+custom_var,'comments','width=535,height=192,screenX='+((_sW-535)/2)+',screenY='+((_sH-192)/2)+',top='+((_sH-192)/2)+',left='+((_sW-535)/2)+',resizable=yes,copyhistory=yes,scrollbars=no')};
function _fPe(){if(Math.random()>=1.0-_poE){O_LC();_poX=0.0}};
function _fPx(){if(Math.random()>=1.0-_poX)O_LC()};
window.onunload=_fPx;
function O_GoT(_p){if (_d!=undefined){_d.write('<a href=\'javascript:O_LC()\'>'+_p+'</a>');_fPe()}}
//DK20071011 ^^^


/* methods for div tags */
var ie=0;var ie4=0;var ie5=0;var ie6=0;


function ieSniffer()
{
	var exclude=1;
	var agt=navigator.userAgent.toLowerCase();
	var win=0;var mac=0;var lin=1;
	if(agt.indexOf('win')!=-1){win=1;lin=0;}
	if(agt.indexOf('mac')!=-1){mac=1;lin=0;}
	var lnx=0;if(lin){lnx=1;}
	var ice=0;
	var com=0;var dcm;
	var op5=0;var op6=0;var op7=0;
	var ns4=0;var ns6=0;var ns7=0;var mz7=0;var kde=0;var saf=0;
	if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE")
	{
		var thisKDE=agt;
		var splitKDE=thisKDE.split("konqueror/");
		var aKDE=splitKDE[1].split("; ");
		var KDEn=parseFloat(aKDE[0]);
		if(KDEn>=2.2)
		{
			kde=1;
			ns6=1;
			exclude=0;
		}
	}
	else if(agt.indexOf('webtv')!=-1)	{exclude=1;}
	else if(typeof window.opera!="undefined")
	{
		exclude=0;
		if(agt.indexOf("opera/5")!=-1||agt.indexOf("opera 5")!=-1)	{op5=1;}
		if(agt.indexOf("opera/6")!=-1||agt.indexOf("opera 6")!=-1)	{op6=1;}
		if(agt.indexOf("opera/7")!=-1||agt.indexOf("opera 7")!=-1)	{op7=1;}
	}
	else if(typeof document.all!="undefined"&&!kde)
	{
		exclude=0;
		ie=1;
		if(typeof document.getElementById!="undefined")
		{
			ie5=1;
			if(agt.indexOf("msie 6")!=-1)
			{
				ie6=1;
				dcm=document.compatMode;
				if(dcm!="BackCompat")	{com=1;}
			}
		}	
		else	{ie4=1;}
	}
	if(typeof navigator.__ice_version!="undefined")	{exclude=1;ie4=0;}
}


ieSniffer();


function setSize( obj_name,width )
{
	if( ie )
	{
		if( document.all )
		{
			var  obj = div_GetObj(obj_name);
			if(  obj )
				obj.style.width = width+"px";
		}
	}
}


var prevWidthsOverlapped = 0;


function overlapppedNoAddtag_leftnav()
{
	if( ie )
	{
		var MAIN_CONTENT_PANEL = div_GetObj("MAIN_CONTENT_PANEL");
		var ADDTAG_PANEL = div_GetObj("ADDTAG_PANEL");
		var DIV_MAIN = div_GetObj( "DIV_MAIN" );
		var DIV_NAV = div_GetObj( "DIV_NAV" );
		
		if( MAIN_CONTENT_PANEL && ADDTAG_PANEL && DIV_NAV )
		{
			var max_size = 620;
			var nav_diff = 130-DIV_NAV.clientWidth;
			max_size+=nav_diff;
			if( ADDTAG_PANEL.clientWidth + MAIN_CONTENT_PANEL.clientWidth > max_size )
			{
				if( ADDTAG_PANEL.clientWidth>max_size-1 )
				{
					MAIN_CONTENT_PANEL.style.width = 1;
				}
				else
				{
					MAIN_CONTENT_PANEL.style.width = max_size - ADDTAG_PANEL.clientWidth;
				}
				if( ADDTAG_PANEL.clientWidth + MAIN_CONTENT_PANEL.clientWidth > max_size )
				{
					DIV_MAIN.style.width = ADDTAG_PANEL.clientWidth + MAIN_CONTENT_PANEL.clientWidth + 28 + DIV_NAV.clientWidth;	
					ADDTAG_PANEL.style.width = DIV_MAIN.clientWidth - MAIN_CONTENT_PANEL.clientWidth - 28 - DIV_NAV.clientWidth;
					MAIN_CONTENT_PANEL.style.width = DIV_MAIN.clientWidth - ADDTAG_PANEL.clientWidth - 28 - DIV_NAV.clientWidth;
				}	
			}
		}
	}
}


function div_GetObj(obj_name)
{ 
	var obj = null;
	if( ie )
	{
		if( document.getElementById )
		{
			obj = document.getElementById(obj_name);
		}
		else
		{
			obj = document.all[obj_name];
		}
	}
	return obj;
}

							
function _DivCSS()
{
	var path = "div_table.css";	
	if( ie )
	{
		path = "div_table_ie.css";
	}
	document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/Styles/'+path+'">');
}


function syncAddTag_leftnav()
{
	if( ie && document.all )
	{
		var ADDTAG_OBJ = div_GetObj( "ADDTAG_OBJ" );
		var ZONE_7 = div_GetObj( "ZONE_7" );
		var ZONE_8 = div_GetObj( "ZONE_8" );
		var ADDTAG_PANEL = div_GetObj( "ADDTAG_PANEL" );
		
		var max = ADDTAG_PANEL.clientWidth;
		if( ADDTAG_OBJ &&  max<ADDTAG_OBJ.clientWidth ) max = ADDTAG_OBJ.clientWidth;
		if( ZONE_7 && max<ZONE_7.clientWidth ) max = ZONE_7.clientWidth;
		if( ZONE_8 && max<ZONE_8.clientWidth ) max = ZONE_8.clientWidth;
		
		var width = ADDTAG_PANEL.style.width;
		var css_width = false;
		if( width.indexOf("px")>-1 )
		{
			width = width.substring(0,width.indexOf("px"));
			css_width = true;
		}
		if( max > width || !css_width)
			checkObjWidth( ZONE_8,max );
		if( max > width || !css_width)
			checkObjWidth( ADDTAG_OBJ,max );
		if( max > width || !css_width)
			checkObjWidth( ZONE_7,max );
	}
}


function checkObjWidth(obj,width)
{ 
	if(ie && obj && obj.clientWidth < width )
	{
		obj.style.width = width;
	}
}


function alignHeight_leftnav()
{
	if( ie )
	{
		var DIV_NAV = div_GetObj( "DIV_NAV" );
		var AUTH_PRESENT = div_GetObj( "AUTH_PRESENT" );
		if( DIV_NAV && AUTH_PRESENT )
		{
			if( DIV_NAV.clientHeight >AUTH_PRESENT.clientHeight  )
				AUTH_PRESENT.style.height = DIV_NAV.clientHeight;	
		}
	}
}


function alignMainDivHeightByDiv_leftnav()
{
	if( ie )
	{
		var DIV_NAV = div_GetObj( "DIV_NAV" );
		var DIV_MAIN = div_GetObj( "DIV_MAIN" );
		var AUTH_PRESENT = div_GetObj( "AUTH_PRESENT" );
		if( DIV_NAV && DIV_MAIN && AUTH_PRESENT)
		{
			if( DIV_NAV.clientWidth > 120 )
			{
				AUTH_PRESENT.style.marginLeft = DIV_NAV.clientWidth/2;
			}
			if(DIV_NAV.clientHeight>0)
				DIV_MAIN.style.height = DIV_NAV.clientHeight;
		}
	}
}


function syncAddTag_topnav()
{
	if( ie && document.all )
	{
		var ADDTAG_OBJ = div_GetObj( "ADTAG_OBJ" );
		var ZONE_7 = div_GetObj( "ZONE_11" );
		var ZONE_8 = div_GetObj( "ZONE_12" );
		var ADDTAG_PANEL = div_GetObj( "ADTAG_PANEL" );
		var max = ADDTAG_PANEL.clientWidth;
		if( ADDTAG_OBJ &&  max<ADDTAG_OBJ.clientWidth ) max = ADDTAG_OBJ.clientWidth;
		if( ZONE_7 && max<ZONE_7.clientWidth ) max = ZONE_7.clientWidth;
		if( ZONE_8 && max<ZONE_8.clientWidth ) max = ZONE_8.clientWidth;
		var width = ADDTAG_PANEL.style.width;
		var css_width = false;
		if( width.indexOf("px")>-1 )
		{
			width = width.substring(0,width.indexOf("px"));
			css_width = true;
		}
		if( max > width || !css_width)
			checkObjWidth( ZONE_8,max );
		if( max > width || !css_width)
			checkObjWidth( ADDTAG_OBJ,max );
		if( max > width || !css_width)
			checkObjWidth( ZONE_7,max );
	}
}


function overlapppedNoAddtag_topnav()
{
	if( ie )
	{
		var MAIN_CONTENT_PANEL = div_GetObj("MAIN_CONTENT_PANEL");
		var ADDTAG_PANEL = div_GetObj("ADTAG_PANEL");
		var DIV_MAIN = div_GetObj("DIV_MAIN");
		if( MAIN_CONTENT_PANEL && ADDTAG_PANEL && DIV_MAIN)
		{
			if( ADDTAG_PANEL.clientWidth + MAIN_CONTENT_PANEL.clientWidth > 749 )
			{
				if( ADDTAG_PANEL.clientWidth>748 )
				{
					MAIN_CONTENT_PANEL.style.width=1;
				}
				else
				{
					MAIN_CONTENT_PANEL.style.width = 749-ADDTAG_PANEL.clientWidth;
					ADDTAG_PANEL.style.width = 749 - MAIN_CONTENT_PANEL.clientWidth;
				}
				if( ADDTAG_PANEL.clientWidth + MAIN_CONTENT_PANEL.clientWidth > 749)
				{
					DIV_MAIN.style.width = MAIN_CONTENT_PANEL.clientWidth + ADDTAG_PANEL.clientWidth+29;
					ADDTAG_PANEL.style.width = DIV_MAIN.clientWidth - MAIN_CONTENT_PANEL.clientWidth-29;
					MAIN_CONTENT_PANEL.style.width = DIV_MAIN.clientWidth - ADDTAG_PANEL.clientWidth-29;
				}	
			}
		}
	}
}


function RegisterOverlapProtection(template)
{
	if( ie && window.onload==null)
	{
		if( template=="top" )
			window.onload = overlapppedNoAddtag_topnav;
		else if( template=="left" )
			window.onload = overlapppedNoAddtag_leftnav;
	}
}
/*... methods for div tags */

function setCookie(name, value) {
  var argv = setCookie.arguments;
  var argc = setCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;
  var path = (argc > 3) ? argv[3] : null;
  var domain = (argc > 4) ? argv[4] : null;
  var secure = (argc > 5) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
}

function getCookie(name) 
{
	var c = document.cookie;
    var index = c.indexOf(name + "=");
    if (index == -1) return null;
    index = c.indexOf("=", index) + 1;
    var endstr = c.indexOf(";", index);
    if (endstr == -1) endstr = c.length;
    return unescape(c.substring(index, endstr));
}

function getIPDetectCookie(name, token)
{
	var str_cookei	= getCookie( name );
	var arr_cookie	= null;
	var ret_val		= null;
	if( str_cookei!=null )
	{
		arr_cookie = str_cookei.split("&");
		for( var i=0; i<arr_cookie.length && ret_val == null; i++ )
			if( arr_cookie[i].indexOf(token+"=") == 0 ) 
				ret_val = arr_cookie[i].substring( token.length+1 )
	}
	return (ret_val==null ? "" : ret_val);
}
function GetServiceToken(index,services)
{
	index*=1;
	if( index < 0 )
		index = 0;
	if( index < services.length )
		return services[index];
}
function GetUserProvider(cur_service,cur_speed)
{
	if( (typeof(G_IPCOOKIENAME)+"") == "undefined" ) G_IPCOOKIENAME = "IPDetectDataNew";
	if( (typeof(G_SPEEDS)+"") == "undefined" ) G_SPEEDS = "";
	if( (typeof(G_SERVICES)+"") == "undefined" ) G_SERVICES = "";
	
	if( cur_service	== null )
		cur_service	= getIPDetectCookie(G_IPCOOKIENAME,"ServiceNumber");
	if( cur_speed	== null )
		cur_speed	= getIPDetectCookie(G_IPCOOKIENAME,"Speed");
	var user_service = null;
	if( cur_service*1 < 0 )  
		user_service = GetServiceToken(cur_speed,G_SPEEDS.split("@"));
	else
		user_service = GetServiceToken(cur_service,G_SERVICES.split("@"));
	return (user_service==null ? "" : ' '+user_service);
}

/* Copy of vp.js from video.msn.com*/

var msnV = null;

function msnvDw(pid,guid,mkt,pl) {
	if(mkt=='' || mkt==undefined) {mkt="us";}
	if(!pl) {pl='';}
	var w = window.open("http://video.msn.com/v/"+mkt+"/dw.htm?p="+pid+"&g="+guid+"&m="+mkt+"&pl="+pl,"msnVDW","width=818,height=545,status=1,scrollbars=yes,resizable=yes");
}

function msnvDwd(pid,guid,mkt,pl,t) {
	if(mkt=='' || mkt==undefined) {mkt="us";}
	if(!pl) {pl='';}
	var w = window.open("http://video.msn.com/v/"+mkt+"/v.htm?p="+pid+"&g="+guid+"&p="+pl+"&t="+t,"msnVDWd","width=818,height=545,status=1,scrollbars=yes,resizable=yes");
}

function msnvJs(pid,guid,h,mkt,pl) {
	if(mkt=='' || mkt==undefined) {mkt="us";}
	if(!pl) {pl='';}
	var req = msnvReq();
	if(req!=0) {
		var i = document.createElement("<iframe frameborder=0 scrolling=0 src='http://video.msn.com/v/"+mkt+"/req.aspx?r="+req+"&h="+location.href+"' width=750 height=363>");
		h.appendChild(i);
		return;
	}
	if(!window["msnVinh"]) {
		var holder = document.createElement("<div id=msnVinh class=msnVa>");
		if(h!=null && (typeof(h)=='object' && h.tagName.toLowerCase()=='div') ) {
			h.appendChild(holder);
		}
		else {
			document.body.appendChild(holder);
		}
		var script = document.createElement("<script language=javascript src='http://video.msn.com/v/"+mkt+"/msnvinp.js' onreadystatechange=\"msnvJsR(this,'"+guid+"','"+pl+"','"+pid+"');\">");
		holder.appendChild(script);
	}
	else {
		msnV.Play(guid);
	}
}

function msnvJsR(o,g,p,pid) {
	if(o.readyState=="loaded") {
		msnV = new msnvINP(msnVinh,'msnV',pid);
		msnV.Build();
		msnV.Play(g,p);
	}
}

function msnvReq() {
	var ok=0;
	var ua=navigator.userAgent.toLowerCase();
	if(ua.indexOf("mediacenter") > -1 || ua.indexOf("stb") > -1) {
		var rf = document.referrer;
		var qtype=(location.search&&location.search.indexOf("?")>=0)?"&":"?";
		var sloc=(location.search)?location.search:"";
		pLoc = "http://g.msn.com/0VD0/36/61";
		location.replace(pLoc+sloc+qtype+"rf="+rf);
		return 0;
	}
	if(ua.indexOf("mac")>-1) {ok = 32;}
	else if(navigator.appName=="Netscape") {ok = 8;}
	else {
		ok += (parseFloat(ua.slice(ua.indexOf("msie")+5))>5.9)?0:1;
		var o = new msnvTC("var w=new ActiveXObject('WMPlayer.OCX');return w.versionInfo;","return 0;");
		ok += (parseInt(o.tc())>=7)?0:2;
		o = new msnvTC("var w=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');return 0;","return 4;");
		ok += o.tc();
	}
	return ok;
}

function msnvTC(t,c){
	this.tc=new Function("try{"+t+"}catch(e){"+c+"}");
}

function oMvsLink(gPV,sGuid,bDck,sMenu,sSubM,sURL,sPL,bRP,bStatic,sList){
		bDck=(bDck==1||bDck==true)?0:Math.min((bDck*1)+1,2);
		if (gPV.indexOf("/")<1){gPV+="/64";}
		if((gPV!="40/98")&&(gPV!="50/98")&&(gPV!="51/98")) {
			var mkt="";
			switch (gPV){
				case "39/83":
					mkt="en-au";
					break;
				case "43/119":
					mkt="es-us";
				break;		
			case "37/81":
				mkt="en-ca";
				break;		
			case "38/82":
				mkt="fr-ca";
					break;
			}
			msnvDw(gPV,sGuid+((sPL)?(","+sPL):""),mkt,(sList)?escape(sList):"");
			return;
	}
	var sLink="http://g.msn.com/0VD0/"+gPV+"?t="+bDck;
	if (arguments.length>1){
		sLink+=(sList)?"&p="+escape(sList):"";
		sLink+=((sMenu)?("&m="+sMenu+"&mi="+sSubM):"");
		sPL=sGuid+((sPL)?","+sPL:"");
		sLink+=((!bRP)?"&i=":"&r=")+sPL;
	}
	if (bDck){
		var ovp=window.open(sLink,"ovp","width=788,height=598,status=1");
		if (sURL){location.href=sURL;}
	}
	else{
		location.href=sLink;
	}
}
/* End of of vp.js from video.msn.com */ 

/* PhotoGallery AdTag Flipping JS  - added 11/9/2007 by G.Pechtol */
/* disabled 11/22 when it was discovered that ads.msn checks httpstatus on ad load, to prevent the very thing we are trying to do here */

//if (adTagCount == null || adTagCount == undefined) var adTagCount = -1;
//if (sympatico_pg_adtags == null || sympatico_pg_adtags == undefined) var sympatico_pg_adtags = new Array();

// adds the clientID of the div where an adTag on this page is found    
function addAdTag(adTagID)
{
//    adTagCount++;
//    sympatico_pg_adtags[adTagCount] = {"adtag_id":adTagID};
}

// updates the adTags
function updateAdTags()
{
//    if (adTagCount > -1) 
//    {
//        for (var i=0; i <= adTagCount; i++)
//        {
//            var thisAd= document.getElementById(sympatico_pg_adtags[i].adtag_id);

//            for (var j=0; j<thisAd.childNodes.length; j++)
//            {
//                if (thisAd.childNodes[j].tagName == "SCRIPT")
//                {
//                    var f = thisAd.childNodes[j] ;
//                    document.getElementById(sympatico_pg_adtags[i].adtag_id).removeChild(document.getElementById(sympatico_pg_adtags[i].adtag_id).childNodes[j]);
//                    document.getElementById(sympatico_pg_adtags[i].adtag_id).appendChild(f)
//                    
//                    //document.getElementById(sympatico_pg_adtags[i].adtag_id).childNodes[j].innerHTML = "";
//                    //document.getElementById(sympatico_pg_adtags[i].adtag_id).childNodes[j].innerHTML = inn;
//                }
//                if (thisAd.childNodes[j].tagName == "IFRAME")
//                {
//                    var f = thisAd.childNodes[j] ;
//                    var inn = f.src;
//                    document.getElementById(sympatico_pg_adtags[i].adtag_id).childNodes[j].src = "";
//                    document.getElementById(sympatico_pg_adtags[i].adtag_id).childNodes[j].src = inn;
//                }
//            }
//        }
//    }
}

/* end of PhotoGallery AdTag Flipping JS */

/** MSN Video functions **/

/*copy from msn site */
        function msnvReq() {
       
	    var ok=0;
	    var ua=navigator.userAgent.toLowerCase();
	    if(ua.indexOf("mediacenter") > -1 || ( ua.indexOf("stb") > -1 && ua.indexOf(" istb ")==-1) ) {
		    var rf = document.referrer;
		    var qtype=(location.search&&location.search.indexOf("?")>=0)?"&":"?";
		    var sloc=(location.search)?location.search:"";
		    pLoc = "http://g.msn.com/0VD0/36/61";
		    location.replace(pLoc+sloc+qtype+"rf="+rf);
		    return 16;
	    }
	    if(ua.indexOf("mac")>-1) {ok = 32;}
	    else if(navigator.appName=="Netscape") {ok = 8;}
	    else {
		    ok += (parseFloat(ua.slice(ua.indexOf("msie")+5))>5.9)?0:1;
		    var o = new msnvTC("var w=new ActiveXObject('WMPlayer.OCX');return w.versionInfo;","return 0;");
		    ok += (parseInt(o.tc())>=9)?0:2;
		    o = new msnvTC("var w=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');return 0;","return 4;");
		    ok += o.tc();
	    }
	    return ok;
}

        function msnvTC(t,c){
	        this.tc=new Function("try{"+t+"}catch(e){"+c+"}");
        }
        
        function GenerateNewPlayerEvent( style,lang, guid, CP )
        {                
          if (CP == null || CP == '') 
          {
            var pl = document.getElementById('playeroutline');
            
            pl.style.display = "block";
            pl.style.visibility = "visible";
            
                        
          //  playeroutline.style.display = "block";
       //     playeroutline.style.visibility = "visible";
            
            var newPlayer = document.getElementById('msnPlayer');
            newPlayer.style.paddingTop = '5';
                             
            // If the new player is not added then this id will not be found
            // go to the old player
            if (newPlayer == null) 
            {
                GenerateEvent ( style,lang, guid );                       
            }
            // The new player has been added 
            else 
            {            
                var player = document.getElementById('msnPlayer_pobj');                
                // The mini app for the new player V4, has been added but the player hasnt been
                // initialized, we want to initialize the player with the passed in guid value
                if (player == null) 
                {
                    flashVars.v = guid;  
                    flashVars.lang = lang;
                 
                    Msn.Video.Build("msnPlayer","downlevel text description", flashVars  , vidWidth ,vidHeight );


//gohereafterclose.innerHTML += "<span style='width:100%;'><a href='#gohereafterclose' class='Font_size_B' style='float:right; text-size:' onclick='closeZone(this);'>Close Player [X]</a></span>";        

                    //SWFFormFix("msnPlayer_pobj");
                    window.msnPlayer_pobj = document.forms[0].msnPlayer_pobj;
                }                
                // At this stage the player should be visible on the page
                else
                {                
                   eval( "msnPlayer_pobj.vidPlayId('" + guid + "');" );
                    
                 //   SWFFormFix("msnPlayer_pobj");
               //     window.msnPlayer_pobj = document.forms[0].msnPlayer_pobj;                  
                               
                }
            }
           // CP - content Posting is not null
          } else {
            
            // Go to the Content Posting Page
            window.location.href = CP + "v=" + guid;
            
          }
        }
        
        function GenerateEvent ( style,lang, guid )
        {        
             var req = msnvReq();
             var videoIframe = document.getElementById('videoIframe');
		     if ( req != 0) 
		     {
		        videoIframe.innerHTML = "<iframe frameborder=0 scrolling=no src='http://video.msn.com/v/en-ca/req.aspx?r="+req+"&h="+location.href+"' width=750 height=350>";
		        }     
	        else
	        {
                switch ( style ) 
                {
                   case '0': //over lay
                        LoadVideo_Overlay(lang,guid); 
                        break;
                   case '1': //push over
                        LoadVideo_PushOver(lang,guid);
                        //OpenSlot();
                        break;
                   case '2': //move around
                        LoadVideo_MoveAround(lang,guid);
                        videoIframe.style.display='block';
                        break;
                   case '3': //cover and push
                        LoadVideo(lang,guid);
                        break;
                    case '4': //for daughter window popup ; the same as move around
                        LoadVideo_Daughter(lang,guid);
                        videoIframe.style.display='block';
                        break;
                 }
            }
        }

        function InsertIplayer (lang,guid)
        {
            var iplayer = document.getElementById('iplayer');
            var iframeholder;
            if ( iplayer == null )
            {
                iframeholder = document.createElement ("<iframe id='iplayer' src='http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/IframeinlineVideo.aspx?lang=" + lang + "&guid=" + guid + "' scrolling=no frameborder=0 ALLOWTRANSPARENCY='true' width=100% height='350'></iframe>");
		        videoIframe.appendChild (iframeholder);
            }
            else
            {
                  document.frames['iplayer'].NextCall(lang,guid);
            }
        }
        
		function LoadVideo(lang,guid) {
            var videoIframe = document.getElementById('videoIframe');
			if ( videoIframe != null )	
			{
			    /* common arrtributes begin*/
   		        videoIframe.style.width = '750';
		        videoIframe.style.margin = '0,0,0,10px';
		        videoIframe.style.zIndex = '10';
   		        /* common arrtributes end*/
			    InsertIplayer(lang,guid);
			}
		}
		
		function LoadVideo_PushOver(lang,guid) {
		    var videoIframe = document.getElementById('videoIframe');
			if ( videoIframe != null )
			{
   		        /* common arrtributes begin*/
   		        videoIframe.style.width = '750';
		        videoIframe.style.margin = '0,0,0,10px';
		        videoIframe.style.zIndex = '10';
   		        /* common arrtributes end*/
		        videoIframe.style.position = 'relative';
		        videoIframe.style.overflow = 'hidden';
		        videoIframe.style.display = 'inline';
		        InsertIplayer(lang,guid);
		    }
		}
		
		
		function LoadVideo_Overlay(lang,guid) {
		    var videoIframe = document.getElementById('videoIframe');
			if ( videoIframe != null )
			{
   		        /* common arrtributes begin*/
   		        videoIframe.style.width = '750';
		        videoIframe.style.margin = '0,0,0,10px';
		        videoIframe.style.zIndex = '10';
   		        /* common arrtributes end*/
		        videoIframe.style.position = 'absolute';
		        videoIframe.style.display = 'inline';
		        InsertIplayer(lang,guid);
		    }
		}
		
		function LoadVideo_PushCover(lang,guid) {
		    var videoIframe = document.getElementById('videoIframe');
			if ( videoIframe != null )
			{
   		        /* common arrtributes begin*/
   		        videoIframe.style.width = '750';
		        videoIframe.style.margin = '0,0,0,10px';
		        videoIframe.style.zIndex = '10';
   		        /* common arrtributes end*/

		        videoIframe.style.position = 'absolute';
		        videoIframe.style.overflow = 'hidden';
		        InsertIplayer(lang,guid);
		    }
		}
		
		var i=0;
		function OpenSlot() {
			if ( i >=345 ) i=0;
			videoIframe.style.height = i;
			i+= 5;
			if(i<345) {
				setTimeout("OpenSlot();",10);
			}
			
		}
		
		var j=0;
		function PushCoverSlot() {
			videoIframe.style.height = j;
			var bot = document.getElementById('bot');
			bot.style.position = "relative";
			j+= 5;
			if(j>=15) {
				bot.style.top = bot.style.pixelTop + 5;
			}
			if(j<315) {
				setTimeout("PushCoverSlot();",10);
			}
		}
		
		//functions for move around
		var ox;
		var oy;
		var bh = (location.search != "");
		function DragBar(e) {
			videoHeader.setCapture();
			videoHeader.attachEvent("onmousemove",MoveBar);
			ox = window.event.offsetX;
			oy = window.event.offsetY;
			//if(bh) {msnVwmp.style.display = "none";}
		}

		function DropBar() {
			videoHeader.releaseCapture();
			videoHeader.detachEvent("onmousemove",MoveBar);
			//if(bh) {msnVwmp.style.display = "block";}
		}

		function MoveBar() {
			var e = window.event;
			var x = e.clientX;
			var y = e.clientY;
			setTimeout("PlaceBar("+x+","+y+");",100);
			window.status = x + "," + y + " - " + e.type;
			e.cancelBubble = true;
		}

		function PlaceBar(x,y) {
			videoIframe.style.top = (y-oy);
			videoIframe.style.left = (x-ox);
		}
		
		function LoadVideo_MoveAround (lang,guid) {
		    var videoIframe = document.getElementById('videoIframe');
	        var iplayer = document.getElementById('iplayer');
	        if ( videoIframe != null )
			{
		        /* common arrtributes begin*/
   		        videoIframe.style.width = '750';
		        videoIframe.style.margin = '0,0,0,10px';
		        videoIframe.style.zIndex = '10';
   		        /* common arrtributes end*/

		        if ( iplayer == null )
		        {
		            videoIframe.style.position = 'absolute';
		            videoIframe.style.top = '100';
		            videoIframe.style.left = '10';
		            videoIframe.style.display = 'none';
		            if ( lang == 'fr' )
		            {
		            videoIframe.innerHTML = "<div id='videoHeader' style='width:100%;background:7b9fd1;color:fff;padding:4 0 0 5;font:bold 11px tahoma;' onmousedown='DragBar();' onmouseup='DropBar();'>Cliquez sur la fenêtre et faites-la glisser</div>";
		            }   
		            else
		             {
		      		   videoIframe.innerHTML = "<div id='videoHeader' style='width:100%;background:7b9fd1;color:fff;padding:4 0 0 5;font:bold 11px tahoma;' onmousedown='DragBar();' onmouseup='DropBar();'>Click and hold to drag player window</div>";
		      		 }          
   
		            iframeholder = document.createElement ("<iframe id='iplayer' src='http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/IframeinlineVideo.aspx?lang=" + lang + "&guid=" + guid + "' scrolling=no frameborder=0 ALLOWTRANSPARENCY='true' width=100% height='350'></iframe>");
		            videoIframe.appendChild (iframeholder);
		        }      
		        else
		        {
                  document.frames['iplayer'].NextCall(lang,guid);
		        }
		   }
		}

         function LoadVideo_Daughter(lang,guid) {
         
            var videoIframe = document.getElementById('videoIframe');
			if ( videoIframe != null )
			{
   		        /* common arrtributes begin*/
   		        videoIframe.style.width = '750';
		        videoIframe.style.margin = '0,0,0,10px';
		        videoIframe.style.zIndex = '10';
   		        /* common arrtributes end*/

		        videoIframe.style.position = 'absolute';
		        videoIframe.style.top = '200';
		        videoIframe.style.left = '10';
		        videoIframe.style.display = 'none';
		        InsertIplayer(lang,guid);
		    }
            
		}
		
        
        function CloseMsnV() { 
            var bot = window.parent.document.getElementById('bot') ;
            if ( bot != null ) 
            {
                bot.style.pixelTop = 0;
            } 

            var iplayer ;
             var videoIframeFromParent ;
   	        if ( window.parent.document.getElementById('iplayer') != null ) 
   	        {
   	            iplayer = window.parent.document.getElementById('iplayer');
    	        videoIframeFromParent = iplayer.parentNode;
    	        if ( videoIframeFromParent != null ) 
    	        {
 	                videoIframeFromParent.removeChild(iplayer);
       	            if ( videoIframeFromParent.firstChild != null )
       	            {
       	              videoIframeFromParent.removeChild ( videoIframeFromParent.firstChild );
  	                }
   	                videoIframeFromParent.style.display = 'none';
 	            }
   	        } 
       }
	
	    function getQueryVariable(variable) {
          var query = window.location.search.substring(1);
          var vars = query.split("&");
          for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) {
              return pair[1];
              }
            } 
        }
        
        function OpenDaughterWindow (lang,guid)
        {
            window.location.href = "http://partners.sympatico.msn.ca/Bell.Sympatico.CMS/IframeinlineVideo.aspx?lang=" + lang + "&guid=" + guid;
        }
        
        function Querystring(qs) { // optionally pass a querystring to parse
	        this.params = new Object()
	        this.get=Querystring_get
	
        	if (qs == null)
		        qs=location.search.substring(1,location.search.length)

        	if (qs.length == 0) return

	        qs = qs.replace(/\+/g, ' ')
	        var args = qs.split('&') // parse out name/value pairs separated via &
	
            // split out each name=value pair
	        for (var i=0;i<args.length;i++) {
	            var value;
	        	var pair = args[i].split('=')
	        	var name = unescape(pair[0])

	        	if (pair.length == 2)
	        		value = unescape(pair[1])
        		else
			value = name
    		
		    this.params[name] = value
	        }
        }

      function Querystring_get(key, default_) {	
	        if (default_ == null) default_ = null;
    	
	        var value=this.params[key]
	      if (value==null) value=default_;
    	
	       return value
      }


    function startQueryStringVid(guid) {
   
        if(guid != null) {                       
        
            // The new player has been added 
                      
            var pl = document.getElementById('playeroutline');
            
            pl.style.display = "block";
            pl.style.visibility = "visible";
                      
                var player = document.getElementById('msnPlayer_pobj');                
                // The mini app for the new player V4, has been added but the player hasnt been
                // initialized, we want to initialize the player with the passed in guid value
                if (player == null) 
                {
                    flashVars.v = guid;                      
                
                    Msn.Video.Build("msnPlayer","downlevel text description", flashVars  , vidWidth ,vidHeight );
                    window.msnPlayer_pobj = document.forms[0].msnPlayer_pobj;

                }                
                // At this stage the player should be visible on the page
                else
                {
                    window.msnPlayer_pobj = document.forms[0].msnPlayer_pobj;
                    eval( "msnPlayer_pobj.vidPlayId('" + guid + "');" );
                    
                 //   SWFFormFix("msnPlayer_pobj");
               //     window.msnPlayer_pobj = document.forms[0].msnPlayer_pobj;                  
                               
                }
        }

    }
/**--- MSN Video functions **/

function getXPos(el) 
{
    if (el)
    {
        if (el.x)
            return el.x;
        else if (el.offsetParent)
        {
            return el.offsetLeft + getXPos(el.offsetParent);
        }
    }
	
    return 0;
}

function getYPos(el) 
{
    if (el)
    {
        if (el.y)
            return el.y;
        else if (el.offsetParent)
        {
            return el.offsetTop + getYPos(el.offsetParent);
        }
    }
	
    return 0;
}

/**----- Article Text Font Size change -----**/
function initializeArticleBodyFontSize()
{   
    var thisCookie = readArticleFontSizeCookie("SympaticoArticleBody");    
    if(thisCookie == null)
    {        
        createArticleFontSizeCookie("SympaticoArticleBody", "articleBody_L2");
        setArticleBodyFontSize("articleBody_L2");
        setFrontSizeBoxBorderColor("articleBody_L2");
    }
    else
    {               
        setArticleBodyFontSize(thisCookie);
        setFrontSizeBoxBorderColor(thisCookie);
    }    
}

//set the cookie and border color when user click
function ArticleBodyFontSize_OnClick(classname)
{        
    createArticleFontSizeCookie("SympaticoArticleBody", classname);
    setArticleBodyFontSize(classname);      
    setFrontSizeBoxBorderColor(classname); 
}

//change the border color of the selected front size box
function setFrontSizeBoxBorderColor(classname)
{
    var myDiv;
    var artBody;
    for(i = 1; i < 4; i++)
    {                
        artBody = "articleBody_L" + i;           
        if(classname == artBody)
        { 
            myDiv = document.getElementById(artBody); 
            myDiv.className = "articleSelectBox Font_color_B  Border_color_C";
        }
        else
        {
            myDiv = document.getElementById(artBody); 
            myDiv.className = "articleSelectBox Font_color_A  Border_color_B";
        }          
    }   
}

//set the article body font size
function setArticleBodyFontSize(articleFontSizeClassName)
{
    //var myDiv = document.getElementById("articleBodyContent");    
    //if(myDiv != null || myDiv != undefined)
    //{
    //    myDiv.className = articleFontSizeClassName;
    //}
    var myDivs = document.getElementsByTagName('div'); 
    if ( myDivs != null || myDivs != undefined)
    {
        for ( var i = 0; i < myDivs.length; i++)
        {
            if ( myDivs[i].id != null && myDivs[i].id == "articleBodyContent")
            {
                myDivs[i].className = articleFontSizeClassName;
            }
        }  
    }
}

function eraseCookie(name) {
    //alert("erase");
	createCookie(name,"",-1);
}

function createArticleFontSizeCookie(name,value,days) 
{
    if (days == undefined || days == null) days = '30';
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	document.cookie = name+"="+value+expires+"; path=/";
}

function readArticleFontSizeCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) 
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


/**----- END Article Text Font Size change -----**/


/* The following contains the functions for the CurrentDate mini-app */

// Makes the minute show as two digits and returns it.
function getTwoDigitMinute()
{
    var currentMinute = currentDate.getMinutes();
        
    if (currentMinute < 10)
    {
        return '0' + currentMinute.toString();
    }
    return currentMinute.toString();
}
    
// Converts 24-hour to 12-hour and returns it.
function getTwelveHour()
{
    var currentHour = currentDate.getHours();
    var currentHourString = '';
    
    if (currentHour >= 1 && currentHour <= 12)
    {
        currentHourString = currentHour + '';
    }
    else if (currentHour >= 13 && currentHour <= 24)
    {
        currentHourString = (currentHour - 12) + '';
    }
    else if (currentHour == 0)
    {
        currentHourString  = 12;
    }
    
    return currentHourString;
}

// Returns AM or PM.
function getAMOrPM()
{
    var currentHour = currentDate.getHours();
    
    if (currentHour >= 12 && currentHour <= 23)
    {
        return 'PM';
    }
    return 'AM';
}

/* The above contains the functions for the CurrentDate mini-app */