﻿$(function() {
    var CodeFile="/public/tCode.ashx";
    
	  if($('#imgid'))
		
		$('#imgid').html('<img src="'+CodeFile+'?t='+Math.random()+'" alt="点击刷新验证码" style="cursor:pointer;border:0; width:70px;height:20px; vertical-align:middle;" onclick="this.src=\''+CodeFile+'?t=\'+Math.random()" />');
});
//获得验证码
function get_Code() {
    var url=window.location.href;
    var tmp= new Array();
    tmp=url.split("/");
    var pp = tmp[tmp.length-1];
    tmp=pp.split("?");
    var CodeFile; 
   CodeFile="/public/tCode.ashx";

	if($('.imgid'))
		
		$('.imgid').html('<img src="'+CodeFile+'?t='+Math.random()+'" alt="点击刷新验证码" style="cursor:pointer;border:0; width:80px;height:20px; vertical-align:middle;" onclick="this.src=\''+CodeFile+'?t=\'+Math.random()" />');
}


//首页和加入收藏
function addBookmark(title) {
                     var url=parent.location.href;
                     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;
                     }
       }
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                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',vrl);
                 }
        }
}

