// JavaScript Document
/*
update 2009-08-27
*/

var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
var cookiedomain = isUndefined(cookiedomain) ? top_domain() : cookiedomain;
var favurl="http://cang."+top_domain();
var bbsurl="http://bbs."+top_domain();
var weaurl="http://weather."+top_domain();
var cookiepath = isUndefined(cookiepath) ? '/' : cookiepath;
var munid=0;
function star(){
	onMouseOut=window.status='『'+top_domain().replace('.cn','')+'网址导航』我们一直用心在做^_~！';return true;
}
document.title=top_domain().replace('.cn','')+"网址站 - 最方便实用的网址导航专家-滨州吧,惠民吧,无棣吧,阳信吧,沾化吧,邹平吧,博兴吧"

/*
form create[action,href,src,kname,kvalue,but]
*/
var so=[
		['http://www.baidu.com/baidu','http://www.baidu.com/index.php?tn=kzxf_pg','pic/baidu.gif','word','','百度一下'],//百度网页
		['http://image.baidu.com/i','http://image.baidu.com/','pic/baidui.gif','word','','百度一下'],//百度图片
		['http://video.baidu.com/v','http://video.baidu.com/','pic/baiduv.gif','word','','百度一下'],//百度视频
		['http://mp3.baidu.com/m','http://mp3.baidu.com/','pic/mp3.gif','word','王菲','百度音乐'],//百度音乐
	//	['http://mp3.gougou.com/search','http://mp3.gougou.com/#id=57894','pic/baidum.gif','search','王心凌','狗狗搜索'],//狗狗音乐
['http://movie.xunlei.com/redirect.php','http://video.gougou.com/#id=57894','pic/gougoum.gif','t','锦衣卫','狗狗搜索'],//狗狗电影
		['http://search8.taobao.com/browse/search_auction.htm','http://goldlink.all4ad.cn/TaoBaoJump.aspx?uid=60660&lid=140','pic/tao.gif','q','','淘宝搜索'],//淘宝
		['http://zhidao.baidu.com/q?tn=ikaslist&pt=ohyo_ik&ct=17&lm=&kw=','http://zhidao.baidu.com/q','pic/zhi.gif','word','','搜索答案'],//知道
		['http://news.baidu.com/ns','http://news.baidu.com/','pic/baidu.gif','word','','百度一下'],//新闻
		['http://zhidao.baidu.com/q?tn=ikaslist&pt=ohyo_ik&ct=17&lm=&kw=','http://zhidao.baidu.com/q','pic/baidu.gif','word','','搜索答案'],//知道
		['http://www.google.cn/search','http://www.google.cn/webhp?prog=aff&client=pub-4514454744197247&channel=9494279485','','q','','谷歌搜索'],//谷歌
		['http://www.gougou.com/search','http://www.gougou.com/#id=57894','','search','','狗狗搜索'],//狗狗全部
		];
/*
form hidden create[[name,value]]
*/
var sohid=[
		   [['tn','kzxf_pg'],['ch','']],
		   [['cl','2'],['ct','201326592'],['lm','1']],
		   [['tn','301989888'],['rn','20'],['pn','0'],['s','0'],['fbl','1024']],
		   [['tn','baidump3'],['f','ms'],['rf','id'],['ct','134217728'],['lm','-1']],
		  // [['id','57894']],
		   [['unid','57795'],['i','1']],
		   [['pid','mm_12988176_0_0'],['commend','all'],['search_type','auction'],['at_topsearch','1'],['unid','5006628']],
		   [['ct','17'],['lm',''],['tn','ikaslist'],['kw',''],['pt','ohyo_ik']],
		   [['tn','news'],['from','news'],['ie','gb2312'],['bs','hehe'],['sr','0'],['cl','2'],['rn','20']['ct','1'],['prevct','no']],
		   [['ct','17'],['lm',''],['tn','ikaslist'],['kw',''],['pt','ohyo_ik']],
		   [['client','pub-4514454744197247'],['channel','9494279485'],['prog','off'],['hl','zh-CN'],['source','hp'],['aq','f']],
		   [['id','57894']],
		   ];
