// JavaScript Document zzjs.net by sky
//转载请留此信息，www.zzjs.net 兼容性自己弄了好久，要不您试试看？
//转载请留此信息，www.zzjs.net,sky整理
var $w = window;
var $d = document;
var $l = location;
function $i(s){return $d.getElementById(s);}
function $t(s){return $d.getElementsByTagName(s);}
function $n(s){return $d.getElementsByName(s);}

var www_zzjs_net = {};

www_zzjs_net.client = (function(){	
	var t = {};
	var b = navigator.userAgent.toLowerCase();
	t.isOpera = (b.indexOf('opera') > -1);
	t.isIE = (!t.isOpera && b.indexOf('msie') > -1);
	t.isFF = (!t.isOpera &&!t.isIE&&b.indexOf('firefox') > -1);
	return t;
})();

www_zzjs_net.util = (function(){
	var t = {};
	t.addEvent = function(o,c,h){
		if(www_zzjs_net.client.isIE){
			o.attachEvent('on'+c,h);
		}else{
			o.addEventListener(c,h,false);
		}
		return true;
	};
	t.delEvent = function(o,c,h){
		if(www_zzjs_net.client.isIE){
			o.detachEvent('on'+c,h);
		}else{
			o.removeEventListener(c,h,false);
		}
		return true;
	};
	t.ga = function(o,s){
		return o.getAttribute(s);
	};
	t.sa = function(o,k,v){
		return o.setAttribute(k,v);
	};
	t.s2d = function(s){
		var sa = s.split('-');
		var d =  new Date(sa[0],(sa[1]-1),sa[2]);
		return d;
	};
	t.d2s = function(d,b){
		var ye = d.getFullYear();
		var me = (parseInt(d.getMonth())+1).toString()
		var de = d.getDate();
		if(me.length==1&&b)me='0'+me;
		if(de.length==1&&b)de='0'+de;
		return ye+me+de;
	};
	return t;
})();

www_zzjs_net.cookies = (function(){
	var t = {};
	t.setCookie = function(name,value,days)
	{
		if(days){
	  	var exp  = new Date(); 
	  	exp.setTime(exp.getTime() + days*24*60*60*1000);
	  	document.cookie = name + "="+ escape(value) +";expires="+ exp.toGMTString()+";path=/;";
		}else{
			document.cookie = name + "="+ escape(value)+";path=/;";
		}
	};
	
	t.getCookie = function(name)
	{
	  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	  if(arr != null) return unescape(arr[2]); return null;
	};
	
	t.setCookie2 = function(name,value,days)
	{
		if(days){
	  	var exp  = new Date(); 
	  	exp.setTime(exp.getTime() + days*24*60*60*1000);
	  	document.cookie = name + "="+ encodeURIComponent(value) +";expires="+ exp.toGMTString()+";path=/;";
		}else{
			document.cookie = name + "="+ encodeURIComponent(value)+";path=/;";
		}
	};
	
	t.getCookie2 = function(name)
	{
	  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	  if(arr != null) return decodeURIComponent(arr[2]); return null;
	};
	
	t.delCookie = function(name)
	{
	  var exp = new Date();
	  exp.setTime(exp.getTime() - 1);
	  var cval=getCookie(name);
	  if(cval!=null) document.cookie=name +"="+cval+";expires="+exp.toGMTString();
	};
	
	t.delCookie2 = function(name)
	{
	  var exp = new Date();
	  exp.setTime(exp.getTime() - 1);
	  var cval=getCookie2(name);
	  if(cval!=null) document.cookie=name +"="+cval+";expires="+exp.toGMTString();
	};
	
	return t;
})();

www_zzjs_net.jscload = (function(){
	var t = function(){
	    if(!www_zzjs_net.quickload){
    		var cs = $t('label');
    		for(var i=0;i<cs.length;i++){		
    			var ct = www_zzjs_net.util.ga(cs[i],'c_type');
    			if(ct){
    				var pe = www_zzjs_net.dom.gNxtSib(cs[i]);
    				if(pe){
    					eval("new "+ct+"(pe)");
    				}
    			}
    		}
		}
		if(typeof jsconload == 'function'){
			jsconload();
		}
		www_zzjs_net.loaded = true;
	};
	return t;
})();

