﻿jQuery(document).ready(function () {  
//修改首页链接
jQuery(".neirong .snav a").attr("href","http://www.xjjbzy.com/");

//添加到收藏夹  
jQuery("input.sch_txt").attr("value",' ==== 输入关键字 ====');
  jQuery("#favorites").click(function () {　　　　//$里面是链接的id  
   var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL';  
  if (document.all) {  
   window.external.addFavorite('http://www.xjjbzy.com', '新疆金博种业中心')  
  } else if (window.sidebar) {  
  window.sidebar.addPanel('新疆金博种业中心', 'http://www.xjjbzy.com', "金博种业")  
  } else {　　　　//添加收藏的快捷键  
  alert('添加失败\n您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~')  
  }  
  });
//设置主页  
jQuery("#addHomePage").click(function () {  
  if (document.all) {　　　　//设置IE  
   document.body.style.behavior = 'url(#default#homepage)';  
  document.body.setHomePage(document.URL);  
  } else {　　　　　　　　//网上可以找到设置火狐主页的代码，但是点击取消的话会有Bug，因此建议手动设置  
  alert("设置首页失败，请手动设置！");  
  }  
  });  
//text控件激活事件  
  jQuery('input[type="text"]').focus(function() {  
        if (this.value == this.defaultValue){  
            this.value = '';  
        }  
        if(this.value != this.defaultValue){  
            this.select();  
        }  
    });  
    jQuery('input[type="text"]').blur(function() {  
        if (this.value == ''){  
            this.value = (this.defaultValue ? this.defaultValue : '');  
        }  
    });  
  });  