<!--+"?rand="+Math.random()-->
function loadSo(n){ munid=n; var sov=so[n];	$('so_form').action=sov[0];$('so_a').href=sov[1];$('so_img').src=sov[2];$('so_input').name=sov[3];$('so_input').value=sov[4];$('so_but').value=sov[5];$('so_ad').innerHTML=soad[n];	$('so_hid').innerHTML="";var soh=sohid[n];	for(i=0;i<soh.length;i++) addHidden($('so_hid'),soh[i][0],soh[i][1]);}
function ChangeMenu(n,l){for (i=0;i<l;i++)	$("m-" + i).className =(i==n?(i==0?"wrap-hover":"wrap-hover2"):(i==0?"wrapli":"wrapli2"));	loadSo(n);}
function cbutSo(n){var sov=so[n];	$('so_b_form').action=sov[0];$('so_b_input').name=sov[3];$('so_b_but').value=sov[5];$('so_b_hid').innerHTML="";var soh=sohid[n];for(i=0;i<soh.length;i++) addHidden($('so_b_hid'),soh[i][0],soh[i][1]);}
function $(id) {return document.getElementById(id);}
function addHidden(div,nam,v){	var ur=document.createElement('input');ur.type = "hidden";ur.name = nam;ur.value = v;div.appendChild(ur);}
function isUndefined(variable) {return typeof variable == 'undefined' ? true : false;}
function top_domain(){
	var domain;	var tmp=location.host.split('.');var i = tmp.length;domain= tmp[(i-2)]+"."+tmp[(i-1)];
	if(isUndefined(domain)|| domain=="undefined." ) domain='2548.cn'
	return domain;
}
function mb_cutstr(str, maxlen, dot) {
	var len = 0;
	var ret = '';
	var dot = !dot ? '...' : '';
	maxlen = maxlen - dot.length;
	for(var i = 0; i < str.length; i++) {
		len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1;
		if(len > maxlen) {
			ret += dot;
			break;
		}
		ret += str.substr(i, 1);
	}
	return ret;
}
function setcookie(cookieName, cookieValue, seconds, path, domain, secure) {
	var expires = new Date();
	expires.setTime(expires.getTime() + seconds * 1000);
	domain = !domain ? cookiedomain : domain;
	path = !path ? cookiepath : path;
	document.cookie = escape(cookieName) + '=' + escape(cookieValue)
		+ (expires ? '; expires=' + expires.toGMTString() : '')
		+ (path ? '; path=' + path : '/')
		+ (domain ? '; domain=' + domain : '')
		+ (secure ? '; secure' : '');
}
function getcookie(name) {
	var cookie_start = document.cookie.indexOf(name);
	var cookie_end = document.cookie.indexOf(";", cookie_start);
	return cookie_start == -1 ? '' : unescape(document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)));
}

