﻿function addfavorite()
{
	var nowUrl=window.location.href;
	var nowTitle=document.title;
	switch(getOs())
	{
		case 1:window.external.addFavorite(nowUrl,nowTitle);break;
		case 2:window.sidebar.addPanel(nowTitle, nowUrl, "");break;
		case 0:alert("加入收藏夹错误!请手动加入收藏");break;
	}
}
function getOs()
{
   if(navigator.userAgent.indexOf("MSIE")>0)return 1;
   if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)return 2;
   if(isSafari=navigator.userAgent.indexOf("Safari")>0)return 3;   
   if(isCamino=navigator.userAgent.indexOf("Camino")>0)return 4;
   if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0)return 5;
   return 0;
}
function setHomepage()//设置首页
{
    if (document.all)
	{
        document.body.style.behavior = 'url(#default#homepage)';
        document.body.setHomePage('http://www.szhuancai.com/');
    }
	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', 'http://www.szhuancai.com/');
    }
}
function $(ObjId)
{
    return document.getElementById(ObjId);
}
function distwo(nowid,count)
{
	for(var i=0;i<count;i++)
	{
		$("m"+i).style.display="none";
	}
	$("m"+nowid).style.display="";
}
function CheckForm(){
	if(!document.Ulogin.Uname.value){
		alert("请输入用户名！");
		document.Ulogin.Uname.focus();
		return false;
	}
	if(!document.Ulogin.Upwd.value){
		alert("请输入密码！");
		document.Ulogin.Upwd.focus();
		return false;
	}
	return true;
}
lastScrollY = 0;
function heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("leftDiv").style.top = parseInt(document.getElementById("leftDiv").style.top)+percent+"px";
document.getElementById("rightDiv").style.top = parseInt(document.getElementById("rightDiv").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
//下面这段删除后，对联将不跟随屏幕而移动。
window.setInterval("heartBeat()",1);
//-->
//关闭按钮
 
function close_right1(){
    right1.style.visibility='hidden';
}
function close_right2(){
    right2.style.visibility='hidden';
}
//显示样式
document.writeln("<style type=\"text\/css\">");
document.writeln("#rightDiv{width:109px;height:250px;position:absolute;}");
document.writeln(".itemFloat{width:109px;line-height:250px}");
document.writeln("<\/style>");
//以下为主要内容
document.writeln("<div id=\"leftDiv\" style=\"top:360px;\">");
//------左侧各块开始
 
//------左侧各块结束
document.writeln("<\/div>");
document.writeln("<div id=\"rightDiv\" style=\"top:250px;right:0px\">");
//------右侧各块结束
 
//---R1
document.writeln("<div id=\"right1\" class=\"itemFloat\">");
//document.writeln("<IFRAME src='http://www.szhuancai.com/qq.asp' frameBorder=0 width=109 height=200 scrolling=no ></IFRAME>");
//document.writeln("<br><a href=\"javascript:close_right1();\" title=\"关闭上面的广告\">×<\/a><br><br><br><br>");
document.writeln("<\/div>");
 
//------右侧各块结束
document.writeln("<\/div>");
document.writeln("<SCR"+"IPT LANGUAGE=\"JavaScript\" src=\"http://float2006.tq.cn/floatcard?adminid=8393693&sort=0&version=vip\" charset=\"gb2312\"></SCR"+"IPT>")

