
/* 
  * adds a bookmark for IE and firefox.
  *
  * url -- window.location
  * title -- string for the bookmark.
  * fcParam -- a parameter that is appended to the url for fire click.
  */
 function bookmarkSite(url, title, fcParam)
 {
    if (document.all)
    {
        window.external.AddFavorite(appendFireClickParam(url, fcParam), title);
    }
    else if (window.sidebar)
    {
        window.sidebar.addPanel(title, appendFireClickParam(url, fcParam), "");
    }
    else 
    { 
        alert("Your browser doesn't support this function."); 
    }
}

/*
 * appends the fireclick parameter if it exists.
 */
function appendFireClickParam(url, fcParam)
{
    var finalUrl = null;
    var addFc = fcParam != null && fcParam != 'undefined' && fcParam != '';
		
    if(url.search == null || url.search == 'undefined' || url.search == '')
    {
        finalUrl = url.protocol + '//' + url.host + url.pathname + (addFc ? '?fc='+ fcParam : '');
    }
    else
    {
        finalUrl = url.protocol + '//' + url.host + url.pathname + url.search + (addFc ? '&fc='+ fcParam : '');
    }
	
    return finalUrl;
}

/*
 * Clears Email Collection input box
 */
function ClearEmail(textbox)
{
	if(textbox.value == textbox.defaultValue)
	{
		textbox.value = '';
	}
}