
function UserHit(str_url,str_tag,str_title)
{
//	alert(url);
/*	
	$.post(¡¯UserHit.php¡¯, {
		url: str_url,
		tag: str_tag,
		title: str_title,
		}, function() {
			alert(¡¯Your data has been saved.¡¯);
		});
*/
	var strDat="title="+encodeURIComponent(str_title)+"&url="+encodeURIComponent(str_url)+"&tag="+encodeURIComponent(str_tag);
	//alert(strDat);
	$.ajax(
		{ type: "POST",
//			url: ajax_path+"cart.php",
			url: "userhit.php",
			data: strDat,
			success: function(msg)
					{ 
//						alert(msg);
//						window.location.reload(); 
					}
		}
	);	
}

function getOs()
{
   if(navigator.userAgent.indexOf("MSIE")>0)return 1;
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)return 2;
   if(isSafari=navigator.userAgent.indexOf("Safari")>0)return 3;   
   if(isCamino=navigator.userAgent.indexOf("Camino")>0)return 4;
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)return 5;
   return 0;
}

function setNewHomepage(url)
{
	if (document.all)
	{
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(url);
	}
	else if (window.sidebar)
	{
		if(window.netscape)
		{
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}
			catch(e)
			{
				alert("this action was aviod by your browser£¬if you want to enable£¬please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");
			}
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',url);
	}
}
function addBookmark(title,url) 
{
	if (window.sidebar) 
	{
		window.sidebar.addPanel(title, url,""); 
	} 
	else if( document.all ) 
	{
		window.external.AddFavorite( url, title);
	}
	else if( window.opera && window.print ) 
	{
		//return true;
/*		
		var mbm = document.createElement('a');
		mbm.setAttribute('rel','sidebar');
		mbm.setAttribute('href',url);
		mbm.setAttribute('title',title);
		mbm.click();
		alert("opera");
*/		

    document.getElementById("addlink").href=window.location;
    document.getElementById("addlink").title=document.title;
    document.getElementById("addlink").rel="sidebar";
		
	}
	return true;
}

