var ie4 = (document.all) ? true : false;
var op7 = (window.opera) ? true : false;

function setHomePage(obj,URL){
    try
    {
        if (ie4&&!op7&&obj) {
            if (!URL)
            {
                URL='http://' + window.location.host;
            }
	        obj.style.behavior='url(#default#homepage)';
	        obj.setHomePage(URL);
        }
    } 
    catch (e)
    {
        alert(e.message)
    }
    if (ie4&&!op7&&obj) {
      obj.style.behavior='';
    }
    return false;
}

function AddToFavorites(URL,Title){
    try
    {
        if (!URL)
        {
            URL='http://' + document.location.host;
        }
        if (!Title)
        {
            Title=document.title;
        }
        if (ie4&&!op7) {
	        window.external.AddFavorite(URL,Title);
        } else if (op7) {
            document.body.innerHTML += '<'+'a href="'+URL+'" title="'+Title+'" rel="sidebar" style="display: none;" id="addbookmark">click<'+'/a>';
            document.getElementById('addbookmark').click();
            document.getElementById('addbookmark').outerHTML = '';
        }
    }
    catch (e)
    {
        alert(e.message)
    }
    return false;
}