﻿function htliclick_mainside()
{
  clearallaclass();
  hideallul();
  this.className = aclassName;
  ph_uls[this.i].style.display = "block";
  return false;
}

function hideallul()
{
  for( var i=0; i<ph_uls.length; i++ )
  {
	ph_uls[i].style.display = "none";
  }
}

function clearallaclass()
{
  for( var i=0; i<date_as.length; i++ )
  {
	date_as[i].className = "";
  }
}

function ddsover()
{
var tempobj = comiclassdivs[this.i];
if( this.i%2 != 0 ) tempobj.style.background = "#fff1d0";
  this.style.background = "#fff1d0";
  
}

function ddsout()
{
  var tempobj = comiclassdivs[this.i];
  if( this.i%2 != 0 ) tempobj.style.background = "#fffbeb";
  this.style.background = "none";
}
function cdivs()
{
  var tempnum = 0;
  var tempobj = [];
  var temp =  comiclass.getElementsByTagName("div");
  for( var i=0; i<temp.length; i++ )
  {
	if( temp[i].className == "rightceg" || temp[i].className == "rightce" )
	 {
		tempobj[tempnum] = temp[i];
		 tempnum++;
	 }
  }
  return tempobj;
}

function htliclick()
{
  clearallclass();
  hidealldiv();
  this.className = upclassName;
  hotces_divs[this.i].style.display = "block";
}

function hidealldiv()
{
  for( var i=0; i<hotces_divs.length; i++ )
  {
	hotces_divs[i].style.display = "none";
  }
}

function clearallclass()
{
  for( var i=0; i<hotce_t_lis.length; i++ )
  {
	hotce_t_lis[i].className = "";
  }
}
function getHello()
{
	day = new Date( ) 
	sj = day.getHours();
	var str;
	if(sj>=6&&sj<12){
		str = "早上好！";
	}
	else if(sj>=12&&sj<13){
		str = "中午好！";			
	}
	else if(sj>=13&&sj<18){
		str = "下午好！";
	}
	else if(sj>=18&&sj<24){
		str = "晚上好！";
	}
	else if(sj>=0&&sj<6){
		str = "夜深了,注意身体哦^_^！";
	}
	return str;
}
function  addfavorite()
{
if (document.all)
{
window.external.addFavorite("http://comic.duowan.com","多玩漫画");

}
else if (window.sidebar)
{
window.sidebar.addPanel("多玩漫画","http://comic.duowan.com","");

}
}
function sethomepage()
{
if (document.all)
{
	document.body.style.behavior='url(#default#homepage)';
	document.body.sethomePage('http://comic.duowan.com/');
} else if (window.sidebar) {
	if(window.netscape)
	{
		try
		{
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		}
		catch (e)
		{
			alert("Firefox暂无此功能，请手动设置。" );
		}
	}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage','http://comic.duowan.com/');
	  alert("设置http://comic.duowan.com为浏览器首页成功");
}
}

function getCookieValue(varname)
{
	if(varname)
	{
		var a=document.cookie.indexOf(varname+"=");
		if(a!=-1)
		{
			return document.cookie.substring((a+varname.length+1),document.cookie.length).split(";")[0];
		}
		else
		{
			return "";
		}
	}
}
			
function showLogin()
{
	document.getElementById("imgDiv").style.display = "none";
	document.getElementById('fomlogin').style.display='block';
	document.getElementById("other_nav").onmouseover = null;
	document.getElementById("other_nav").onmouseout = null;
	
}

function showContent()
{
	if(mid =="")
	{
		document.getElementById("login_cont").style.display="none";
		
		document.getElementById("flogin").style.display="block";
		
		//document.getElementById("username").focus();
	}
}

function hideContent()
{
	if(mid=="")
	{
		document.getElementById("login_cont").style.display="block";
		document.getElementById("flogin").style.display="none";
	}
}
function shareBookShelf(){
	board=window.document.location.href;
	window.clipboardData.setData("Text",board);
	alert("复制成功，Ctrl+V 黏贴到QQ上告诉你的好友们吧~");
}
function logins(){
	var username = document.getElementById("username");
	var urls = window.location.href;
	document.getElementById('url').value = urls;
	document.getElementById('fomlogin').submit();
}
function loginout(){
	var url = window.location.href;
	window.location.href = "http://j.comic.duowan.com/shelf/logout.jsp?url="+url+"";
}

function hongkong(){
	alert("港台漫画栏目暂时关闭，整理数据，请留意开放时间。给您带来不便，敬请原谅！");
}