try{
    var keywords = null;
    var have_timer = false;
    var day = null;

    //七日谈
   /* var now = new Date();
    var last_id = now.getDay();
    if(!last_id){
        last_id = 6;
    }*/

    window.onload = function()
    {
        keywords=document.getElementById("keyword");
        if (keywords)
        {
           keywords.value = tip_arr[0][1];
        }
        //keywords.value = tip_arr['search_navi_1'];

        try{
			clockon();
		}catch (e) {}

        //try{
		//	setInterval('abc()',1000);
		//}catch (e) {}

        //七日谈
        /*day = document.getElementById('day_'+last_id);
        if(day){
            div_show(last_id);
        }*/
    }
} catch (e) {

}

//添加收藏夹
function add_favorite(){
    var d = new Date();
    var url=document.URL;
    var title=document.title;
    var img_obj = new Image();
    img_obj.src = 'http://pvsite.zol.com.cn/images/pvhit0001.gif?t='+d.getTime()+'&zolfavorite';
    if (document.all) window.external.AddFavorite(url,title);
    else if (window.sidebar) window.sidebar.addPanel(title,url,"");
}

function readCookie(name){
  var cookieValue = "";
  var search_s = name + "=";
  if(document.cookie.length > 0)
  {
    offset = document.cookie.indexOf(search_s);
    if (offset != -1)
    {
      offset += search_s.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = decodeURI(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}



//导航滑块隐显
//七日谈
function div_show(id)
{
    if(id != last_id)
    {
        document.getElementById('day_'+id).className = 'act';
        document.getElementById('day_'+last_id).className = 'nor';
        document.getElementById('talk_'+id).style.display = '';
        document.getElementById('talk_'+last_id).style.display = 'none';
		try {  
			pageTracker._trackEvent("Homapage", "day_div",last_id+"=>"+id);
		}catch(err)  {  
		
		}

		last_id = id;
    }else{
        document.getElementById('day_'+id).className = 'act';
        var arr =[1,2,3,4,5,6];
        arr.splice((id-1),1)
        for(var i=0;i< arr.length;i++){
          document.getElementById('day_'+arr[i]).className = 'nor';
        }
    
	}

	

}

var last_fs_id = 1;
function show_fs_model(id){
     if(id != last_fs_id){
       document.getElementById('fs_'+id).className = 'act';
       document.getElementById('fs_'+last_fs_id).className = 'nor';
       document.getElementById('model_'+id).style.display = '';
       document.getElementById('model_'+last_fs_id).style.display = 'none';
       last_fs_id = id;
    }

}

var last_good_id = 1;
function show_good_peple(id){
     if(id != last_good_id){
       document.getElementById('good_'+id).className = 'act';
       document.getElementById('good_'+last_good_id).className = 'nor';
       document.getElementById('peple_'+id).style.display = '';
       document.getElementById('peple_'+last_good_id).style.display = 'none';
       last_good_id = id;
    }

}


var last_search_navi_id = 1;
 /*var tip_arr =new Array;
    tip_arr['search_navi_1'] = '请输入文章标题';
    tip_arr['search_navi_2'] = '请输入图片名';
    tip_arr['search_navi_3'] = '请输入摄影师姓名或昵称';
    tip_arr['search_navi_4'] = '请输入影楼名称';
    tip_arr['search_navi_5'] = '例如：输入“ D300”';
    tip_arr['search_navi_6'] = '请输入你要搜素的内容';*/
var tip_arr =[['search_navi_1','请输入文章标题'],['search_navi_2','请输入图片名'],['search_navi_3','请输入摄影师姓名或昵称'],['search_navi_4','请输入影楼名称'],['search_navi_5','例如：输入“D300”'],['search_navi_6','请输入你要搜素的内容']];



var search_arr = new Array();
    search_arr["search_navi_1"] = "/search/1.asp";
    search_arr["search_navi_2"] = "/search/2.asp";
    search_arr["search_navi_3"] = "/search/3.asp";
    search_arr["search_navi_4"] = "/search/4.asp";
    search_arr["search_navi_5"] = "/search/5.asp";
    search_arr["search_navi_6"] = "/search/6.asp";
function show_index_search_navi(id){

	var frm = document.getElementById('search_frm');
    if(id != last_search_navi_id){
        try{
		document.getElementById('search_navi_'+id).className = 'act';
        document.getElementById('search_navi_'+last_search_navi_id).className = 'nor';
		} catch (e) {

		}
        var current_key = 'search_navi_'+id;
       // var  curkey_val = tip_arr[current_key];
        var  curkey_val = tip_arr[id-1][1];
        for(var i=0;i<tip_arr.length;i++){
                
			if( keywords.value == tip_arr[i][1] || keywords.value ==''){
                    
				keywords.value = curkey_val;
                keywords.style.color = "#cccccc";
                keywords.blur();
                
			}
        }
        if (id==6) {
            var oA = document.createElement('input');
            oA.setAttribute('type', 'hidden');
            oA.setAttribute('name', 'tkey');
			oA.setAttribute('id', 'tkey');
            oA.setAttribute('value', keywords.value);
             try{
			frm.appendChild(oA);
			} catch (e) {

		}
        }
        frm.action=search_arr[current_key];
        last_search_navi_id = id;


    }

}
function chk_frm(){
	 keywords=document.getElementById("keyword");
        for(var i=0;i<tip_arr.length;i++){
                
			if( keywords.value == tip_arr[i][1]){
                    
				keywords.value = "";

                
			}
        }	
}
var last_bbs_navi_id = 1;
function show_index_bbs_navi(id){
    if(id != last_bbs_navi_id){
       document.getElementById('index_bbs_navi_'+id).className = 'act';
       document.getElementById('index_bbs_navi_'+last_bbs_navi_id).className = 'nor';
       document.getElementById('forum_navi_'+id).style.display = '';
       document.getElementById('forum_navi_'+last_bbs_navi_id).style.display = 'none';
       last_bbs_navi_id = id;
    }

}

var last_links_navi_id = 1;
function show_index_links(id){
    if(id != last_links_navi_id){
       document.getElementById('show_index_links_'+id).className = 'act';
       document.getElementById('show_index_links_'+last_links_navi_id).className = 'nor';
       document.getElementById('index_links_'+id).style.display = '';
       document.getElementById('index_links_'+last_links_navi_id).style.display = 'none';
       last_links_navi_id = id;
    }

}


function clockon()
{
    var now = new Date();
    var year = now.getYear();
	year = year<1900 ? (1900+year) : year; //iif函数使代码同时兼容IE和firefox
    var month = now.getMonth();
    var date = now.getDate();
    var day = now.getDay();
   // var hour = now.getHours();
   // var minu = now.getMinutes();
   // var sec = now.getSeconds();
    var week;
    month = month+1;
    if(month<10)month="0"+month;
    if(date<10)date="0"+date;
    //if(hour<10)hour="0"+hour;
   // if(minu<10)minu="0"+minu;
   // if(sec<10)sec="0"+sec;
    var arr_week = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
    week = arr_week[day];
    var time = "";
   // time = year+"年"+month+"月"+date+"日"+" "+week+" "+hour+";"+minu+";"+sec;
   time = year+"年"+month+"月"+date+"日"+" "+week+" ";
    try{
	bgclock = document.getElementById('bgclock');
	} catch (e) {

	}
	if(bgclock)
    {
         bgclock.innerHTML=time;

    }
	if (!have_timer)
	{
		var timer = setTimeout("clockon(bgclock)",1000);
		have_timer =true;

	}

}


function onblur_keyword() {
     curkey_val = document.getElementById("keyword").value;
     if (curkey_val == "")
    {
        current_key = document.getElementById("current_id").value;
        document.getElementById("keyword").value = tip_arr[current_key];
        document.getElementById("keyword").style.color = "#cccccc";
    }
}

function set(value){
  // alert(value);
 document.getElementById("keyword").value ='';
  document.getElementById("keyword").style.color = "#000000";

}

function open_window(url)
{
	var open_frm=document.createElement("form");
	open_frm.method="POST";
	open_frm.target="_blank";
	open_frm.action=url;
	document.body.appendChild(open_frm);
	open_frm.submit();
}

function Marquee()
{
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID)
	{
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.Correct = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "bottom":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8]
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}


Marquee.prototype.Start = function()
{
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width;
	this.ID.style.height = this.Height;
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	//this.ID.innerHTML += this.ID.innerHTML;
	var msobj = this;
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function()
				{
					if(msobj.MouseOver == 1)
					{
						setTimeout(msobj.Continue,delaytime);
					}
					else
					{	clearInterval(msobj.TimerID);
						msobj.CTL = msobj.Stop = 0;
						msobj.TimerID = setInterval(msobj.StartID,timer);
					}
				}

	msobj.Pause = function()
			{
				msobj.Stop = 1;
				clearInterval(msobj.TimerID);
				setTimeout(msobj.Continue,delaytime);
			}

	msobj.Begin = function()
		{
			msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth : msobj.ID.scrollHeight;
			if((msobj.Direction <= 1 && msobj.ClientScroll <msobj.Height) || (msobj.Direction > 1 && msobj.ClientScroll <msobj.Width))return;
			msobj.ID.innerHTML += msobj.ID.innerHTML;
			msobj.TimerID = setInterval(msobj.StartID,timer);
			if(msobj.ScrollStep < 0)return;
			msobj.ID.onmousemove = function(event)
						{
							if(msobj.ScrollStep == 0 && msobj.Direction > 1)
							{
								var event = event || window.event;
								if(window.event)
								{
									if(msobj.IsNotOpera)
									{
										msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
									}
									else
									{
										msobj.ScrollStep = null;
										return;
									}
								}
								else
								{
									msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
								}
								msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
								msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
								msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
							}
						}
			msobj.ID.onmouseover = function()
						{
							if(msobj.ScrollStep == 0)return;
							msobj.MouseOver = 1;
							clearInterval(msobj.TimerID);
						}
			msobj.ID.onmouseout = function()
						{
							if(msobj.ScrollStep == 0)
							{
								if(msobj.Step == 0)msobj.Step = 1;
								return;
							}
							msobj.MouseOver = 0;
							if(msobj.Stop == 0)
							{
								clearInterval(msobj.TimerID);
								msobj.TimerID = setInterval(msobj.StartID,timer);
							}
						}
		}
	setTimeout(msobj.Begin,waittime);
}

Marquee.prototype.Scroll = function()
{
	switch(this.Direction)
	{
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop >= this.ClientScroll)
				{
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop <= 0)
				{
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft >= this.ClientScroll)
				{
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft <= 0)
				{
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}