

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}


function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  return [myWidth, myHeight];

}


nsdom = (document.layers) ? true:false;
iedom = (document.all) ? true:false;

function getWindowWidth() 
{
    winW = (nsdom) ? window.outerWidth : screen.width;
    return winW;		
}

function getWindowHeight() 
{
    winH = (nsdom) ? window.outerHeight : screen.Availheight;
    return winH;		
}


function popIt(theFile,windowW,windowH,wName,scrolling){

    bWidth = getWindowWidth();
    bHeight = getWindowHeight();

    bTop = (nsdom) ? this.window.screenY : 0;
    bLeft = (nsdom) ? this.window.screenX : 0;

    popLeft = ((bWidth - windowW)/2) + bLeft;
    popTop = ((bHeight - windowH)/2) + bTop;

    if (wName == null)
    {
        wName = 'pop';
    }
    if (scrolling == null){
    scrolling = "auto";
    }
    var popWindow = window.open(theFile,wName,'width='+windowW+',height='+windowH+',top='+popTop+',left='+popLeft+',scrollbars='+scrolling+',statusbar=no,toolbar=no,resizable=yes');
    popWindow.focus();
}

function loadParent(theUrl){

	if (top.opener != null){
		top.opener.location.href = theUrl;
		opener.focus();
	}else{
		
		popWin(theUrl);
	}
	


}



function winSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  return [myWidth, myHeight];

}


function hilite(divObj,turnon){

	if (turnon){
	divObj.className = 'subnavitemactive';
	}else{
	divObj.className = 'subnavitem';
	}


}






