﻿// 作者：			李志平 
// 修改：	        
// 文件名：			MarqueeJS.js 
// 功能：			自定义事件，与页面相关的一些函数 
// 版本：			1.0.0 
// 最后修改时间：	    2010-06-06 

//<---操作提示滚动函数
var marqueeContent=new Array();
marqueeContent[0]="<span class=\'divbottom\'>向上滚动鼠标滚轮直接放大地图！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>向下滚动鼠标滚轮直接缩小地图！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>";
marqueeContent[1]="<span class=\'divbottom\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>拖动地图左上方滑动条的滑块直接放大缩小地图！</span>";
marqueeContent[2]="<span class=\'divbottom\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>点击滑动条头尾两端的按钮也可以放大缩小地图！</span>";
marqueeContent[3]="<span class=\'divbottom\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>在输入框中输入查询关键字直接回车键实现查询！</span>";
marqueeContent[4]="<span class=\'divbottom\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>点击清除查询结果和高亮显示按钮清除地图标注！</span>";
marqueeContent[5]="<span class=\'divbottom\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>在地图上双击鼠标左键将点击位置地图放大一倍！</span>";
var marqueeInterval=new Array();
var marqueeId=0;
var marqueeDelay=6000;
var marqueeHeight=25;
function initMarquee() {
	var str=marqueeContent[0];
	document.write('<div id="marqueeBox" style="padding-left:5px;margin-top:5px;border: 1px solid #c2daf3;overflow:hidden;width:285px;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');
	marqueeId++;
	marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {
	var str=marqueeContent[marqueeId];
	marqueeId++;
	if(marqueeId>=marqueeContent.length) marqueeId=0;
	if(document.getElementById("marqueeBox").childNodes.length==1) {
		var nextLine=document.createElement('DIV');
		nextLine.innerHTML=str;
		document.getElementById("marqueeBox").appendChild(nextLine);
	}
	else {
		document.getElementById("marqueeBox").childNodes[0].innerHTML=str;
		document.getElementById("marqueeBox").appendChild(document.getElementById("marqueeBox").childNodes[0]);
		document.getElementById("marqueeBox").scrollTop=0;
	}
	clearInterval(marqueeInterval[1]);
	marqueeInterval[1]=setInterval("scrollMarquee()",40);
}
function scrollMarquee() {
	document.getElementById("marqueeBox").scrollTop++;
	if(document.getElementById("marqueeBox").scrollTop%marqueeHeight==(marqueeHeight-1)){
		clearInterval(marqueeInterval[1]);
	}
}
//--------------->