function doane(event) {
	e = event ? event : window.event;
	if(is_ie) {
		e.returnValue = false;
		e.cancelBubble = true;
	} else if(e) {
		e.stopPropagation();
		e.preventDefault();
	}
}
function _attachEvent(obj, evt, func) {
	if(obj.addEventListener) {
		obj.addEventListener(evt, func, false);
	} else if(obj.attachEvent) {
		obj.attachEvent("on" + evt, func);
	}
}
function fetchOffset(obj) {
	var left_offset = obj.offsetLeft;
	var top_offset = obj.offsetTop;
	while((obj = obj.offsetParent) != null) {
		left_offset += obj.offsetLeft;
		top_offset += obj.offsetTop;
	}
	return { 'left' : left_offset, 'top' : top_offset };
}
var IMGDIR='http://www.2548.cn/time/images/';
var hiddenobj = new Array();
function pmwin(action, param, pmwidth , pmheight) {
	
	if($("weather_win")) $("weather_win").style.display = 'none';
	
	var objs = document.getElementsByTagName("OBJECT");
	
	if(action == 'open') {
		createBlurDiv()//打开背景
		for(i = 0;i < objs.length; i ++) {
			if(objs[i].style.visibility != 'hidden') {
				objs[i].setAttribute("oldvisibility", objs[i].style.visibility);
				objs[i].style.visibility = 'hidden';
			}
		}
		var clientWidth = document.body.clientWidth;
		var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
		var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
		if(!$('pmlayer')) {
			div = document.createElement('div');div.id = 'pmlayer';
			div.style.width = pmwidth + 'px';
			div.style.height = pmheight + 'px';
			div.style.left = ((clientWidth - pmwidth) / 2) + 'px';
			div.style.position = 'absolute';
			div.style.zIndex = '999';
			$('append_parent').appendChild(div);
			$('pmlayer').innerHTML = '<div style="width: '+pmwidth+'px; margin: 10px auto; text-align: left">' +
				'<div style="width: '+pmwidth+'px; height: ' + pmheight + 'px; position: relative; left: -6px; top: -3px">' +
				'<div style="position: relative; left: 0px; top: 0px; width: '+pmwidth+'px; height: 30px; margin-bottom: -30px;"></div>' +
				'<img  onclick="pmwin(\'close\')" style="cursor:pointer;position: absolute; right: 44px; top: 16px" src="/time/images/close.gif" title="关闭" />'+
				'<img style="cursor: move;position: absolute;  right: 20px; top: 16px" src="/time/images/move.gif" title="按住移动"  onmouseover="pmwindrag(this)" />' +
				'<div id="pmwinmask" style="margin-top: 30px; position: absolute; width: 100%; height: 100%; display: none"></div><iframe id="pmframe" name="pmframe" style="width:' + pmwidth + 'px;height:100%" allowTransparency="true" frameborder="0"></iframe></div></div>';
		}
		$('pmlayer').style.display = '';
		$('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px';

		pmframe.location = param;

	} else if(action == 'close') {
		removeBlurDiv()
		for(i = 0;i < objs.length; i ++) {
			if(objs[i].attributes['oldvisibility']) {
				objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue;
				objs[i].removeAttribute('oldvisibility');
			}
		}
		hiddenobj = new Array();
		$('pmlayer').style.display = 'none';
	}
}

var pmwindragstart = new Array();

function pmwindrag(obj) {
	obj.onmousedown = function(e) {
		if(is_ie) {
			document.body.onselectstart = function() {
				return false;
			}
		}
		pmwindragstart = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
		pmwindragstart[2] = parseInt($('pmlayer').style.left);
		pmwindragstart[3] = parseInt($('pmlayer').style.top);
		$('pmwinmask').style.display = '';
		doane(e);
	}

	_attachEvent(document.body, 'mousemove', function(e) {
													  
		if(pmwindragstart[0]) {
			var pmwindragnow = is_ie ? [event.clientX, event.clientY] : [e.clientX, e.clientY];
			with($('pmlayer')) {
				style.left = (pmwindragstart[2] + pmwindragnow[0] - pmwindragstart[0]) + 'px';
				style.top = (pmwindragstart[3] + pmwindragnow[1] - pmwindragstart[1]) + 'px';
			}
			doane(e);
		}
	});
	
	obj.onmouseup = function(e) {
		if(is_ie) {
			document.body.onselectstart = function() {
				return true;
			}
		}
		pmwindragstart = [];
		$('pmwinmask').style.display = 'none';
		doane(e);
	}
	obj.onmouseover = null;
}
function selecthidden(){
 var  input_elements=document.getElementsByTagName("select");
 var  theLength=input_elements.length;
 for(i=0;i<theLength;i++)
 {
  input_elements[i].style.visibility="hidden";
  }
}
function selectshow(){
 var  input_elements=document.getElementsByTagName("select");
 var  theLength=input_elements.length;
 for(i=0;i<theLength;i++)
 {
  input_elements[i].style.visibility="";
  }
}
function createBlurDiv(){
	
	var objScreen = document.createElement("div");
	objScreen.ondblclick =function() {	 pmwin('close'); }	
	var oS = objScreen.style;
	 objScreen.id = "ScreenOver";
	 oS.display = "block";
	 oS.top = oS.left = oS.margin = oS.padding = "0px";

	var wh = document.body.offsetHeight > document.documentElement.offsetHeight ? document.body.offsetHeight : document.documentElement.offsetHeight;
	oS.width = "100%";
	oS.height = wh;
	oS.position = "absolute";
	oS.zIndex = "998";
	oS.background = "#C8FFC8";
	oS.filter = "alpha(opacity=60)";
	oS.opacity = 40/100;
	oS.MozOpacity = 40/100;
	document.body.appendChild(objScreen);
	selecthidden();
}
function removeBlurDiv(){
 var ScreenOver = document.getElementById("ScreenOver");
 document.body.removeChild(ScreenOver);
 selectshow();
}
function divBlock(divname){
 var oneDiv = document.getElementById(divname);
  oneDiv.style.display="block";  
}
function divNone(divname){
 var oneDiv = document.getElementById(divname);
 oneDiv.style.display="none";
 }
function  appear(divname){
 createBlurDiv();
 divBlock(divname);
 }
function  disappear(divname){
 divNone(divname);
 removeBlurDiv();
}
function clock() {
	
	pmwin( 'open','http://www.2548.cn/time/myclock.htm', 320 , 340);
		
}
var moveing = false;scroLeng=734;
function moveElement(elementID,final_x,final_y,interval) {
  if (!document.getElementById) return false;
  if (!document.getElementById(elementID)) return false;
  var elem = document.getElementById(elementID);
  if (elem.movement) {
    clearTimeout(elem.movement);
  }
  if (!elem.style.left) {
    elem.style.left = "0px";
  }
  if (!elem.style.top) {
    elem.style.top = "0px";
  }
  var xpos = parseInt(elem.style.left);
  var ypos = parseInt(elem.style.top);
  if (xpos == final_x && ypos == final_y) {
		moveing=false;
		return true;
  }
  if (xpos < final_x) {
    var dist = Math.ceil((final_x - xpos)/10);
    xpos = xpos + dist;
  }
  if (xpos > final_x) {
    var dist = Math.ceil((xpos - final_x)/10);
    xpos = xpos - dist;
  }
  if (ypos < final_y) {
    var dist = Math.ceil((final_y - ypos)/10);
    ypos = ypos + dist;
  }
  if (ypos > final_y) {
    var dist = Math.ceil((ypos - final_y)/10);
    ypos = ypos - dist;
  }
  elem.style.left = xpos + "px";
  elem.style.top = ypos + "px";
  var repeat = "moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
  elem.movement = setTimeout(repeat,interval);
}
function next(previousBtn,nextBtn,scrollID) {
	if(moveing) return;
	moveing = true;
	var scroNum=parseInt(scroLeng/91);
	var vTop = parseInt(document.getElementById(scrollID).style.top);
	var vLeft = parseInt(document.getElementById(scrollID).style.left);
	var finalLeft = vLeft - 91*8;
	if (finalLeft <= -(scroLeng)) return moveing=false;
	moveElement(scrollID,finalLeft,vTop,5);
}
function previous(previousBtn,nextBtn,scrollID) {
	if(moveing) return;
	moveing = true;
	var vTop = parseInt(document.getElementById(scrollID).style.top);
	var vLeft = parseInt(document.getElementById(scrollID).style.left);
	if (vLeft >= 0) return moveing=false;
	var finalLeft = vLeft + 91*8;
	moveElement(scrollID,finalLeft,vTop,5);
}
var per="MdB_";
function favloading()
{
	var sid=getcookie(per+"sid_fav");var auth=getcookie(per+"auth_fav");var key=getcookie(per+"key_fav");
	if(sid!="" && auth!="" && key!=""){
		var ipUrl=favurl+"/mini/"+key+".js?r="+Math.random();
		if ( navigator.userAgent.toLowerCase().indexOf('msie') >= 0 ) {document.getElementById("FAV_D").src = ipUrl; } else {var js = document.createElement("script");js.setAttribute("type", "text/javascript");js.setAttribute("src", ipUrl);document.body.insertBefore(js, null);}
	} 
}
window.dh6700={} ;
window.dh6700.FavLoad=function(obj){
	var url=obj[2];	var html="";var len=url.length;
	scroLeng=len*91;
	$("cartoon_list").style.width=scroLeng+"px";
	for(var j=0;j<len;j++)html+='<li><a href="'+url[j]['fav_url']+'" target="_blank" title="'+url[j]['title']+'">'+url[j]['title']+'</a></li>';
	$("fav").innerHTML=html;	
	$("favapi").style.display="";
	
}

function indexSet(){window.open(favurl+'/index.php','设置首页');}
function loginOut()
{
	if(!confirm("您确定要退出网络收藏夹吗?")) return;
	
	setcookie(per+'auth_fav','');
	setcookie(per+'sid_fav','');
	setcookie(per+'key_fav','');
	$("fav").innerHTML="";	
	$("favapi").style.display="none";
}

function showFavM(){
	$('k_19').href=favurl;$('f_1').href=favurl;$('f_3').href=bbsurl;
/*
	var key=getcookie(per+"key_fav");
	if(key){$("FavM").style.display='none'; return;}
	var is_c=getcookie("is_c");
	var x=fetchOffset($("FavI"));
	var div=$("FavM");
	if(is_c) return;	
	div.style.left=x['left']-288+'px'
	div.style.display='block';
	setTimeout('showFavM()',500);
*/
}
function closeFavM(){
	setcookie('is_c',1,12*24*60);
	$("FavM").style.display='none';
}
function WEData_callback(){
	
	$("weather").innerHTML='<div class="weather-l" title="'+Weather[2][0]+' '+Weather[2][1]+' '+Weather[2][2]+'&#10;'+Weather[3][0]+' '+Weather[3][1]+' '+Weather[3][2]+'&#10;'+Weather[4][0]+' '+Weather[4][1]+' '+Weather[4][2]+'"><b><a target="_blank" href="'+weaurl+'/city/'+Weather[0]+'.htm">'+Weather[1]+'</a></b> <a href="javascript:"  onclick="setWeather(this,50,200)" target="_self">[设置]</a></div><div class="weather-i">'+Weather[2][4].replace('/m/i','http://www.2548.cn/m/i').replace('42x30','21x15')+'</div><div class="weather-c"><a  href="'+weaurl+'/city/'+Weather[0]+'.htm">今日： '+Weather[2][1]+' '+Weather[2][2]+' '+Weather[2][3]+'</a></div><div class="weather-i">'+Weather[3][3].replace('/m/i','http://www.2548.cn/m/i').replace('42x30','21x15')+'</div><div class="weather-c"><a  href="'+weaurl+'/city/'+Weather[0]+'.htm">明日： '+Weather[3][1]+' '+Weather[3][2]+' '+Weather[3][4]+'</a></div><div class="weather-r"><a  href="'+weaurl+'/city/'+Weather[0]+'.htm">[查看更多天气]</a></div>';
}
function closeWeanther(){var div=$("weather_win");div.style.display = 'none';}
function changeCity(p){var c_select=$("select_city");c_select.options.length = 1;	var city_list_len=City[p][1].length;for(i=0;i<city_list_len;i++){		c_select.options[i+1] = new Option();c_select.options[i+1].text =City[p][1][i][0];c_select.options[i+1].value=City[p][1][i][1];}}
function setCity(){var c_id=$("select_city").value;setcookie('CityId',c_id,12*24*60*265);	$("ifwea").src="/weather.html?tr="+Math.random();closeWeanther();}
function autoCity(){setcookie('CityId','',0);$("ifwea").src="/weather.html?tr="+Math.random();closeWeanther();}

