﻿//收益排行榜显示详细信息
function ShowMemIncomeDetail(Num)
{
    var MemIncome_detail_info=document.getElementById("right_income_item_white"+Num);
    for(var i=1;i<=8;i++)
    {
        if(i!=Num)document.getElementById("right_income_item_white"+i).style.height="25px";
    }
	MemIncome_detail_info.style.height="60px";
    var top=getTop(MemIncome_detail_info);
    
    var MemIncome_detail=document.getElementById("MemIncome_detail");
    MemIncome_detail.style.top = top+ "px";
    
	var MemIncome_detail_num=document.getElementById("MemIncome_detail_num");
	var MemIncome_detail_info=document.getElementById("MemIncome_detail_info");
	var detail_Img=document.getElementById("detail_Img");
	if (MemIncome_detail_num.innerHTML!=Num)
	{
		MemIncome_detail_num.innerHTML="0"+Num;
		var Name=document.getElementById("name"+Num);
		var array=Name.getElementsByTagName("a");
		var str=array[0].id;
		//alert(str.indexOf(","));
		if(str.indexOf(",")==0)//会员图像为空
			detail_Img.src="/UploadFile/MemImage/touxiang_05.jpg";
		else
		{
			var MemImg=str.substring(0,str.indexOf(","));
			detail_Img.src="/UploadFile/MemImage/"+MemImg;
		}
		var resnum=str.substring(str.indexOf(",")+1);
		//alert(MemberId);
	
		var str_info=Name.innerHTML;
		str_info=str_info+"<br />"+document.getElementById("account"+Num).innerHTML;
		str_info=str_info+"<br />共分享"+resnum+"个内容";
		MemIncome_detail_info.innerHTML=str_info;
		
	}
	
	
}

//获得相对于整个浏览器画布的纵坐标（offsetTop是相对于其父元素位置的相对位置）
function getTop(e)
{
       var offset=e.offsetTop;
       if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
       return offset;
}



function Roll()
{
     //向上滚动
    var speed=70 
    circle2.innerHTML=circle1.innerHTML   //克隆circle1为circle2 
    function Marquee()
    { 
        if(circle2.offsetTop-circle.scrollTop<=0) //滚动至circle1与circle2交界时 
            circle.scrollTop-=circle1.offsetHeight  //跳到最顶端 
        else
        { 
            circle.scrollTop++ 
        } 
    } 
   var MyMar=setInterval(Marquee,speed) //定时器 
   circle.onmouseover=function() {clearInterval(MyMar)}//鼠标移上时清除定时器达到滚动停止的目的 
   circle.onmouseout=function() {MyMar=setInterval(Marquee,speed)}//鼠标移开时重设定时器 
}


//首页广告
function ShowIndexAd (n)
{
    if (n==1)
    {
        ShowFlash("/flash/banner/quan.swf",700,83);
//        document.write('<a target="_blank" href="/miracle"><img alt="" src="/images/banner/miracle.jpg" /></a>'); 
    }
     else if (n==6)
    {
         document.write('<a href="http://www.vancl.com/websource/websource.aspx?url=http://www.vancl.com/&source=waydu" target="_blank"><img src="http://union.vancl.com/adpic.aspx?w=234&h=60" border="0" /></a>'); 

    }
    else if (n==2)
    {
                
         document.write('<script type="text/javascript">google_ad_client = "pub-8213041746605244";google_ad_slot = "9906037603";google_ad_width = 233;google_ad_height = 233;</script>');
         document.write('<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');

    }
}