www_zzjs_net.jscunload = (function(){
	var t = function(){
		if(true){
		    try{
				if(typeof jsconload == 'function'){
					jsconunload();
				}		                       		
            }catch(e){}
		}
	};
	return t;
})();

www_zzjs_net.init = (function(){
	www_zzjs_net.util.addEvent(window,'load',www_zzjs_net.jscload);
	www_zzjs_net.util.addEvent(window,'unload',www_zzjs_net.jscunload);
	return true;
})();

//哦啦啦 zzjs.net
var downMsg=function(msgid,contentid,config){
	this.msg = $i(msgid);
	this.content = $i(contentid);
	this.config = config ? config : {start_delay:3000, speed: 5, movepx:2,cookie:'downMsgcookie',expiresDay:0};
	this.offsetHeight;
	this.emsg_objTimer;
	this.ie6Add =0;
	var _this = this;
	
	this.init = function(){
		var ifcookie=www_zzjs_net.cookies.getCookie(this.config.cookie);
		if(ifcookie == "show")
			return;
		window.setTimeout(_this.start,parseInt(_this.config.start_delay,10));
	}
	
	this.start = function(){
		_this.msg.style.display="block";
		_this.content.style.display="block";
		_this.offsetHeight = _this.content.offsetHeight;
		_this.content.style.height ="0px";
		_this.emsg_objTimer = setInterval(_this.moveUpDiv,parseInt(_this.config.speed,10));
	}
	
	this.moveUpDiv = function(){
	  if(_this.offsetHeight> parseInt(_this.content.style.height,10)){
	  	_this.content.style.height =  parseInt(_this.content.style.height,10)+parseInt(_this.config.movepx,10)+"px";
	  }
	  else{
	  	window.clearInterval(_this.emsg_objTimer);
	  	www_zzjs_net.cookies.setCookie(_this.config.cookie,"show",_this.config.expiresDay);
	  	// ie6下才做，因为没有fixed属性
	  	var isMSIE = !!(/*@cc_on!@*/0);
		if(isMSIE &&!(window.XMLHttpRequest))
		{ 
	  	_this.content.style.height = parseInt(_this.content.style.height,10) +2+"px";
	  	_this.autoMoveIe6();
	  	}
	  }
	}
	this.autoMoveIe6 = function(){

		if(_this.ie6Add ==0){
			_this.content.style.height =  parseInt(_this.content.style.height,10) + 1 +"px";
			_this.msg.style.bottom="-2px";
			_this.ie6Add =1;
		}
		else{
			_this.content.style.height =  parseInt(_this.content.style.height,10) - 1 +"px";
			_this.msg.style.bottom="-1px";
			_this.ie6Add =0;
		}
		setTimeout(_this.autoMoveIe6,100)
	}
}

function closeDiv()
{
	document.getElementById('downmsg_emessage').style.display='none';
}

function showHideDiv()
{
	var ct = document.getElementById('donwmsg_content');
	var btn = document.getElementById('msg_hidden_btn');
	if(ct.style.display!="none"){
	  ct.style.display = "none"
	  btn.className="msg-hidden-btn-2";
	}else{
	  ct.style.display="block";
	  btn.className="msg-hidden-btn-1";
	}

}

//哈哈哈哈哈哈哈哈哈哈 zzjs.net

var start=new Date();
	start=Date.parse(start)/1000;
	var counts=30;
	function CountDown(){
		var now=new Date();
		now=Date.parse(now)/1000;
		var x=parseInt(counts-(now-start),10);
		if(x>0){
			window.setTimeout('CountDown()',300)
		}else{
			showHideDiv()
		}
	}
