/* Rev: $Revision: 105885 $ */
var is_aol = navigator.userAgent.toLowerCase().indexOf("aol") != -1;
var is_mac = navigator.userAgent.indexOf('Mac') != -1;
var is_IE = navigator.userAgent.indexOf('MSIE') != -1;

/* Header code */
function p_o(o){return document.getElementById(o);}

function ai_posX(obj){
 var left=0;
 if(obj.offsetParent){
  while(obj.offsetParent){
   left+=obj.offsetLeft;
   obj=obj.offsetParent;
  }
 }else if(obj.x)left+=obj.x;
 return left;
}

function togMore(e,state,oDivName){
 if ((oDivName == undefined) || (oDivName.length <= 0)) {
    oDivName = 'smore';
 }
 var oDiv=p_o(oDivName);
 if(state=='show'){
  posMore(e,oDivName);
  oDiv.style.zIndex=99999999;
  oDiv.style.display='block';
 } else {
  oDiv.style.display='none';
 }
 return false;
}

function posMore(e,oDivName){
    if ((oDivName == undefined) || (oDivName.length <= 0)) {
        oDivName = 'smore';
    }
    var oDiv=p_o(oDivName);
        var oLnk=p_o(oDivName+'a');

        posY = findMousePos(e);
        oDiv.style.left=(ai_posX(oLnk)+15)+'px';
        oDiv.style.top=(posY+oLnk.offsetHeight/2)+'px';
}

/* Utility trim string */
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

/* Prevent IE flickr */
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

/* Figure out where mouse is upon a click */
function findMousePos(e) {
	var posY = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posY = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
	return posY;
}

/* Open a popup sized window and set focus */
function popup_window(url,width,height){
	var features="status=0,menubar=0,location=0,toolbar=0";
	if (!isNaN(parseInt(width))){features+=",width="+width;}
	if (!isNaN(parseInt(height))){features+=",height="+height;}
	if (typeof(window.screenLeft)!="undefined"){
		features+=",left="+window.screenLeft;
		features+=",left="+Math.round(window.screenLeft+((document.body.clientWidth/2)-(width/2)));
	} else if (typeof(window.screenX)!="undefined"){
		features+=",left="+Math.round(window.screenX+((window.outerWidth/2)-(width/2)));
	}
	if (typeof(window.screenTop)!="undefined"){
		features+=",top="+window.screenTop;
		features+=",top="+Math.round(window.screenTop+150);
	} else if (typeof(window.screenY)!="undefined"){
		features+=",top="+Math.round(window.screenY+((window.outerHeight-window.innerHeight)+150));
	}
	var popupWin=window.open(url,"popupWin",features);
	if (popupWin.focus){popupWin.focus();}
}

/*   */
var is_flash = false; var flashVer = 7;
if (window.ActiveXObject && !is_mac) {document.write('<scr' + 'ipt language="VBScript">' + '\n' + 'On Error Resume Next' + '\n' + 'is_Flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & flashVer)))' + '\n' + '<\/sc' + 'ript>'); } 
else {var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0; var pluginStr = plugin.description; if (plugin){ if (parseInt(pluginStr.substring(pluginStr.indexOf(".")-1)) >= flashVer) { is_flash = true; }}}

navigator.userAgent.toLowerCase().indexOf('msie')!=-1?bb_ie=1:bb_ie=0;

/* Start: SHARE THIS WIDGET JS */

var sharePopFlag = true;                             /* variable for onclick popup */
  
function showShareThisPop(topDivId, botDivId)        /* function to call the popup onclick */
{
    if (sharePopFlag)
    {
        document.getElementById('shareLeftIDBB').style.borderBottom = "1px solid #000";
        document.getElementById(botDivId).style.display = "block";
        document.getElementById(topDivId).className = "share_right_on";
    }
    else 
    {
        document.getElementById('shareLeftIDBB').style.borderBottom = "none";
        document.getElementById(botDivId).style.display = "none";
        document.getElementById(topDivId).className = "share_right";
    }
    sharePopFlag = !sharePopFlag;
}

function shareOperation(iOperation, strUrl, strTitle)
{
    var staf_obj = new staf_SE();
    staf_obj.setLang("en-US");
    if (strUrl != "")
    {
        staf_obj.setURL(strUrl);
    }
    if (strTitle != "")
    {
        staf_obj.setTitle(strTitle);        
    }
    if (iOperation == 1) /* IM This */
    {
        staf_obj.sendIM();
    }
    else
    {
        staf_obj.sendEmail();
    }
}
/*  End: SHARE THIS WIDGET JS */

