//改变验证码
function changeValidation(url)
{
	var v = document.getElementById('validationImg');
	var d = new Date();
	v.src = url + 'validation-' + d.getTime();
}

function switchMenu(pre,id,total,more)
{
	//document.getElementById(pre+'_menu_'+id).className = 'active';
	document.getElementById(pre+'_content_'+id).style.display = '';
	if(more)
	{
		document.getElementById(pre+'_more_'+id).style.display = '';
	}

	for(i=1; i<=total; i++ )
	{
		if(i!=id)
		{
			//document.getElementById(pre+'_menu_'+i).className = '';
			document.getElementById(pre+'_content_'+i).style.display = 'none';
			
			if(more)
			{
				document.getElementById(pre+'_more_'+i).style.display = 'none';
			}
		}
	}	
}

function addFavorite(domain,name)
{
	if (document.all)
	{ 
		window.external.addFavorite(domain,name); 
	}
	else if (window.sidebar)
	{ 
		window.sidebar.addPanel(name, domain, ""); 
	}
} 

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( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" );  
			}
		} 
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',url);
	}
}


function clearInput(id)
{
	if(document.getElementById(id).value=='请输入搜索内容')
	{
		document.getElementById(id).value = ''
	}
}

function sendToSearch(url)
{
	var words = document.getElementById('words').value;
	location.href = url+words;
	
	return false;
}

function submitSearchForm()
{
	document.searchform.submit();
}
