function add_inquery(type,url,id)
{
	if(id)
		pid=id;
	else
	{
		var pid='';
		$(".list").find("input[name='inquery']:checked").each(function(i){
			pid+=(pid?',':"")+$(this).val();  								 
		});
	}
	if(!pid) return false;
	//--------------------------------------------------
	var url = url+'/ajax_back_end.php';
	var sj = Math.random();
	var pars = 'shuiji=' + sj+'&add_inquery=1&tid='+pid+'&type='+type; 
	$.post(url, pars,showResponse);
	function showResponse (originalRequest)
	{
		str=originalRequest;
		$('#inquiry_num').html(str);
		$('#inquiry_num1').html(str);
		alert('The item(s) you selected have been added to basket successfully!');
		
	}
}

$(function(){
	/* ȫѡ */
	 $('.checkall').click(function(){
		var _self = this;
		$('.checkitem').each(function(){
			if (!this.disabled)
			{
				$(this).attr('checked', _self.checked);
				if(_self.checked)
				$(this).parent().css("backgroundPosition","left -"+"50px");
				else
				$(this).parent().css("backgroundPosition","left -"+"0");
			}
		});
		$('.checkall').attr('checked', this.checked);
	});	 
});
function setHomepage(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("Your browser permissions is denied");
			 }
		}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',url);
 	}
}
	
function myAddPanel(url,title)
{
	var desc=title;
	if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
	{
		window.sidebar.addPanel(title,url,desc);
	}
	else
	{
		window.external.AddFavorite(url,title);
	}
}
function get_randfunc(obj)
{
	var sj = Math.random();
	obj.src=obj.src+'?'+sj;
}