window.setTimeout('CountDown()',300);
//
function myurl(){
var url;
var mytitle;
url=document.location; 
mytitle = document.title;//标题 
if(mytitle == null){ 
    var t_titles = document.getElementByTagName("title") 
    if(t_titles && t_titles.length >0) 
    { 
       mytitle = t_titles[0]; 
    }else{ 
       kdocTitle = ""; 
    } 
}
websiteinfo=mytitle+'  '+url;
document.getElementById("_www_zzjs_net").value = websiteinfo;
}
//
function copy_clip(copy){
if (window.clipboardData){
window.clipboardData.setData("Text", copy);}
else if (window.netscape){
//sky于2009年12月31号修改。
	try{
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		}
		catch (e) {
        alert("您已经取消操作！\n或者此操作被浏览器拒绝！解决方法如下：\n在浏览器地址栏输入“about:config”后回车\n将signed.applets.codebase_principal_support的值设置为'true',双击改变。");
                  }
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip) return;
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) return;
trans.addDataFlavor('text/unicode');
var str = new Object();
var len = new Object();
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext=copy;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;
if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);}
alert("复制成功:"+copy)
return false;
}
//
function bookmark(){
var title=document.title
var url=document.location.href
if (window.sidebar) window.sidebar.addPanel(title, url,"");
else if( window.opera && window.print ){
var mbm = document.createElement('a');
mbm.setAttribute('rel','sidebar');
mbm.setAttribute('href',url);
mbm.setAttribute('title',title);
mbm.click();}
else if( document.all ) window.external.AddFavorite( url, title);
}
//
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl='http://www.zzjs.net/');
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                        }
                        catch (e) {
                                alert("您已经取消操作！\n或者此操作被浏览器拒绝！解决方法如下：\n在浏览器地址栏输入“about:config”后回车\n将signed.applets.codebase_principal_support的值设置为'true',双击改变。");
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
}


//www.zzjs.net
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("zzjs_1").style.top=parseInt(document.getElementById
 
("zzjs_1").style.top)+percent+"px";
document.getElementById("zzjs_2").style.top=parseInt(document.getElementById
 
("zzjs_1").style.top)+percent+"px";
 
lastScrollY=lastScrollY+percent; 
//alert(lastScrollY);
}
/*suspendcode12="<DIV id=\"zzjs_1\" style='left:0;POSITION:absolute;TOP:200px;width:19px;height:200px;background:#00CCFF;font-size:18px;'><a href='http://www.zzjs.net/'>新的一年有新的开始</a></div>"
suspendcode14="<DIV id=\"zzjs_2\" style='right:0;POSITION:absolute;TOP:200px;width:19px;height:200px;background:#00CCFF;font-size:18px;'><a href='http://www.zzjs.net/'>用我的方式创造神话</a></div>"
document.write(suspendcode12); 
document.write(suspendcode14); 
window.setInterval("heartBeat()",1);*/
//弹窗广告
document.write("<div id='downmsg_emessage' style='display:none'>")
document.write("<div id='downmsgBar'>")
document.write("<div id='donwmsg_head'>进站必读</div>")
document.write("<a href='javascript:closeDiv()' class='close'></a>")
document.write("<a href='javascript:showHideDiv()'  class='msg-hidden-btn-1' id='msg_hidden_btn'>&nbsp;</a>")
document.write("</div>")
document.write("<div id='donwmsg_content'>")
document.write("<ul>")
document.write("<li class='ll'><a href='http://www.oogps.com/post/20100119690.html' target='_blank'>快速找地图程序和了解本站！</a></li>")
document.write("<li><a href='http://www.oogps.com/post/20100119127.html' target='_blank'>地图下载不了？</a></li>")
document.write("<li><a href='http://www.oogps.com/post/20090110324..html' target='_blank'>本站专用Wince模拟器5.0下载！</a></li>")
document.write("<li ><a href='http://www.oogps.com/post/20100119127.html'  target='_blank'>新手折腾地图快速上手手册！</a></li>")
document.write("<li class='ll'><a href='http://www.oogps.com/post/20100118574.html' target='_blank'>本站地图全面测试，放心下载！</a></li>")
document.write("</ul>")
document.write("<div class='lb'>")
document.write("<a href='http://www.oogps.com/post/20100109997.html'>QQ高级群：57529846</a>")
document.write("</div>")
document.write("</div>")
document.write("</div>")