
function tryCatch(sTry,sCatch){
	this.trycatch=new Function("try{"+sTry+"}catch(e){"+sCatch+"}");
	this.trycatchV=new Function("s1","try{"+sTry+"}catch(e){"+sCatch+"}");
} 

function UberSniff(sUndefined) {
	var ua=navigator.userAgent.toLowerCase();
	this.webtv = (ua.indexOf("webtv")>-1);
	this.ie = (parseFloat(ua.slice(ua.indexOf("msie")+5)));
	this.nn = (this.ie)?(-1):(parseFloat(ua.slice(ua.indexOf("mozilla/")+8)));
	this.mac = (ua.indexOf("mac")>-1);
//flash version
	if (navigator.MGFlashVer==sUndefined){
		if (this.nn<=0&&this.ie<5) {
			navigator.MGFlashVer=6;
		}
		 else {
			if (!this.mac&&this.ie>4) {
				var oTestVersion=new tryCatch("oWMPlayer=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.'+s1);return s1;","return 0;");
				navigator.MGFlashVer=-1;
				for (var nCheckVersion=7;nCheckVersion>2;--nCheckVersion){
					if (oTestVersion.trycatchV(nCheckVersion)){navigator.MGFlashVer=nCheckVersion; break;}
				}				
			} 
			else{ 	
				if(navigator.plugins['Shockwave Flash']){
					navigator.MGFlashVer=(parseInt(navigator.plugins['Shockwave Flash'].description.substr(16)));
				}
				else {
					navigator.MGFlashVer=-1;
				}
			}
		}
	}
	this.flash=navigator.MGFlashVer;

	if (navigator.MGMPlayer==sUndefined){
		if ((this.nn<=0&&this.ie<5)||this.mac) {
			navigator.MGMPlayer=true;
		}
	 	else {
			if (!this.mac&&this.ie>4) {
				var oTestVersion=new tryCatch("oWMPlayer=new ActiveXObject('WMPlayer.OCX');return oWMPlayer.versionInfo;","return 0;");
				if (oTestVersion.trycatch()){navigator.MGMPlayer=oTestVersion.trycatch();
	} else {
					for (itest=0;itest<9;++itest){
						oTestVersion=new tryCatch("oWMPlayer=new ActiveXObject('MediaPlayer.MediaPlayer.'+itest);return 1;","return 0;");
				navigator.MGMPlayer=(oTestVersion.trycatch());
						if (navigator.MGMPlayer) {itest=100;}
				}			
				}
			} 
			else{		navigator.MGMPlayer=!!(navigator.mimeTypes&&navigator.mimeTypes["video/x-ms-wm"]&&navigator.mimeTypes["video/x-ms-wm"].enabledPlugin);
			}
		}
	}
	this.mplayer=navigator.MGMPlayer;
// screen resolution
	this.screenHeight = screen.height;
	this.screenWidth = screen.width;
	this.colorDepth = (this.nn>=4)?screen.pixelDepth:screen.colorDepth;
}



function MakeBkMark(strURL,strTitle) {
	if (document.all) {
		window.external.AddFavorite(strURL,strTitle);
						}
	else { alert("Sorry. This quick bookmark only works in \rInternet Explorer versions 4.0 and later."); }
					}

var bBeenHere = false;

function MGSideBar(bNFirst) {
	var oS=new UberSniff();
	if (oS.ie||oS.nn>=5){
		var oSBar=(oS.nn)?document.getElementById("MGRCol"):MGRCol;
		if((typeof(oSBar)=='object') && (oSBar!=null)) {	
		oSBar.style.display=(((oS.ie)?document.body.clientWidth:self.innerWidth)>950)?"block":"none";
			if (!bNFirst){
				if (oS.ie>=5&&!oS.mac){
					window.attachEvent("onresize",MGSideBar);
			}
				else{
					window.onresize=MGSideBar;
				}
			}
			if (!bBeenHere && (oSBar.style.display == "block") && getMainSectionId() == "fpg"){
				oSBar.innerHTML = "<div style=line-height:5px;>&nbsp;</div><span style='font:9px Verdana;letter-spacing:1px;color:666666;'>Sponsored Selections</span><br><iframe id=siteCal src=/m/sitecal.asp width=160 frameborder=0 height=800 marginwidth=0 marginheight=0 scrolling=no></iframe>";
				bBeenHere = true;
			}
		}
  }
}