function ShowFlash (swfpath,width,height)
{
	document.write('<object ID="focus_flas" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ width +'" height="'+ height +'">'); 
	document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="' + swfpath + '"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">'); 
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">'); 
	document.write('<embed ID="focus_flash" src="' + swfpath + '" wmode="opaque" menu="false" bgcolor="#C5C5C5" quality="high" width="'+ width +'" height="'+ height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>'); 
}


//首页搜索
function IndexSearch()
{
	 var IndexSearchBox=document.getElementById("IndexSearchBox");
	 var SearchTypeContent=document.getElementById("SearchTypeContent");
	 var SearchTypeThematics=document.getElementById("SearchTypeThematics");
	 var SearchTypeCircle=document.getElementById("SearchTypeCircle");
	 var SearchTypeColleague=document.getElementById("SearchTypeColleague");

	if(DropSpace(IndexSearchBox.value)=="")
	{
		alert("搜索关键字不能为空");

		IndexSearchBox.focus();
		return false;
	}
	var keyword = encodeURI(IndexSearchBox.value);
	
	var path="/list/0_127_3_key"+keyword;
	if(SearchTypeThematics.checked) path="/topic/peer_job_key"+keyword+"_type3";
	else if(SearchTypeCircle.checked) path="/circle/1_key"+keyword;
	else if(SearchTypeColleague.checked) path="/colleague/peer_job_key"+keyword+"_type2_mem3";
    location.href=path;

}


function submitLogin() {
    var txtUserCode = document.getElementById("txtUserCode");
    var txtPassWord = document.getElementById("txtPassWord");
    var SaveCookie = document.getElementById("SaveCookie");
    var LongLogin = "0";
    if (txtUserCode.value == "") {
        window.alert("请输入用户名！");
        txtUserCode.focus();
        return false;
    }
    if (txtPassWord.value == "") {
        window.alert("请输入密码！");
        txtPassWord.focus();
        return false;
    }
    if (SaveCookie.checked)
    {
        LongLogin = "1";
        
    }
	//alert( hex_md5(txtPassWord.value));
    window.location.href = "user_login.aspx?fromUrl=index&UserCode=" + txtUserCode.value + "&PassWord=" + hex_md5(txtPassWord.value) + "&LongLogin=" + LongLogin;
}

//首页输入密码后默认回车提交登录事件
function LoginSubmit() {
    if (event.keyCode == 13) {
        event.keyCode = 9;
        event.returnValue = false;
        submitLogin();
    }
}

function OnBlur(obj, value) {
    if (obj.value == '') {
        obj.value = value;
        obj.style.color = "#7e7e7e";
    }
    else {
        obj.style.color = "#000000";
    }
}

function OnFocus(obj, value) {
    if (obj.value == value) {
        obj.value = '';
    }
    obj.style.color = "#000000";
}

//倒计时
var target = [];
var time_id = [];
var timeLabel_id = [];
var timeOver_id = [];
function show_date_time_0() {
    setTimeout("show_date_time_0()", 1000);
    for (var i = 0, j = target.length; i < j; i++) {
        if (document.getElementById(time_id[i]).style.display != "none") {
            today = new Date();
            timeold = target[i] - today.getTime();
            sectimeold = timeold / 1000;
            secondsold = Math.floor(sectimeold);
            msPerDay = 24 * 60 * 60 * 1000;
            //e_daysold = timeold / msPerDay;
            //daysold = Math.floor(e_daysold);
            e_hrsold = (timeold / msPerDay) * 24;
            hrsold = Math.floor(e_hrsold);
            e_minsold = (e_hrsold - hrsold) * 60;
            minsold = Math.floor((e_hrsold - hrsold) * 60);
            seconds = Math.floor((e_minsold - minsold) * 60);
            if (e_hrsold < 0) {
                document.getElementById(time_id[i]).style.display = "none";
                document.getElementById(timeLabel_id[i]).style.display = "none";
                document.getElementById(timeOver_id[i]).style.display = "";
            }
            else {
                if (hrsold < 10) { hrsold = "0" + hrsold }
                if (minsold < 10) { minsold = "0" + minsold }
                if (seconds < 10) { seconds = "0" + seconds }
                document.getElementById(time_id[i]).innerHTML = hrsold + "时" + minsold + "分" + seconds + "秒";
            }
        }
    }
}
setTimeout("show_date_time_0()", 100);