var usat=new clsUsat();
usat.init();
function clsUsat(){
this.util=new clsUtil();
this.page=new clsPage();
this.init=fxInit;
function fxInit(){
this.util.init();
this.page.init();}
function clsUtil(){
this.init=fxInit;
this.openBareWindow=fxOpenBareWindow;
this.isEmpty=fxIsEmpty;
function fxInit(){
String.prototype.trim=fxTrim;}
function fxTrim(strInput){
var strResult=null;
if(strInput==null)
strInput=this;
if(strInput){
strResult=new String(strInput);
strResult=strResult.replace(/^\s+/,"");
strResult=strResult.replace(/\s+$/,"");}
return(strResult);}
function fxOpenBareWindow(url,title,width,height){
window.open(url,title,"scrollbars=no,menubar=no,toolbar=no,status=no,top=0,left=0,screenx=0,screeny=0,width="+width+",height="+height+",resizable=no");}
function fxIsEmpty(x){
blnIsEmpty=false;
if((x==null)||(new String(x)=="undefined")||(x=="")){
blnIsEmpty=true;}
return(blnIsEmpty);}}
function clsPage(){
this.onLoadList=new Array();
this.jumpSelect=fxJumpSelect;
this.onLoad=fxOnLoad;
this.addLoadEvent=fxAddLoadEvent;
function fxInit(){
fxOnResize(true);}
function fxOnResize(init){
if(init==true)with(navigator){
if((appName=="Netscape")&&(parseInt(appVersion)==4)){
document.MM_pgW=innerWidth;
document.MM_pgH=innerHeight;
onresize=fxOnResize;}}
else if(innerWidth!=document.MM_pgW||innerHeight!=document.MM_pgH){
location.reload();}}
function fxJumpSelect(objSelect){
var strLocation=objSelect.options[objSelect.selectedIndex].value;
if(strLocation){
document.location=strLocation;}
objSelect.selectedIndex=0;}
function fxOnLoad(){
var fx;
for(var i=0;i<this.onLoadList.length;i++){
fx=this.onLoadList[i];
try{
fx();}catch(e){}}}
function fxAddLoadEvent(objFunction){
this.onLoadList[this.onLoadList.length]=objFunction;}
function fxInsertTags(element,id,mode){
if(mode==0){url+='GetStoryTags.ashx'}else if(mode==1){url+='GetLinkedByline.ashx'}
url+='?id='+id;
}
}}
var strUserAgent = new String(navigator.userAgent);
var arrUA = strUserAgent.split("MSIE ");
var browserValue = parseFloat(arrUA[1]);

var cssProperty = "<style type='text/css'>";
if (navigator.userAgent.indexOf('MSIE') != -1 && browserValue >= 7){
cssProperty += "#section-nav li.sfhover ul {display:block;left: auto;}";
}
else {
	cssProperty += "#section-nav li:hover ul, #section-nav li.sfhover ul {display:block;left: auto;}";
}
cssProperty += "</style>";		
document.write(cssProperty);

/* DEAL WITH FLASHING BACKGROUND IMAGES IN IE6 */

fixFlashingBackground= function() {
    try {
        if(document.execCommand && navigator.userAgent.indexOf('MSIE') > 0) { 
            document.execCommand("BackgroundImageCache", false, true);
        }
    } catch(err) {}
}

usat.page.addLoadEvent(fixFlashingBackground);

sfHover = function() {
	try {
		var sfEls = document.getElementById("section-nav").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	catch(err) {}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

navhideflash = function(showhide) {
	if (navigator.userAgent.indexOf('Safari') != -1){	
		if (showhide == "hide") {		
			if (document.getElementById('njMainLeft').innerHTML.toUpperCase().indexOf('OBJECT')!= -1) {	
				document.getElementById('njMainLeft').style.visibility='hidden';
			}
			if (document.getElementById('njLeftMiddle1').innerHTML.toUpperCase().indexOf('OBJECT')!= -1) {	
				document.getElementById('njLeftMiddle1').style.visibility='hidden';		
			}
		}
		if (showhide == "show") {
			if (document.getElementById('njMainLeft').style.visibility='hidden') {
				document.getElementById('njMainLeft').style.visibility='visible';
			}
			if (document.getElementById('njLeftMiddle1').style.visibility='hidden') {
				document.getElementById('njLeftMiddle1').style.visibility='visible';
			}
		}
	}
}//fx



