function Pulse()
{
    if(Pulse.theInstance!=null)return Pulse.theInstance;
    var $a=null;
    var $b=false;
    var $c=false;
    var d=document;
    var $d=[];
    this.$o=function()
    {
        $c=true;
        if($b)
        {
            $a.load();
            for(var i=0;i<$d.length;i++)
            {
                $a.addItem($d[i][0],$d[i][1]);
            }
        }
    };
    this.$p=function($e)
    {
        $a=$e;
        $b=true;
        if($c)
        {
            $a.load();
            for(var i=0;i<$d.length;i++)
            {
                $a.addItem($d[i][0],$d[i][1]);
            }
        }
    };
    this.$q=function(id,$f)
    {
        if($b)
        {
            $a.dispatch(id,$f);
        }
    };
    this.$r=function($g,$h)
    {
        if($c)
        {
            $a.addItem($g,$h);
        }
        else
        {
            $d.push([$g,$h]);
        }
    };
    this.isCompatible=function()
    {
        return(d.getElementById&&d.getElementsByTagName&&Function.prototype.apply&&window.encodeURIComponent&&d.createElement&&d.write);
    };
    this.initialize=function()
    {
        if(!this.isCompatible()||!d.body)
        {
            return;
        };
        var $i=window.onload;
        if(typeof $i!='function')
        {
            window.onload=Pulse.$o;
        }
        else
        {
            window.onload=function()
            {
                try
                {
                    $i();
                }
                catch(e)
                {
                };
                Pulse.$o();
            }
        };
        try
        {
            if(PulseOptions)
            {
                for(var i=0;i<Pulse.$s.length;i++)
                {
                    var $j=Pulse.$s[i];
                    eval("try { if(PulseOptions."+$j+" || PulseOptions."+$j+" === false)"+"Pulse."+$j+" = PulseOptions."+$j+"; } catch(e) { }");
                }
            }
        }
        catch(e)
        {
        };
        $k=true;
        document.write('<'+'script src="/services/us/cio/files/pulse.js"'+' type="text/javascript"><'+'/script>');
    }
};


Pulse.theInstance=null;
Pulse.$s=new Array("POLLS","IS_AUTHORIZED");
Pulse.POLLS=[];
Pulse.IS_AUTHORIZED=false;
Pulse.MAX_QUERY_TIME=6000;
Pulse.BASE_URL="//www-128.ibm.com/developerworks/polls";
Pulse.BASE_URL_SSL="http://www-128.ibm.com/developerworks/polls";
Pulse.SERVICE=Pulse.BASE_URL_SSL+"/PulseService";
Pulse.getInstance=function()
{
    return Pulse.theInstance;
};
Pulse.$o=function()
{
    Pulse.getInstance().$o();
};
Pulse.dispatch=function(id,$f)
{
    Pulse.getInstance().$q(id,$f);
};
Pulse.finishLoad=function($e)
{
    Pulse.getInstance().$p($e);
};
Pulse.openWindow=function($l,$m)
{
    var $n=($m)?Pulse.BASE_URL+$l:$l;
    window.open($n,'_blank','fullscreen=no,'+'toolbar=no, height=700, width=1000, titlebar=no, scrollbars=yes');
};
Pulse.addItem=function($g,$h)
{
    Pulse.getInstance().$r($g,$h);
};
Pulse.theInstance=new Pulse();
Pulse.theInstance.initialize();

	
	//open the poll popup
	function openPoll(){
		document.getElementById("ibm-poll").style.display = "block";
		var   midDiv=document.getElementById("ibm-poll");   
        var   width=document.body.clientWidth;  
        var   height=document.body.clientHeight;   
        var   w=midDiv.offsetWidth; 
        var   h=midDiv.offsetHeight; 
        midDiv.style.left=(width-w)/2 + "px";
        midDiv.style.top=(height-h)/2 + "px"; 
	}
	//hide the poll popup
	function hidePoll(){
		document.getElementById("ibm-poll").style.display = "none"; 
	}
