﻿
function setHomePage(){
	var obj=document.body;
    var aUrls=document.URL.split("/");
    var vDomainName="http://"+aUrls[2]+"/";
    try{//IE
        obj.style.behavior="url(#default#homepage)";
        obj.setHomePage(vDomainName);
    }catch(e){//other
        if(window.netscape) {//ff
            try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                    alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage',vDomainName);
         }
    }
}
function addFavorite(){
    var vDomainName=document.URL;
    var description=document.title;
    try{//IE<=7
        window.external.AddFavorite(vDomainName,description);
    }catch(e){
		try{//FF
        	window.sidebar.addPanel(description,vDomainName,"");
		}
		catch(e){//IE=8
			alert("您可能使用IE8，请使用Ctrl+D进行添加");
		}
    }
}
function look_pwd(){
	window.location.href="?com=com_passport&method=getbackpwd";
	}
	
	
var EnterKeywords="请输入产品名称";
function Search_Submit(formid){
	if($('#content_name').val() == EnterKeywords || $('#content_name').val() ==''){
		$('#content_name').val('');
		$('#content_name').focus();
		return false;
	}
	$("#"+formid).submit();
}
$(document).ready(function(){
	if($('#content_name').val()==''){
		$('#content_name').val(EnterKeywords);
	}
	$('#content_name').blur(function () {
		if ($(this).val() == '') { 
			$(this).val(EnterKeywords); 
		}
	}).focus(function () {
		if ($(this).val() == EnterKeywords) { 
			$(this).val(''); 
		}
	}); 
});
	
	
function Form_Submit(formid){
	if($("#"+formid).get(0)){
		if(!$("#"+formid).attr('checked')){
			alert($("#"+formid).attr('title'));
			return ;
			}
		}
		$('#'+formid).submit();
	
}
function Form_Reset(formid){
		$('#'+formid).get(0).reset();
}
$(function() {
	//$(".jqzoom").jqzoom({title : false,zoomWidth: 400,zoomHeight: 300});
	
});

function getNextvalue(action,code,id){
	var url = 'ajaxaddr.php?request='+action+'&code='+code;
	$.get(url,function(data){
					   $('#'+id).html(data);
					   })
}


$(function() {
	
	$('.tabs').each(function(i){
		
		var $$=$(this);
		var $info=$('.infos:eq('+i+')');
		
		$$.find('.green').each(function(j){
			$(this).mouseover(function(){
				//alert($info.get(0));
				
				$(this).parent().find('.hover').removeClass('hover').addClass('green');
				$(this).removeClass('green').addClass('hover');
				//alert($info.html());

				$info.children().hide();
				$info.children().eq(j).show();

			})
			
		})
		$$.find('.green').eq(0).mouseover();

	})

			//$('.tabs').eq(0).find('.green:eq(1)').mouseover();
	//$('.tabs').eq(1).find('.green:eq(0)').mouseover();
});



