var extAPI = browser;      //Firefox uses "browser" object.
function SendMessage(jsonobj,callback)
{  
    extAPI.runtime.sendMessage(jsonobj, callback);
}

function GetWindow()
{
   if(typeof unsafeWindow != "undefined")
     return unsafeWindow;
   else 
     return window;   
}