String.prototype.trimm=function(){a=this.replace(/^\s+/,'');return a.replace(/\s+$/,'');};function hideBleedingElements(doc){jQuery("embed").css({display:"none"});jQuery("object").css({display:"none"});jQuery("select:not(.overlay *)").css({visibility:"hidden"});};function showBleedingElements(doc){jQuery("embed").css({display:"block"});jQuery("object").css({display:"block"});jQuery("select:not(.overlay *)").css({visibility:"visible"});};function filterToggle(togglee,toggler){var myToggle="#"+togglee;if(jQuery(myToggle).is(":visible")){jQuery(myToggle).slideUp("fast",function(){jQuery(toggler).removeClass("opened");jQuery(toggler).addClass("closed");});}else{jQuery(myToggle).slideDown("fast",function(){jQuery(toggler).removeClass("closed");jQuery(toggler).addClass("opened");});}
jQuery(".skyscraper .ad").hide().show();};function openNewWindow(location){var newWindow=window.open(location,'_blank');if(newWindow){if(newWindow.focus){newWindow.focus();}
return false;}
return true;};function getPopupWinHandle(loc,width,height,resizable,scrollbars,toolbar,dependent,winName,locationBar,statusBar,align){var alignValue="top=1,left=1"
if(align=='center'){LeftPosition=(screen.width)?(screen.width-width)/2:0;TopPosition=(screen.height)?(screen.height-height)/2:0;alignValue="top="+TopPosition+",left="+LeftPosition;}else if(align=='topright'){LeftPosition=(screen.width)?(screen.width-width):0;TopPosition=1;alignValue="top="+TopPosition+",left="+LeftPosition;}else if(align=='topcenter'){LeftPosition=(screen.width)?(screen.width-width)/2:0;TopPosition=1;alignValue="top="+TopPosition+",left="+LeftPosition;}else if(align=='topleft'){alignValue="top=1,left=1";}
var win=eval("window.open(loc, '"
+winName
+"','width="+width
+",height="+height
+",resizable="+resizable
+",scrollbars="+scrollbars
+",toolbar="+toolbar
+",dependent="+dependent
+",screenX=1,screenY=1,"+alignValue
+",location="+locationBar
+",status="+statusBar+"')");win.focus();return win;};function popupWin(loc,width,height,resizable,scrollbars,toolbar,dependent,winName,locationBar,statusBar,align){var newWin=getPopupWinHandle(loc,width,height,resizable,scrollbars,toolbar,dependent,winName,locationBar,statusBar,align);};function getObject(obj){var theObj;if(document.all){if(typeof obj=="string"){return document.all(obj);}else{return obj.style;}}
if(document.getElementById){if(typeof obj=="string"){return document.getElementById(obj);}else{return obj.style;}}
return null;};function toCount(entrance,exit,text,characters){var entranceObj=getObject(entrance);var exitObj=getObject(exit);var length=characters-entranceObj.value.length;if(length<=0){length=0;text='<span class="disable"> '+text+' </span>';entranceObj.value=entranceObj.value.substr(0,characters-1);}
exitObj.innerHTML=text.replace("{CHAR}",length);};function pauseMilli(millis){var date=new Date();var curDate=null;do{curDate=new Date();}
while(curDate-date<millis);};function validatePassword(pword){var errMsg="";if(pword.length>49){errMsg="The password entered is too long - must be less than 50 characters.";}
if(pword.indexOf(" ")>=0){errMsg="The password field must not contain spaces.";}
if(pword.length==0){errMsg="The password field must not be empty.";}
return errMsg;};function validateEmailAddress(strorig){var str=strorig.trimm();var at="@";var dot=".";var lat=str.indexOf(at);var lstr=str.length;var ldot=str.indexOf(dot);var errMsg="";var error="The email address entered is not valid.";if(lstr==0){errMsg="The email address field must not be empty.";}
if(lstr>99){errMsg="The email address field must be less than 100 characters.";}
if(str.indexOf(at)==-1){errMsg=error;}
if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){errMsg=error;}
if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){errMsg=error;}
if(str.indexOf(at,(lat+1))!=-1){errMsg=error;}
if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){errMsg=error;}
if(str.indexOf(dot,(lat+2))==-1){errMsg=error;}
if(str.indexOf(" ")!=-1){errMsg=error;}
return errMsg;}
function createPlayer(videoId,divId,autostartVal,height,width,hostURL){var flashvars={};flashvars.file=hostURL+"/videos/modules/playlist?id="+videoId+"&xml";flashvars.width=width;flashvars.height=height;flashvars.fullscreen="true";flashvars.controlbar="bottom";flashvars.autostart=autostartVal;flashvars.playlist="none";flashvars.repeat="list";flashvars.displayclick="play";flashvars.stretching="uniform";flashvars.targetdiv=divId;var params={wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"};var attributes={};attributes.align="top";attributes.name=divId;var swfFile="http://s3.amazonaws.com/sportsvite_video_bucket/jw_player43.swf";swfobject.embedSWF(swfFile,divId,width,height,"9.0.115",hostURL+"/swf/expressInstall.swf",flashvars,params,attributes);};function createCustomPlayer(videoUrl,imageUrl,divId,autostartVal,height,width,hostURL){var flashvars={};flashvars.file=videoUrl+"&image="+imageUrl;flashvars.width=width;flashvars.height=height;flashvars.fullscreen="true";flashvars.controlbar="bottom";flashvars.autostart=autostartVal;flashvars.playlist="none";flashvars.repeat="list";flashvars.displayclick="play";flashvars.stretching="uniform";flashvars.targetdiv=divId;var params={wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"};var attributes={};attributes.align="top";attributes.name=divId;var swfFile="http://s3.amazonaws.com/sportsvite_video_bucket/jw_player43.swf";swfobject.embedSWF(swfFile,divId,width,height,"9.0.115",hostURL+"/swf/expressInstall.swf",flashvars,params,attributes);};var jwPlayer;var jwPlayList;var jwFinalItemIndex;var jwPlayListEnded=false;var jwPAAdTrack='<IMG SRC="http://ad.doubleclick.net/ad/N4390.cstv.comOX2328/B3380623.9;sz=1x1;ord=[timestamp]?" BORDER=0 WIDTH=1 HEIGHT=1/>';function replay(){jwPlayListEnded=false;jwPlayer.sendEvent("LOAD",jwPlayer.getConfig().file+"&xml");jwPlayer.sendEvent("ITEM",0);var autoStart=jwPlayer.getConfig().autostart;if(autoStart==false){jwPlayer.sendEvent("PLAY");}};function checkForReplay(){if(jwPlayListEnded==true){replay();}};function handleStateChange(obj){var stateValObj=obj.newstate;var playListIdx=jwPlayer.getConfig().item;if((playListIdx==jwFinalItemIndex)&&(stateValObj=='COMPLETED')){if(jwFinalItemIndex>0){jwPlayListEnded=true;var div=jwPlayer.getConfig().targetdiv;jQuery("#"+div).parent().append(jwPAAdTrack);}}}
function playerReady2(obj){jwPlayer=document.getElementById(obj['id']);setTimeout("playerReadyContinued()",999);};function playerReady(obj){jwPlayer=document.getElementById(obj['id']);setTimeout("playerReadyContinued()",100);};function errorMonitor(){alert("error: "+obj.message);};function playerReadyContinued(){if(jwPlayer.getPlaylist()){jwPlayList=jwPlayer.getPlaylist();jwFinalItemIndex=jwPlayList.length-1;jwPlayer.addModelListener("STATE","handleStateChange");jwPlayer.addViewListener("PLAY","checkForReplay");}
else{setTimeout("playerReadyContinued()",100);}};function playerReadyContinued2(){jwPlayList=jwPlayer.getPlaylist();jwFinalItemIndex=jwPlayList.length-1;jwPlayer.addModelListener("STATE","handleStateChange");jwPlayer.addViewListener("PLAY","checkForReplay");};function regionAlert(i){jQuery(i).addClass("regionAlert");if(!jQuery.browser.msie){jQuery("#region-display-alert").find("p").animate({opacity:1},690).animate({opacity:.25},210).animate({opacity:1},210).animate({opacity:.25},210).animate({opacity:1},210).animate({opacity:.25},210).animate({opacity:1},210);}};function smoothScroll(t){var targetOffset=jQuery(t).offset().top;jQuery('html,body').animate({scrollTop:targetOffset},420);return false;};function toggleSideMenuSubItems(subItem){if(jQuery(subItem).hasClass("sub-arrow-up")){jQuery(subItem).removeClass("sub-arrow-up");jQuery(subItem).addClass("sub-arrow-down");}else{jQuery(subItem).removeClass("sub-arrow-down");jQuery(subItem).addClass("sub-arrow-up");}
jQuery(subItem).parent().find("ul.sub").slideToggle("fast");};function updateFeaturedStatus(actionVal,etidVal,eidVal,featureVal,divId){var postTarget="/intranet/updateLastFeatured";jQuery.post(postTarget,{action:actionVal,etid:etidVal,eid:eidVal},function(data){handleFeaturedStatusResponse(eidVal,featureVal,divId);});jQuery("#featured_ajax_loader").show();};function handleFeaturedStatusResponse(eidVal,featureVal,divId){var spanTxt=document.getElementById(eidVal);var featureDiv=document.getElementById(divId+'_featureContent');var unfeatureDiv=document.getElementById(divId+'_unfeatureContent');if(featureVal=='true'){var time=new Date();var lmonth=time.getMonth()+1;var date=time.getDate();var year=computeYear(time);var minutes=time.getMinutes();var hours=time.getHours();if(minutes<10){minutes='0'+minutes;}
spanTxt.innerHTML="<font color='green'>"+lmonth+"/"+date+"/"+year+" "+hours+":"+minutes+"</font>";featureDiv.style.display="none";unfeatureDiv.style.display="block";}else{spanTxt.innerHTML="No longer featured";featureDiv.style.display="block";unfeatureDiv.style.display="none";}};function computeYear(theDate){x=theDate.getYear();var y=x%100;y+=(y<38)?2000:1900;return y;};String.prototype.trimStr=function(){a=this.replace(/^\s+/,'');return a.replace(/\s+$/,'');};function enableCalSelectDateField(calIconId,monthId,dayId,yearId,beginYear,endYear){jQuery('#'+calIconId).datePicker({createButton:false,startDate:'01/01/'+beginYear,endDate:'31/12/'+endYear}).bind('click',function()
{jQuery(this).dpDisplay();return false;}).bind('dateSelected',function(e,selectedDate,$td,state)
{updateSelects(selectedDate);}).bind('dpClosed',function(e,selected)
{updateSelects(selected[0]);});var updateSelects=function(selectedDate){selectedDate=new Date(selectedDate);var d=selectedDate.getDate();var m=selectedDate.getMonth();var y=selectedDate.getFullYear();jQuery('#'+dayId).val(d);jQuery('#'+monthId).val(m+1);jQuery('#'+yearId).val(y);}
jQuery('#'+dayId+', #'+monthId+', #'+yearId).bind('change',function(){var d=new Date(jQuery('#'+yearId).val(),jQuery('#'+monthId).val(),jQuery('#'+dayId).val());jQuery('#'+calIconId).dpSetSelected(d.asString());});};function initToolTip(){jQuery(".cTip").hover(function(){jQuery(this).find("span").css("display","block");},function(){jQuery(this).find("span").css("display","none");});};var JsMap=function(){var _internalMap={};this._put=function(key,value){_internalMap[key]=value;};this._get=function(key){return _internalMap[key];};this._remove=function(key){if(_internalMap[key]!=null){delete(_internalMap[key]);}};this.size=function(){count=0;for(var i in _internalMap){count++;}
return count;};};JsMap.prototype.put=function(key,value){this._put(key,value);};JsMap.prototype.get=function(key){return this._get(key);};JsMap.prototype.remove=function(key){this._remove(key);};function IECheck(){if(jQuery.browser.msie&&jQuery.browser.version==6){if(jQuery.cookie('svie6notice')!='closed'){call_tb_init();tb_show(null,"/help/overlays/ie6Message.jsp?height=300&width=500&modal=true",false);}}};function closeie6notice(){jQuery('#ie6-notice').hide();jQuery.cookie('svie6notice','closed',{expires:30,path:'/'});}
jQuery(document).ready(function(){jQuery("#new-nav>li").hover(function(){jQuery(this).find(".drop").show();jQuery(this).find("a").addClass("drop-on");jQuery(".leaderboard .ad object").hide();jQuery("select").addClass("ieHide");},function(){jQuery(this).find(".drop").hide();jQuery(this).find("a").removeClass("drop-on");jQuery(".leaderboard .ad object").show();jQuery("select").removeClass("ieHide");});});
