window.g_width=500;
window.g_height=250;
window.$ = function(obj){return (document.getElementById)?document.getElementById(obj):(document.all)?document.all[obj]:obj}
window.isIE = window.Event?false:true;
window.getMouseCoords=function(e){return {x:isIE?e.clientX+Math.max(document.body.scrollLeft, document.documentElement.scrollLeft):e.pageX,		y:isIE?e.clientY+Math.max(document.body.scrollTop, document.documentElement.scrollTop):e.pageY};}
window.vWinZIndex = 1;
var iImgShowWidth,iImgShowHeight;
iImgShowWidth=88;
iImgShowHeight=90;

function getOffset(evt)
{
  var target = evt.target;
  if (target.offsetLeft == undefined)
  {
    target = target.parentNode;
  }
  var pageCoord = getPageCoord(target);
  var eventCoord =
  { 
    x: window.pageXOffset + evt.clientX,
    y: window.pageYOffset + evt.clientY
  };
  var offset =
  {
    offsetX: eventCoord.x - pageCoord.x,
    offsetY: eventCoord.y - pageCoord.y
  };
  return offset;
}

function getPageCoord(element)
{
  var coord = {x: 0, y: 0};
  while (element)
  {
    coord.x += element.offsetLeft;
    coord.y += element.offsetTop;
    element = element.offsetParent;
  }
  return coord;
}

function getEventOffset(evt)
{
  var msg = "";
  if (evt.offsetX == undefined)
  {
    var evtOffsets = getOffset(evt);
    msg += "offsetX: " + evtOffsets.offsetX + "; ";
    msg += "offsetY: " + evtOffsets.offsetY + "; ";
  }
  else
  {
    msg += "offsetX: " + evt.offsetX + "; ";
    msg += "offsetY: " + evt.offsetY + "; ";
  }
  alert(msg);
  return msg;
}

function showImgInit(o,oShowImg,intW,intH){
	o.style.zIndex = window.vWinZIndex;
	window.vWinZIndex++;
	//alert(o.innerHTML);
	//alert(o.getElementsByTagName("LI").length);
	var lis = o.getElementsByTagName("LI");
  for (var i=0; i<lis.length; i++) {
  //alert(lis[i].innerHTML);
	lis[i].onmouseover=function(a) {
  //return;
	//alert("1");
		if(!a)a=window.event;
		var mus=getMouseCoords(a)
		if(!a.pageX)a.pageX=mus.x;
		if(!a.pageY)a.pageY=mus.y;
		//var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
		 if (a.offsetX == undefined)
    {
      var evtOffsets = getOffset(a);
	    x= evtOffsets.offsetX;
      y= evtOffsets.offsetY;
      //msg += "offsetX: " + evtOffsets.offsetX + "; ";
      //msg += "offsetY: " + evtOffsets.offsetY + "; ";
    }
    else
    {
      x= a.offsetX;
      y= a.offsetY;
    }
  var tx=a.pageX,ty=a.pageY;

				if (tx >=812)
				{
					oShowImg.style.left=(tx-x-intW)+"px";
				}
				else{
					oShowImg.style.left=(tx-x)+"px";
				}
				if (ty >=1730)
				{
					oShowImg.style.top=(ty-y-intH)+"px";
				}
				else{
					oShowImg.style.top=(ty-y)+"px";
				}

				//alert(this.getAttribute("imgShow"));
				//oShowImg.firstChild.setAttribute("src",this.getAttribute("imgShow"));
				//$("imgShowInner")=
				$("imgShowInner").src=this.getAttribute("imgShow");
				var url=this.getAttribute("value");
				$("imgShowInner").onclick=function(){
					document.location=url;

				}
				try{oShowImg.style.display="block"}catch(e){};
			}
			lis[i].onclick=function(a) {
			//return;
					if(!a)a=window.event;
					var mus=getMouseCoords(a)
					if(!a.pageX)a.pageX=mus.x;
					if(!a.pageY)a.pageY=mus.y;
					var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;

					var tx=a.pageX,ty=a.pageY;
					alert((tx)+","+(ty));
					alert((x)+","+(y));
			}
		 }

	oShowImg.onmouseout=function() {
		//alert("1");
		try{oShowImg.style.display="none"}catch(e){};
	}
}

function showImgInit_xiha(o,oShowImg,intW,intH){
	o.style.zIndex = window.vWinZIndex;
	window.vWinZIndex++;
	//alert(o.innerHTML);
	//alert(o.getElementsByTagName("LI").length);
	var lis = o.getElementsByTagName("LI");

		  for (var i=0; i<lis.length; i++) {
		  //alert(lis[i].innerHTML);
			lis[i].onmouseover=function(a) {
		  //return;
			//alert("1");
				if(!a)a=window.event;
				var mus=getMouseCoords(a)
				if(!a.pageX)a.pageX=mus.x;
				if(!a.pageY)a.pageY=mus.y;
				//var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
				
				 if (a.offsetX == undefined)
  {
    var evtOffsets = getOffset(a);
	    x= evtOffsets.offsetX;
    y= evtOffsets.offsetY;
    //msg += "offsetX: " + evtOffsets.offsetX + "; ";
    //msg += "offsetY: " + evtOffsets.offsetY + "; ";
  }
  else
  {
    x= a.offsetX;
    y= a.offsetY;
  }
				var tx=a.pageX,ty=a.pageY;

				if (tx >=812)
				{
					oShowImg.style.left=(tx-x-intW)+"px";
				}
				else{
					oShowImg.style.left=(tx-x)+"px";
				}
				if (ty >=1058)
				{
					oShowImg.style.top=(ty-y-intH)+"px";
				}
				else{
					oShowImg.style.top=(ty-y)+"px";
				}

				//alert(this.getAttribute("imgShow"));
				//oShowImg.firstChild.setAttribute("src",this.getAttribute("imgShow"));
				//$("imgShowInner")=
				$("imgShowInner").src=this.getAttribute("imgShow");
				var url=this.getAttribute("value");
				$("imgShowInner").onclick=function(){
					document.location=url;

				}
				try{oShowImg.style.display="block"}catch(e){};
			}
			lis[i].onclick=function(a) {
			//return;
					if(!a)a=window.event;
					var mus=getMouseCoords(a)
					if(!a.pageX)a.pageX=mus.x;
					if(!a.pageY)a.pageY=mus.y;
					var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;

					var tx=a.pageX,ty=a.pageY;
					alert((tx)+","+(ty));
					alert((x)+","+(y));
			}
		 }

	oShowImg.onmouseout=function() {
		//alert("1");
		try{oShowImg.style.display="none"}catch(e){};
	}
}

function showImgInit_yedian(o,oShowImg,intW,intH){
	o.style.zIndex = window.vWinZIndex;
	window.vWinZIndex++;
	//alert(o.innerHTML);
	//alert(o.getElementsByTagName("LI").length);
	var lis = o.getElementsByTagName("LI");

		  for (var i=0; i<lis.length; i++) {
		  //alert(lis[i].innerHTML);
			lis[i].onmouseover=function(a) {
		  //return;
			//alert("1");
				if(!a)a=window.event;
				var mus=getMouseCoords(a)
				if(!a.pageX)a.pageX=mus.x;
				if(!a.pageY)a.pageY=mus.y;
				//var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
				
				 if (a.offsetX == undefined)
  {
    var evtOffsets = getOffset(a);
	    x= evtOffsets.offsetX;
    y= evtOffsets.offsetY;
    //msg += "offsetX: " + evtOffsets.offsetX + "; ";
    //msg += "offsetY: " + evtOffsets.offsetY + "; ";
  }
  else
  {
    x= a.offsetX;
    y= a.offsetY;
  }



				var tx=a.pageX,ty=a.pageY;

				if (tx >=815-5)
				{
					oShowImg.style.left=(tx-x-intW)+"px";
				}
				else{
					oShowImg.style.left=(tx-x)+"px";
				}
				if (ty >=1496-5)
				{
					oShowImg.style.top=(ty-y-intH)+"px";
				}
				else{
					oShowImg.style.top=(ty-y)+"px";
				}

				//alert(this.getAttribute("imgShow"));
				//oShowImg.firstChild.setAttribute("src",this.getAttribute("imgShow"));
				//$("imgShowInner")=
				$("imgShowInner").src=this.getAttribute("imgShow");
				var url=this.getAttribute("value");
				$("imgShowInner").onclick=function(){
					document.location=url;

				}
				try{oShowImg.style.display="block"}catch(e){};
			}
			lis[i].onclick=function(a) {
			//return;
					if(!a)a=window.event;
					var mus=getMouseCoords(a)
					if(!a.pageX)a.pageX=mus.x;
					if(!a.pageY)a.pageY=mus.y;
					var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;

					var tx=a.pageX,ty=a.pageY;
					alert((tx)+","+(ty));
					alert((x)+","+(y));
			}
		 }

	oShowImg.onmouseout=function() {
		//alert("1");
		try{oShowImg.style.display="none"}catch(e){};
	}
}
function showSongInit(o){
	
	var lis = o.getElementsByTagName("span");
		  for (var i=0; i<lis.length; i++) {
			
			
			lis[i].onclick=function() {
				var str;
				str=this.childNodes[0].src;
				if (str.search(/dcj_li01/)>0)
				{
					this.childNodes[0].src=str.replace("dcj_li01","dcj_li02");
					this.setAttribute("songFlag","1");
					//alert(this.getAttribute("songFlag"));
				}
				else{
					this.childNodes[0].src=str.replace("dcj_li02","dcj_li01");
					this.setAttribute("songFlag","0");
					//alert(this.getAttribute("songFlag"));
				}
			}
		 }

}
function songListChangeInit(btnStr,divStr){

					$(btnStr+"1").onclick=function() {
						//alert("0")
						showSongChange(divStr,1)
					}
					$(btnStr+"2").onclick=function() {
						//alert("0")
						showSongChange(divStr,2)
					}
					$(btnStr+"3").onclick=function() {
						//alert("0")
						showSongChange(divStr,3)
					}

}
function CommomChangeInit(o,oDiv){
	o.childNodes[0].onclick=function() {
						CommonDivChange(oDiv,0)
					}
	var lis = o.childNodes[1].getElementsByTagName("img");

		  for (var i=0; i<lis.length; i++) {
			
				if(i==0){
					lis[i].onclick=function() {
						//alert("0")
						//showSongChange(o1,o2,o3,o2)
						CommonDivChange(oDiv,1)
					}
				}
			
				if(i==2){
					lis[i].onclick=function() {
						
						//alert("2")
						//showSongChange(o1,o2,o3,o3)
						CommonDivChange(oDiv,2)
					}
				}
				//alert("Left:"+event.clientY+",Top:"+this.clientX);
		}
		 

}
function showSongChange(obj,num){
	

 for(var id = 1;id<=3;id++)
 {
  var ss=obj+id;
  if(id==num){
  try{document.getElementById(ss).style.display="block"}catch(e){};
  }else{
  try{document.getElementById(ss).style.display="none"}catch(e){};
  }
 } 
}
function CommonDivChange(o,i){
	
 //for(var id = 1;id<=len;id++)
 ////{
  //var ss=obj+id;
 // if(id==num){
 // try{document.getElementById(ss).style.display="block"}catch(e){};
 /// }else{
 // try{document.getElementById(ss).style.display="none"}catch(e){};
 // }
 //}  
	
	//try{o.childNodes[0].style.display="none"}catch(e){};	
	//try{o.childNodes[1].style.display="none"}catch(e){};	
	//try{o.childNodes[2].style.display="none"}catch(e){};	
	//try{o.childNodes[i].style.display="block"}catch(e){};
	o.childNodes[i].style.display="";
	o.childNodes[0].style.display="none";
	o.childNodes[1].style.display="none";
	o.childNodes[2].style.display="none";
}

function myParaLoadPlayerMovies(h,o,urlPara,PlayID) {
	o.style.display="block";
	o.style.top=h+150+"px";
	var s1 = new SWFObject("../js/flvplayer.swf","single",window.g_width,window.g_height,"7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("file",urlPara);
	s1.addVariable("displayheight",window.g_height);
	s1.addVariable("displaywidth",window.g_width);
	//s1.addVariable("image","preview.jpg");
	s1.addVariable("image","http://www.a2mrocks.com/photos/Human Error EP Logo.jpg");
	s1.addVariable("autostart","true");
	s1.write(PlayID);
}
var w3c=(document.getElementById)? true: false;
var agt=navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));

function IeTrueBody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function GetScrollTop(){
return ie ? IeTrueBody().scrollTop : window.pageYOffset;
}

function playMovie(sPlay,sPlaying,strMovie){
	//alert("1");
	//oBtn.onclick=function(a) {
		var oDest;
		
		//alert(sList);
		var MyScrollHeight=GetScrollTop();
	//if(!window.isIE) {
			//sPlay+="_firefox";
	//}
		//alert(oPlay.innerHTML);
		$(sPlay).style.top=(MyScrollHeight+200)+"px";
		$(sPlay).style.visibility="visible";
    LoadPlayerMoviesCommon(strMovie,424,167,424,sPlaying)
		//alert(Math.max(document.body.scrollTop, document.documentElement.scrollTop));
//var MyScrollHeight=Math.max(document.body.scrollTop, document.documentElement.scrollTop);

		
		//myParaLoadPlayerMovies(MyScrollHeight,$('SongPlayFrm'),'http://www.jeroenwijering.com/upload/mediaplayer.xml',"SongPlayFrmInner");
	///}
}
function playSong(o1,o2,o3,oBtn,sPlay,sPlaying){
	//alert("1");
	oBtn.onclick=function(a) {
		var oDest;
		if (o1.style.display=="block"){
			oDest=o1;
			//alert("1");
		}else if(o2.style.display=="block"){
			oDest=o2;
			//alert("2");
		}else{
			oDest=o3;
			//alert("3");
		}
			//alert(oDest.innerHTML);
		var lis = oDest.getElementsByTagName("span");
		var sList="";
		for (var i=0; i<lis.length; i++) {
			if(lis[i].getAttribute("songFlag")=="1"){
				sList+=lis[i].getAttribute("songId")+","
			}
		}
		//alert(sList);
		var MyScrollHeight=GetScrollTop();
	//if(!window.isIE) {
			//sPlay+="_firefox";
	//}
		//alert(oPlay.innerHTML);
		$(sPlay).style.top=(MyScrollHeight+200)+"px";
		$(sPlay).style.visibility="visible";
    LoadPlayerMoviesCommon('../flv/mediaplayer.xml',424,167,424/3+30,sPlaying)
		//alert(Math.max(document.body.scrollTop, document.documentElement.scrollTop));
//var MyScrollHeight=Math.max(document.body.scrollTop, document.documentElement.scrollTop);

		
		//myParaLoadPlayerMovies(MyScrollHeight,$('SongPlayFrm'),'http://www.jeroenwijering.com/upload/mediaplayer.xml',"SongPlayFrmInner");
	}
}
function playSingleSong(sPlay,sPlaying,str){
	//alert("1");
	//oBtn.onclick=function(a) {
		//
		//alert(sList);
		var MyScrollHeight=GetScrollTop();
	//if(!window.isIE) {
			//sPlay+="_firefox";
	//}
		//alert(oPlay.innerHTML);
		$(sPlay).style.top=(MyScrollHeight+200)+"px";
		$(sPlay).style.visibility="visible";
    LoadPlayerMoviesCommon(str,424,167,424/3+30,sPlaying)
		//alert(Math.max(document.body.scrollTop, document.documentElement.scrollTop));
//var MyScrollHeight=Math.max(document.body.scrollTop, document.documentElement.scrollTop);

		
		//myParaLoadPlayerMovies(MyScrollHeight,$('SongPlayFrm'),'http://www.jeroenwijering.com/upload/mediaplayer.xml',"SongPlayFrmInner");
	//}
}
function playSong_xiha(o,oBtn){
	//alert("1");
	oBtn.onclick=function(a) {
		var oDest=o;
		var lis = oDest.getElementsByTagName("span");
		var sList="";
		for (var i=0; i<lis.length; i++) {
			if(lis[i].getAttribute("songFlag")=="1"){
				sList+=lis[i].getAttribute("songId")+","
			}
		}
		alert(sList);
		//alert(Math.max(document.body.scrollTop, document.documentElement.scrollTop));
//var MyScrollHeight=Math.max(document.body.scrollTop, document.documentElement.scrollTop);

		//svar MyScrollHeight=GetScrollTop();
		//myParaLoadPlayerMovies(MyScrollHeight,$('SongPlayFrm'),'http://www.jeroenwijering.com/upload/mediaplayer.xml',"SongPlayFrmInner");
	}
}
function LoadPlayerMovies(urlPara) {
	//alert("1");
	var iWidth=433,iHeight=272;
	var s1 = new SWFObject("../js/flvplayer.swf","single",iWidth,iHeight,"7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("file",urlPara);
	s1.addVariable("displayheight",iHeight);
	s1.addVariable("displaywidth",iWidth);
	//s1.addVariable("image","preview.jpg");
	s1.addVariable("image","../images/index/top_shipin1.jpg");
	s1.addVariable("autostart","true");
	s1.write("player");
}

function LoadPlayerMoviesXiha(urlPara,w,h) {
	//alert("1");
	var iWidth=w,iHeight=h;
	var s1 = new SWFObject("../js/flvplayer.swf","single",iWidth,iHeight,"7");
	s1.addParam("allowfullscreen","true");
	s1.addParam("wmode","transparent");
	s1.addVariable("file",urlPara);
	s1.addVariable("displayheight",iHeight);
	s1.addVariable("displaywidth",iWidth);
	//s1.addVariable("image","preview.jpg");
	s1.addVariable("image","../images/index/top_shipin1.jpg");
	s1.addVariable("autostart","true");
	s1.write("player");
}
function LoadPlayerMoviesCommon(urlPara,w,h,wDisplay,str) {
	//alert("1");
	var iWidth=w,iHeight=h;
	var s1 = new SWFObject("../js/flvplayer.swf","single",iWidth,iHeight,"7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("file",urlPara);
	//s1.addVariable("displayheight",iHeight);
	s1.addVariable("displaywidth",wDisplay);
	s1.addVariable("displaywidth",wDisplay);
	s1.addVariable('backcolor','0xCCCCCC'); 
	//s1.addVariable("image","preview.jpg");
	s1.addVariable("image","../images/index/top_shipin1.jpg");
	s1.addVariable("autostart","true");
	//alert(str);
	s1.write(str);
}



function myParaLoadPlayer(o,urlPara) {
	o.style.display="block";
	var s1 = new SWFObject("../js/flvplayer.swf","single",window.g_width,window.g_height,"7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("file",urlPara);
	s1.addVariable("displayheight",window.g_height);
	s1.addVariable("displaywidth",window.g_width/2);
	s1.addVariable("autostart","true");
	s1.write("player");
}
																		
//function playSong(o,oPlay,url){
	//if(isChecked(o)    ){
	//	myParaLoadPlayer(oPlay,url);
	//}else{
	//	alert('');
	//}
//}


function vDrag(o,ho,initArr){
	ho=ho||o;
	o.style.position="absolute";
	if(!isIE){ho.firstChild.onmousedown=function(){return false;}}	
	ho.onmousedown=function(a){
		o.style.zIndex = window.vWinZIndex;
		window.vWinZIndex++;
		var d=document;if(!a)a=window.event;
		var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
		if(ho.setCapture)
			ho.setCapture();
		else if(window.captureEvents)
			window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
		d.onmousemove=function(a){
			if(!a)a=window.event;
			var mus=getMouseCoords(a)
			if(!a.pageX)a.pageX=mus.x;
			if(!a.pageY)a.pageY=mus.y;
			var tx=a.pageX-x,ty=a.pageY-y;
			if(initArr){
				o.style.left=(tx<initArr[0]?initArr[0]:tx>initArr[2]?initArr[2]:tx)+"px";
				o.style.top=(ty<initArr[1]?initArr[1]:ty>initArr[3]?initArr[3]:ty)+"px";
			}else{
				o.style.left = tx+"px";
				o.style.top = ty+"px";
			}
		};
		d.onmouseup=function(){
			if(ho.releaseCapture)
				ho.releaseCapture();
			else if(window.captureEvents)
				window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			d.onmousemove=null;
			d.onmouseup=null;
		};
	};
}
function SongMoveWindow(o){
	
	//o.style.display="none";
	//alert(o.innerHTML);
	o.style.zIndex = window.vWinZIndex;
	window.vWinZIndex++;
	var winTitle = o.childNodes[0].childNodes[0];
	//alert(o+winSelf.offsetWidth+"----"+winContent.offsetWidth);
	{
		vDrag(o,winTitle);
	}
}

function title_video_box_listinit(sTitle,sBody){

		var obj=sTitle;
		for(var id = 1;id<=15;id++)
		 {
			var ss=$(obj+id);
		  
			
			ss.onclick=function(a){
				//alert(ss1.innerHTML);
				//return;
				var ss1=$(sBody+id);
				if(ss1.style.display=="none"){
					try{ss1.style.display="block"}catch(e){};
				}else{
					try{ss1.style.display="none"}catch(e){};
				}
			}
		 } 
	
}

function move(sPlay,o,initArr){
	
	o.style.zIndex = window.vWinZIndex;
	window.vWinZIndex++;
	var ho=o;
	o.style.position="absolute";
	
	//alert(o.offsetHeight)
	
	//alert(o.offsetWidth)
	//$("play123").width=o.offsetWidth;
	ho.onmousedown=function(a){
		//o.style.zIndex = window.vWinZIndex;
		//window.vWinZIndex++;
		var d=document;if(!a)a=window.event;
		var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
		//alert(x);return;
		if(x>419 && x<433 && y<30){
			//o.style.display = "none";
			
			o.style.visibility="hidden";
			$(sPlay).innerHTML="&nbsp;";
			return;
		}
		if(y>30){return;}
		
		
		if(ho.setCapture)
			ho.setCapture();
		else if(window.captureEvents)
			window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			
		
		
		d.onmousemove=function(a){
			if(!a)a=window.event;
			var mus=getMouseCoords(a)
			if(!a.pageX)a.pageX=mus.x;
			if(!a.pageY)a.pageY=mus.y;
			var tx=a.pageX-x,ty=a.pageY-y;
			if(initArr){
				o.style.left=(tx<initArr[0]?initArr[0]:tx>initArr[2]?initArr[2]:tx)+"px";
				o.style.top=(ty<initArr[1]?initArr[1]:ty>initArr[3]?initArr[3]:ty)+"px";
			}else{
				o.style.left = tx+"px";
				o.style.top = ty+"px";
			}
		};
		d.onmouseup=function(){
			if(ho.releaseCapture)
				ho.releaseCapture();
			else if(window.captureEvents)
				window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			d.onmousemove=null;
			d.onmouseup=null;
		};
	};
}
window.i=0;




function movedrag(o,initArr,iOffsetX,iLength){
	
	o.style.zIndex = window.vWinZIndex;
	window.vWinZIndex++;
	var ho=o;
	o.style.position="absolute";
	var iPosition;
	ho.onmousedown=function(a){
		var d=document;if(!a)a=window.event;
		var x1=a.layerX?a.layerX:a.offsetX,y1=a.layerY?a.layerY:a.offsetY;
		//alert(x1);return;
			var mus=getMouseCoords(a);
			x=mus.x;
			y=mus.y;
			
		
		
		if(ho.setCapture)
			ho.setCapture();
		else if(window.captureEvents)
			window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			
		
		
		d.onmousemove=function(a){
			//alert("1");
			if(!a)a=window.event;
			var mus=getMouseCoords(a);
			if(!a.pageX)a.pageX=mus.x;
			if(!a.pageY)a.pageY=mus.y;
			var tx=(a.pageX-x),ty=a.pageY-y;
			if(false){
				o.style.left=(tx<initArr[0]?initArr[0]:tx>initArr[2]?initArr[2]:tx)+"px";
				//o.style.top=(ty<initArr[1]?initArr[1]:ty>initArr[3]?initArr[3]:ty)+"px";
			}else{
				//var m=parseInt(o.style.left)；
				//if(m>0&&m<15){
					//if(i<2){
						//i++;
					
					if((parseInt(o.style.left)+tx)<initArr[0] ) return;
					if((parseInt(o.style.left)+tx)>initArr[1]) return;
					o.style.left = parseInt(o.style.left)+tx+"px";
					x=a.pageX;
					
					//if(window.i%3==0){
						//window.i++;
						var iTemp=iLength;
						var w=parseInt(o.style.left);
						var iii=Math.round(((w-iOffsetX)*iTemp)/(135));
						if (iii<=0)
						{
							iii=1;
						}
						if (iii>=iTemp)
						{
							iii=iTemp;
						}

						$("dragvalue").innerHTML=iii;
						iPosition=iii;
					//
				//}
				//o.style.top = ty+"px";
			}
		};
		d.onmouseup=function(){
			listHidden(iPosition,iLength,"btn_video_box","video_box");
			if(ho.releaseCapture)
				ho.releaseCapture();
			else if(window.captureEvents)
				window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			d.onmousemove=null;
			d.onmouseup=null;
		};
	};
}

function fDragDropBtn(strDragDropBtn,strDragDropState,initArr,iOffsetX,iLength,f){
	var o=$(strDragDropBtn);
	o.style.zIndex = window.vWinZIndex;
	window.vWinZIndex++;
	var ho=o;
	o.style.position="absolute";
	var iPosition;
	ho.onmousedown=function(a){
		var d=document;if(!a)a=window.event;
		var x1=a.layerX?a.layerX:a.offsetX,y1=a.layerY?a.layerY:a.offsetY;
		var mus=getMouseCoords(a);
		x=mus.x;
		y=mus.y;
		if(ho.setCapture)
			ho.setCapture();
		else if(window.captureEvents)
			window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
		
		d.onmousemove=function(a){
			if(!a)a=window.event;
			var mus=getMouseCoords(a);
			if(!a.pageX)a.pageX=mus.x;
			if(!a.pageY)a.pageY=mus.y;
			var tx=(a.pageX-x),ty=a.pageY-y;
					
			if((parseInt(o.style.left)+tx)<initArr[0] ) return;
			if((parseInt(o.style.left)+tx)>initArr[1]) return;
			o.style.left = parseInt(o.style.left)+tx+"px";
			x=a.pageX;
			var iTemp=iLength;
			var w=parseInt(o.style.left);
			var iii=Math.round(((w-iOffsetX)*iTemp)/(135));
			if (iii<=0)
			{
				iii=1;
			}
			if (iii>=iTemp)
			{
				iii=iTemp;
			}

			$(strDragDropState).innerHTML=iii;
			iPosition=iii;
		};
		d.onmouseup=function(){
			f(iPosition,iLength);
			if(ho.releaseCapture)
				ho.releaseCapture();
			else if(window.captureEvents)
				window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			d.onmousemove=null;
			d.onmouseup=null;
		};
	};
}
function changepage(btnStr,divStr1,divStr2){

					$(btnStr+"1").onclick=function() {
						$(divStr1).style.display="none";
						$(divStr2).style.display="none";
						$(divStr1).style.display="block";
					}
					$(btnStr+"2").onclick=function() {
						$(divStr1).style.display="none";
						$(divStr2).style.display="none";
						$(divStr2).style.display="block";
					}

}

var i=0;


function moveMovieChild(str){
	var t=parseInt($("MoveMovie").style.left);
	if( step<0 && t<14){
		$("MoveMovie").style.left=(t-step)+"px";
	}
	if(step>0 && t>g_iMovieLeft+10){
		$("MoveMovie").style.left=(t-step)+"px";
	}
}
function moveMovie(str){
	$("l"+str).onmousemove=function(){
		step=2;
		if(lTimer<0){
			lTimer= setInterval("moveMovieChild('"+str+"' );",50);  //1秒执行一次
		}
		//alert(lTimer);
		//this.style.backgroundColor="red";
	}

	$("l"+str).onmouseout=function(){
		step=0;
		//this.style.backgroundColor="gray";
	}
//alert(ii);
	$("r"+str).onmousemove=function(){
		//alert(parseInt($(str).style.left));

		//$(str).style.left=(parseInt($(str).style.left)-1)+"px";
		step=-2;
		if(lTimer<0){
			lTimer= setInterval("moveMovieChild();",50);  //1秒执行一次
		}
		//alert(lTimer);
		//this.style.backgroundColor="red";
	}

	$("r"+str).onmouseout=function(){
		 
		step=0;
		
		//this.style.backgroundColor="gray";
	}

	$("r"+str).onclick=function(){
		 
		//alert(g_iMovieLeft);
	}
}



////////////////   moviemove  start
var lTimer=-1;
var step=0;
function fMovieLength(idStr,iPaddingRight,iLength){

	var imgs = $(idStr).getElementsByTagName("img");
		var iTemp=0;
		for (var i=0; i<imgs.length; i++) {
				iTemp+=parseInt(imgs[i].getAttribute("width"))+iPaddingRight;
		}
	return iTemp;
}
function fMoveMovieChild(str,iPaddingLeft,iPaddingRight,iLength){
	var t=parseInt($("MoveMovie").style.left);
	
	if( step>0 && t<iPaddingLeft){
		$("MoveMovie").style.left=(t+step)+"px";
	}
	if(step<0 && t>((-1)*iLength+iPaddingRight)){
		$("MoveMovie").style.left=(t+step)+"px";
	}
}
function fMoveMovieMain(str,iPaddingLeft,iPaddingRight,iLength){
	$("l"+str).onmousemove=function(){
		step=-2;
		if(lTimer<0){
lTimer= setInterval("fMoveMovieChild('"+str+"' ,"+iPaddingLeft+","+iPaddingRight+","+iLength+" );",50);  //1秒执行一次
		}
		//this.style.backgroundColor="red";
	}

	$("l"+str).onmouseout=function(){
		step=0;
		//this.style.backgroundColor="gray";
	}
//alert(ii);
	$("r"+str).onmousemove=function(){
		//alert(parseInt($(str).style.left));

		//$(str).style.left=(parseInt($(str).style.left)-1)+"px";
		step=2;
		if(lTimer<0){
lTimer= setInterval("fMoveMovieChild('"+str+"' ,"+iPaddingLeft+","+iPaddingRight+" );",50);  //1秒执行一次
		}
		//alert(lTimer);
		//this.style.backgroundColor="red";
	}

	$("r"+str).onmouseout=function(){
		 
		step=0;
		
		//this.style.backgroundColor="gray";
	}
}
////////////////   moviemove  end



function fCalculationMovieLength(idStr,imgPadingRight,iMovieScreem,iMovieScreemPadding){

	var imgs = $(idStr).getElementsByTagName("img");
		var iTemp=0;
		for (var i=0; i<imgs.length; i++) {
				iTemp+=parseInt(imgs[i].getAttribute("width"))+imgPadingRight;
				//alert(iTemp);
		}
	return iTemp+iMovieScreemPadding-iMovieScreem;
}




function fDragDropInit(strDragDropBtn,strDragDropState,iLength,fCallback){
	//alert(iLength);
	$(strDragDropState).innerHTML=iLength;
	var aRang= new Array();
	var iOffset=15;
	aRang[0]=0;
	aRang[1]=135;
    if(window.isIE) {
		$(strDragDropBtn).style.left=aRang[1]+"px";
		iOffset=0;
	}else{
		iOffset=18;
		aRang[0]=aRang[0]+iOffset;
		aRang[1]=aRang[1]+iOffset;
		$(strDragDropBtn).style.left=aRang[1]+"px";
	}
	fDragDropBtn(strDragDropBtn,strDragDropState,aRang,iOffset,iLength,fCallback)
}




function fGetChildsCount(o){
	//alert(o.innerHTML);
    var ilength=o.childNodes.length;
	if(!document.all) {
		ilength-=1;
		ilength/=2;
	}
	ilength=Math.round(ilength);
	return ilength;
}

function fClickMoveDragDropBtn(strDragDropBtnID,strDragDropStateID,iDivCount){
	if(document.all){
		var oBtn=$(strDragDropBtnID);
		var iBtnCurrent=parseInt(oBtn.style.left);
		var iCursorCurrent=parseInt(event.offsetX);
		var iDiv=iDivCount;

		var iDragDropState=parseInt($(strDragDropStateID).innerHTML);
		if(iCursorCurrent<iBtnCurrent){
			if(iDragDropState<=1) {return 1;}
			iBtnCurrent-=135/iDiv;
			var icount=(iDragDropState-1);
			oBtn.style.left=iBtnCurrent+"px";
			$(strDragDropStateID).innerHTML=icount;
			return icount;
		}else{
		if(iDragDropState>=iDiv)  return iDiv;

			iBtnCurrent+=135/iDiv;
			var icount=(iDragDropState+1);
			oBtn.style.left=iBtnCurrent+"px";
			$(strDragDropStateID).innerHTML=icount;
			return icount;
		}
	}
}
function fLayerChange(strLayer,iCurrent,iCount){
	for( var i=1;i<=iCount;i++){
		$(strLayer+i).style.display="none";
	}
	$(strLayer+iCurrent).style.display="block";
}




//common drag drop function
/*

		<div id="debug" style="position:absolute; width:300px; height:200px; overflow:hidden; right: 0px; bottom: 0px;">
	
			<div  id="debug_BackgroundID" style="width:12px;height:28px;background-color:white;position:absolute;left:12px;top: 28px;"></div>
	
			<div id="debug_Body" style="padding:0 0 0px 0px;width:287px;position:absolute;left:12px;top: 28px;">
		<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"  style="background-color:#FFFFFF">
      		<tr>
        <td width="63%" class="td_xian">
		<div class="intro_c">
		  <p style="color:red;font-weight:bold;">窗口ID：<span id="debug_WinID"></span></p>
		  <p><strong>动态参数</strong></p>
		  <p>窗口坐标：<span id="debug_WinCoordinate"></span></p>
		  <p>窗口大小：<span id="debug_WinSize"></span></p>
		  <p><strong>初始化参数</strong></p>
		  <p>窗口坐标: <span id="debug_WinInitCoordinate"></span></p>
		  <p>窗口大小：<span id ="debug_WinInitSize"></span></p>
		  <p>窗口最小状态：<span id="debug_MinWinSize"></span></p>

		  <p style="color:red;font-weight:bold;">窗口信息列表</p>
		  <p ><div id="debug_WinList"  ></div></p>
		</div>
		</td>
      </tr>
    </table>
			</div>
			
			<div  id="debug_TopLeftID" style="width:12px;height:28px;background-image:url(../images/me_info/top_left_dancer.jpg);position:absolute;left:0px;top: 0px;"></div>
			
			<div  id="debug_TopID" style="width:300px;height:28px;background-image:url(../images/me_info/top_bg_dancer.jpg);position:absolute;left:12px;top: 0px;">
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      				<tr>
        			<td width="87%" class="intro"><span>调试窗口</span>的信息</td>
        			<td width="13%"><img src="../images/me_info/more.gif" width="23" height="5" /></td>
      				</tr>
   			  </table>
			</div>
			
			<div  id="debug_TopRightID" style="width:12px;height:28px;background-image:url(../images/me_info/top_right_dancer.jpg);position:absolute;right:0px;top: 0px;"></div>
			
			<div  id="debug_RightID"  style="width:12px;height:14px;background-image:url(../images/me_info/right_bg.jpg);position:absolute;right:0px;top: 28px;"></div>
	
			<div id="debug_BottomRightID" style="width:12px;height:14px;background-image:url(../images/me_info/right_bottom.gif);position:absolute;right:0px;bottom: 0px;"></div>
			
			<div  id="debug_BottomID" style="width:12px;height:14px;background-image:url(../images/me_info/bottom_bg.jpg);position:absolute;right:12px;bottom: 0px;">
			</div>
			
			<div  id="debug_LeftID"  style="width:12px;height:14px;background-image:url(../images/me_info/left_bg.jpg);position:absolute;left:0px;top: 28px;"></div>
			
			<div  id="debug_BottomLeftID" style="width:12px;height:14px;background-image:url(../images/me_info/bottom_left.gif);position:absolute;left:0px;bottom: 0px;"></div>
			
	</div>
*/
// 0 left 1 top 2 width  3  height 4 minWidth  5  minHeight  6 maxWidth  7  maxHeight
// 0 id, ,1 bDebug,2 bVisible,3 bDebugShow,4 url,5 strFlag, 6 iImgWidth,7 iImagHeightTop,8 iImagHeightBottom,9 strImgPath
function WinFrame(){
	this.strID=arguments[0];
	this.obj=$(arguments[0]);
	this.bDebug=arguments[1];
	this.bVisible=arguments[2];
	this.bDebugShow=arguments[3];
	this.url=arguments[4];
	this.strFlag=arguments[5];
	this.iImgWidth=arguments[6];
	this.iImagHeightTop=arguments[7];
	this.iImagHeightBottom=arguments[8];
	this.strImgPath=arguments[9];
	this.objBodyShow=$(arguments[0]+"_BodyShow");
	this.objBodyDebug=$(arguments[0]+"_BodyDebug");
	this.bIdle=true;
}
WinFrame.prototype.Create=function(){
		var strID;
		strID=this.strID;
		var strImagePath,iconstTopLeftWidth,iconstTopLeftHeight,iconstBottomRightHeight;
		strImagePath=this.strImgPath;//"../images/me_info/"
		iconstTopLeftWidth=this.iImgWidth;//12
		iconstTopLeftHeight=this.iImagHeightTop;//28
		iconstBottomRightHeight=this.iImagHeightBottom;//14

		var objFrm=document.createElement("div")
		objFrm.setAttribute("id",strID);
		objFrm.style.position = "absolute";
		objFrm.style.display = "block";
		objFrm.style.width = "300px";
		objFrm.style.height ="200px";	
		
		var objFrmTopLeft=document.createElement("div")
		objFrmTopLeft.setAttribute("id",strID+"_TopLeftID");
		objFrmTopLeft.style.position = "absolute";
		//alert(iconstTopLeftWidth);
		objFrmTopLeft.style.width = iconstTopLeftWidth+"px";
		objFrmTopLeft.style.height =iconstTopLeftHeight+"px";
		objFrmTopLeft.style.backgroundImage="url("+strImagePath+"top_left_dancer.jpg)";
		objFrmTopLeft.style.left = "0px";
		objFrmTopLeft.style.top ="0px";
		objFrm.appendChild(objFrmTopLeft);
		
		var objFrmTop=document.createElement("div")
		objFrmTop.setAttribute("id",strID+"_TopID");
		objFrmTop.style.position = "absolute";
		objFrmTop.style.width = iconstTopLeftWidth+"px";
		objFrmTop.style.height =iconstTopLeftHeight+"px";
		objFrmTop.style.backgroundImage="url("+strImagePath+"top_bg_dancer.jpg)";
		objFrmTop.style.left = iconstTopLeftWidth+"px";
		objFrmTop.style.top ="0px";
		objFrm.appendChild(objFrmTop);
		
		var objFrmTopRight=document.createElement("div")
		objFrmTopRight.setAttribute("id",strID+"_TopRightID");
		objFrmTopRight.style.position = "absolute";
		objFrmTopRight.style.width = iconstTopLeftWidth+"px";
		objFrmTopRight.style.height =iconstTopLeftHeight+"px";
		objFrmTopRight.style.backgroundImage="url("+strImagePath+"xioa.gif)";
		objFrmTopRight.style.right = "0px";
		objFrmTopRight.style.top ="0px";
		objFrm.appendChild(objFrmTopRight);
		
		var objFrmRight=document.createElement("div")
		objFrmRight.setAttribute("id",strID+"_RightID");
		objFrmRight.style.position = "absolute";
		objFrmRight.style.width = iconstTopLeftWidth+"px";
		objFrmRight.style.height =iconstTopLeftHeight+"px";
		objFrmRight.style.backgroundImage="url("+strImagePath+"right_bg.jpg)";
		objFrmRight.style.right = "0px";
		objFrmRight.style.top ="28px";
		objFrm.appendChild(objFrmRight);
		
		var objFrmBottomRight=document.createElement("div")
		objFrmBottomRight.setAttribute("id",strID+"_BottomRightID");
		objFrmBottomRight.style.position = "absolute";
		objFrmBottomRight.style.width = iconstTopLeftWidth+"px";
		objFrmBottomRight.style.height =iconstBottomRightHeight+"px";
		objFrmBottomRight.style.backgroundImage="url("+strImagePath+"right_bottom.gif)";
		objFrmBottomRight.style.right = "0px";
		objFrmBottomRight.style.bottom ="0px";
		objFrm.appendChild(objFrmBottomRight);
		
		var objFrmBottom=document.createElement("div")
		objFrmBottom.setAttribute("id",strID+"_BottomID");
		objFrmBottom.style.position = "absolute";
		objFrmBottom.style.width = iconstTopLeftWidth+"px";
		objFrmBottom.style.height =iconstBottomRightHeight+"px";
		objFrmBottom.style.backgroundImage="url("+strImagePath+"bottom_bg.jpg)";
		objFrmBottom.style.right =iconstTopLeftWidth+"px";
		objFrmBottom.style.bottom ="0px";
		objFrm.appendChild(objFrmBottom);
		
		var objFrmLeft=document.createElement("div")
		objFrmLeft.setAttribute("id",strID+"_LeftID");
		objFrmLeft.style.position = "absolute";
		objFrmLeft.style.width = iconstTopLeftWidth+"px";
		objFrmLeft.style.height ="1px";
		objFrmLeft.style.backgroundImage="url("+strImagePath+"left_bg.jpg)";
		objFrmLeft.style.left = "0px";
		objFrmLeft.style.top =iconstTopLeftHeight+"px";
		objFrm.appendChild(objFrmLeft);
		
		var objFrmBottomLeft=document.createElement("div")
		objFrmBottomLeft.setAttribute("id",strID+"_BottomLeftID");
		objFrmBottomLeft.style.position = "absolute";
		objFrmBottomLeft.style.width = iconstTopLeftWidth+"px";
		objFrmBottomLeft.style.height =iconstBottomRightHeight+"px";
		objFrmBottomLeft.style.backgroundImage="url("+strImagePath+"bottom_left.jpg)";
		objFrmBottomLeft.style.left = "0px";
		objFrmBottomLeft.style.bottom ="0px";
		objFrm.appendChild(objFrmBottomLeft);
		
		var objFrmBackground=document.createElement("div")
		objFrmBackground.setAttribute("id",strID+"_BackgroundID");
		objFrmBackground.style.position = "absolute";
		objFrmBackground.style.width = "0px";
		objFrmBackground.style.height ="0px";
		objFrmBackground.style.left = "12px";
		objFrmBackground.style.top ="28px";
			objFrmBackground.style.overflow="hidden";
	    objFrmBackground.style.background="white";
		objFrm.appendChild(objFrmBackground);
		
		if ( this.strFlag=="div" ){
			var objFrmBody=document.createElement("div")
			objFrmBody.setAttribute("id",strID+"_BodyID");
			objFrmBody.style.position = "absolute";
			//objFrmBody.style.src = "www.163.com";
			objFrmBody.style.width = "287px";
			objFrmBody.style.height = "300px";
			//objFrmBackground.style.background="red";
			//objFrmBody.style.height ="28px";
			objFrmBody.style.left = "12px";
			objFrmBody.style.top ="28px";
			objFrmBody.style.padding="0px";
			//objFrmBody.style.overflow="hidden";
			objFrmBody.innerHTML="nihao";
			objFrm.appendChild(objFrmBody);
		}else{
			var objFrmBody=document.createElement("IFRAME")
			objFrmBody.setAttribute("id",strID+"_BodyID");
			objFrmBody.style.position = "absolute";
			//objFrmBody.style.src = "www.163.com";
			objFrmBody.width = "287px";
			objFrmBody.height = "300px";
			//objFrmBackground.style.background="red";
			//objFrmBody.style.height ="28px";
			objFrmBody.style.left = "12px";
			objFrmBody.style.top ="28px";
			objFrmBody.style.padding="0px";
			objFrmBody.setAttribute("src",this.url);
			objFrm.appendChild(objFrmBody);
		}
		
		
	   document.body.appendChild(objFrm);
}
WinFrame.prototype.fInit=function(){
	//alert("1");
	//if(this.bDebugShow){
	//this.objBodyDebug.style.display="block";
	//}
	//else{this.objBodyShow.style.display="block";}
	                  // 0 left 1 top 2 width  3  height 4 minWidth  5  minHeight  6 maxWidth  7  maxHeight 8 iImgWidth, 9 iImgHeightTop 10 iImgHeightBottom
	fDragDropMove(this.strID,[arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],this.iImgWidth,this.iImagHeightTop,this.iImagHeightBottom],this.bDebug,this.bVisible,this.strFlag)
}
function fDragDropMove(strDragDropBody,arrShape,bDebug,bVisible,strFlag,initArr){
	
	var o=$(strDragDropBody);
	//alert(o.offsetHeight);//alert(o.offsetWidth);
	//var iInitWidth=o.offsetWidth,iInitHeight=o.offsetHeight;
	var minW=arrShape[4],minH=arrShape[5];
	minW=minW< (2*arrShape[8]) ? (2*arrShape[8]):minW;
	minH=minH< (arrShape[9]+arrShape[10]) ? (arrShape[9]+arrShape[10]):minH;

	var maxW=0,maxH=0;
	var arrShapeLength=arrShape.length;
	if( arrShapeLength > 6 ){
		maxW=arrShape[6];
		maxH=arrShape[7];
	}
	var ho=$(strDragDropBody+"_TopID");
	var hoLeft=$(strDragDropBody+"_TopLeftID");
	var hoRight=$(strDragDropBody+"_TopRightID");
	
	
	// 变化部分
	var oFrame_TopID=$(strDragDropBody+"_TopID");
	var oFrame_RightID=$(strDragDropBody+"_RightID");
	var oFrame_BottomID=$(strDragDropBody+"_BottomID");
	var oFrame_LeftID=$(strDragDropBody+"_LeftID");
	var oFrame_BackgroundID=$(strDragDropBody+"_BackgroundID");
	var oFrame_BodyID=$(strDragDropBody+"_BodyID");
	
	//调试信息对象
	if (bDebug){
		oDebug_MinWinSize=$(strDragDropBody+"_MinWinSize");
		oDebug_WinInitCoordinate=$(strDragDropBody+"_WinInitCoordinate");
		oDebug_WinInitSize=$(strDragDropBody+"_WinInitSize");
		oDebug_WinSize=$(strDragDropBody+"_WinSize");
		oDebug_WinID=$(strDragDropBody+"_WinID");
		oDebug_WinCoordinate=$(strDragDropBody+"_WinCoordinate");
	}

	o.style.position="absolute";
	if (bVisible)
	{
		o.style.visibility = "visible"; 
	}else{
		o.style.visibility = "hidden"; 
	}

	o.style.left = arrShape[0]+"px";
	o.style.top = arrShape[1]+"px";

    winDbox=$(strDragDropBody+"_BottomRightID");
ho.onmousedown=hoLeft.onmousedown=hoRight.onmousedown=function(a){
		o.style.zIndex = window.vWinZIndex;
		if (bDebug)
		{
			oDebug_WinID.innerHTML=strDragDropBody+":"+window.vWinZIndex;
			oDebug_MinWinSize.innerHTML=minW+","+minH;
			oDebug_WinInitCoordinate.innerHTML=arrShape[0]+","+arrShape[1];
			oDebug_WinInitSize.innerHTML=arrShape[2]+","+arrShape[3];
			oDebug_WinSize.innerHTML=o.offsetWidth+","+o.offsetHeight;			
			oDebug_WinCoordinate.innerHTML=parseInt(o.style.left)+","+parseInt(o.style.top);
		}
		window.vWinZIndex++;
		var d=document;if(!a)a=window.event;
		
		var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
		
		if(ho.setCapture)
			ho.setCapture();
		else if(window.captureEvents)
			window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
		d.onmousemove=function(a){
			if(!a)a=window.event;
			var mus=getMouseCoords(a)
			if(!a.pageX)a.pageX=mus.x;
			if(!a.pageY)a.pageY=mus.y;
			var tx=a.pageX-x,ty=a.pageY-y;
			if(initArr){
				o.style.left=(tx<initArr[0]?initArr[0]:tx>initArr[2]?initArr[2]:tx)+"px";
				o.style.top=(ty<initArr[1]?initArr[1]:ty>initArr[3]?initArr[3]:ty)+"px";
			}else{
				o.style.left = tx+"px";
				o.style.top = ty+"px";
				if ( bDebug)
				{				
					oDebug_WinCoordinate.innerHTML=tx+","+ty;
				}
			}
		};
		d.onmouseup=function(){
			if(ho.releaseCapture)
				ho.releaseCapture();
			else if(window.captureEvents)
				window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			d.onmousemove=null;
			d.onmouseup=null;
		};
	};
	winDbox.onmousedown = function(e){
		o.style.zIndex = window.vWinZIndex;
		window.vWinZIndex++;
		var d=document;if(!e)e=window.event;
		var x=e.layerX?e.layerX:e.offsetX,y=e.layerY?e.layerY:e.offsetY;
		var MCD=window.getMouseCoords(e)
		winDbox.startX=MCD.x;
		winDbox.startY=MCD.y;
		winDbox.startW=o.offsetWidth;
		winDbox.startH=o.offsetHeight;
		//
		if(winDbox.setCapture)
			winDbox.setCapture();
		else if(window.captureEvents)
			window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
		d.onmousemove =function(e){
			if(!e)e=window.event;
			var mus=getMouseCoords(e)
			var newW = (winDbox.startW +(mus.x-winDbox.startX));
			var newH = (winDbox.startH +(mus.y-winDbox.startY))
			resizeWin(newW,newH);
		}
		d.onmouseup=function(){
			if(winDbox.releaseCapture)
				winDbox.releaseCapture();
			else if(window.captureEvents)
				window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
			d.onmousemove=null;
			d.onmouseup=null;
		}
	}	
	function resizeWin(newW,newH){
			newW = newW < minW?minW:newW;
			newH = newH < minH?minH:newH;
			if( arrShapeLength > 6 ){
				newW = newW > maxW?maxW:newW;
				newH = newH > maxH?maxH:newH;
			}
			
			if(bDebug){
				oDebug_WinSize.innerHTML=newW+","+newH;
			}
			o.style.width = newW+"px";
			o.style.height = newH+"px";
			var iW=2*arrShape[8];
			var iH=arrShape[9]+arrShape[10]
			oFrame_TopID.style.width = (newW-iW)+"px";
			oFrame_RightID.style.height = (newH-iH)+"px";
			oFrame_BottomID.style.width = (newW-iW)+"px";
			oFrame_LeftID.style.height = (newH-iH)+"px";
			oFrame_BackgroundID.style.height = (newH-iH)+"px";
			oFrame_BackgroundID.style.width = (newW-iW)+"px";
			if (strFlag=="div"){
				oFrame_BodyID.style.height = (newH-iH)+"px";
				oFrame_BodyID.style.width = (newW-iW)+"px";
			}else{
				oFrame_BodyID.height = (newH-iH)+"px";
				oFrame_BodyID.width = (newW-iW)+"px";
			}
			//oFrame_BodyID.width = (newW-12-8)+"px";
	}
	{
		resizeWin(arrShape[2],arrShape[3]);
	}
}

WinFrame.prototype.Run=function(){
	if ( this.bIdle )
	{ 
		return;
	}
}

WinFrame.prototype.SetShowArea=function(){
	//alert(argument(0));
	$(this.strID+"_BodyID").innerHTML=arguments[0];
	
}
function preloader(urlImg) 

{

     heavyImage = new Image(); 

     heavyImage.src = urlImg;

}
//Phto_index.htm  js start
//Phto_index.htm  js end

function fCommoGetLocalCoordinate(a){
					if(!a)a=window.event;
				var mus=getMouseCoords(a)
				if(!a.pageX)a.pageX=mus.x;
				if(!a.pageY)a.pageY=mus.y;
				//var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
				
				 if (a.offsetX == undefined)
  {
    var evtOffsets = getOffset(a);
	    x= evtOffsets.offsetX;
    y= evtOffsets.offsetY;
    //msg += "offsetX: " + evtOffsets.offsetX + "; ";
    //msg += "offsetY: " + evtOffsets.offsetY + "; ";
  }
  else
  {
    x= a.offsetX;
    y= a.offsetY;
  }
	var tx=a.pageX,ty=a.pageY;
	return {x:(tx-x),y:(ty-y)};
}
// player mp3 file function
function fCommnPlayMP3(strPlayerID,urlPara,w,h){
	var so = new SWFObject('../js/flvplayer.swf','mpl',w,h,'7'); 
	so.addParam('allowscriptaccess','true'); 
	so.addVariable('file',urlPara); 
	so.addVariable('height',h); 
	so.addVariable('width',w);
	so.addVariable('autostart','true');  
	so.write(strPlayerID); 
}
// endfunction 

//javascript 获取 url 参数 
function getQuery(name)
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r!=null) return unescape(r[2]); return null;
}
//end


//mask
/*
<div id="ID_MaskTip" style=" visibility:hidden;filter:alpha(opacity=0); -moz-opacity:0; position:absolute; left:0px;top:0px;height:120px; width:122px;   background-color:white;"></div>

var objMaskTip=new MaskTip("ID_MaskTip");
setInterval("fTimeWorker()",50);
function fTimeWorker(){
	objMaskTip._fRun();
}
*/
function MaskTip(arr){
	this._obj=$(arr[0]);
	this._iRate=arr[1];
	this._iSleepCount=arr[2];
	this._iMaxOpacity=arr[3];
	this._iMinOpacity=arr[4];


	this._iCount=0;
	this._iSleepCur=0;
	this._bFade=false;
	this._bIsWork=false;
	this._iCurOpacity=0;
	this._imgSrc="";
	this._strTip="";
}
MaskTip.prototype._fInit=function(arr,iLeft,iTop,iWidth,iHeight,imgSrc,strTip){
	if (this._bIsWork || arr[4]==this._imgSrc)
	{
		return;
	}
	this._strTip=arr[5];
	this._imgSrc=arr[4];
	this._bIsWork=true;
	this._bFade=false;
	this._obj.style.left=arr[0]+"px";
	this._obj.style.top=arr[1]+"px";
	
	this._browserdetect=this._obj.filters? "ie" : typeof this._obj.style.MozOpacity=="string"? "mozilla" : ""
	
	this._iCurOpacity=this._iMinOpacity;
	if (this._browserdetect=="mozilla"){
			this._obj.style.width=arr[2]+8+"px";
			this._obj.style.height=arr[3]+8+"px";
			this._obj.style.MozOpacity=this._iCurOpacity/100;
		}
	else if (this._browserdetect=="ie"){
			this._obj.style.width=arr[2]+"px";
			this._obj.style.height=arr[3]+"px";
			this._obj.filters.alpha.opacity=this._iCurOpacity;
		}

	this._obj.style.visibility="visible";
};
MaskTip.prototype._fRun=function(){

	this._iCount+=1;
	if ( (this._iCount%this._iRate)==0 && !this._bIsWork )
	{
		return;
	}
	if (this._iSleepCur > 0)
	{
		this._iSleepCur-=1;
		return;
	}
	if (this._bFade)
	{//alert("1");
		if (this._iCurOpacity <= this._iMinOpacity)
		{
			this._obj.style.visibility="hidden";
			this._obj.innerHTML="";
			this._bIsWork=!this._bIsWork;
			return;
		}
		else
		{
			this._iCurOpacity-=10;
			if (this._browserdetect=="mozilla")
				this._obj.style.MozOpacity=this._iCurOpacity/100;
			else if (this._browserdetect=="ie")
				this._obj.filters.alpha.opacity=this._iCurOpacity;
		}
	}
	else
	{//alert("2");
		if (this._iCurOpacity >= this._iMaxOpacity)
		{
			this._bFade=!this._bFade;
			this._iSleepCur=this._iSleepCount;
			this._obj.innerHTML=this._strTip;
			return;
		}
		else
		{
			this._iCurOpacity+=10;
			if (this._browserdetect=="mozilla")
				this._obj.style.MozOpacity=this._iCurOpacity/100;
			else if (this._browserdetect=="ie")
				this._obj.filters.alpha.opacity=this._iCurOpacity;
		}
		
	}
};


//PlayerPicture
/*
<!--test-->
<div style="position:absolute;">					
      <div id="ID_PlayerPictureScreen" style="position:absolute; width:536px; height:66px; overflow:hidden; left: 0px; top: 0px;">
      <div id="ID_PlayerPictureList" style="position:absolute; width:2000px; left:-1px;">
        <ul>
          <li style="float:left;margin:0 10px 0 0;"><img onclick="LoadPlayerMoviesCommon('../flv/a.flv',433,260,433,'ID_Player')" src="../images/index/top_shipin7.gif" width="82" height="66" /></li>
        </ul>
     </div>
     		<div  id="ID_PlayerPictureLeftBtn" style="margin:0px 0px 0px 0px;top:0px; left:0px; background-color:gray; position:absolute; width:100px;height:66px;"></div>
			<div  id="ID_PlayerPictureRightBtn" style="margin:0px 0px 0px 0px; top:0px; right:0px; background-color:gray; position:absolute; width:10px;height:66px;"></div>
  </div>
</div>
<!--test-->


<script>
									  //id,           ,step,padding,left,top,w  ,h
var objPlayerPicture=new PlayerPicture("ID_PlayerPicture",2,10,300,300,300,100);

objPlayerPicture._fInit();

objPlayerPicture.objLeftBtn.onmousemove=function(){
	objPlayerPicture._fSetLeftMove();
}
objPlayerPicture.objLeftBtn.onmouseout=function(){
	objPlayerPicture._fSetStatic();
}
objPlayerPicture.objRightBtn.onmousemove=function(){
	objPlayerPicture._fSetRightMove();
}
objPlayerPicture.objRightBtn.onmouseout=function(){
	objPlayerPicture._fSetStatic();
}
function fTimeWorker(){

	objPlayerPicture._fRun();
}
setInterval("fTimeWorker()",50);
</script>
*/
//id,           ,step,padding,left,top,w  ,h, picturemode,pictureWidth,pictureWidth
function PlayerPicture(){
	this.objScreen=$(arguments[0]+"Screen");
	this.objList=$(arguments[0]+"List");
	this.objLeftBtn=$(arguments[0]+"LeftBtn");
	this.objRightBtn=$(arguments[0]+"RightBtn");
	this._iConstStep=arguments[1];
	this._iImgPaddingRight=arguments[2];
	this._iScreenLeft=arguments[3];
	this._iScreenTop=arguments[4];
	this._iScreenWidth=arguments[5];
	this._iScreenHeight=arguments[6];
	this._iPaddingLeftWidth=parseInt(this.objLeftBtn.style.width);
	this._iPaddingRightWidth=parseInt(this.objRightBtn.style.width);
	//alert(this._iPaddingLeftWidth);
	this._iListLength=0;
	this._iListCount=0;
	this._iStep=0;
	
	this.bLengthMode=true;
	//alert(arguments.length);
	if(arguments.length > 7) {
		this.bLengthMode=arguments[7];
		this.iPicWidth=arguments[8];
		this.iPicHeight=arguments[9];
	}
}
PlayerPicture.prototype._fInit=function(){
	
	this.objScreen.style.left=this._iScreenLeft+"px";
	this.objScreen.style.top=this._iScreenTop+"px";
	
	this.objScreen.style.width=this._iScreenWidth+"px";
	
	
	this.objScreen.style.height=this._iScreenHeight+"px";
	this.objLeftBtn.style.height=this._iScreenHeight+"px";
	this.objRightBtn.style.height=this._iScreenHeight+"px";
	
	this._iPaddingLeftWidth=parseInt(this.objLeftBtn.style.width);
	this._iPaddingRightWidth=parseInt(this.objLeftBtn.style.width);
	
	//this._iPaddingLeftWidth=0;
	//this._iPaddingRightWidth=0;
	//alert(this._iPaddingLeftWidth+"pp"+this._iPaddingRightWidth);
	var imgs = this.objList.getElementsByTagName("img");
		var iLength=0;
		var iCount=0;
		iCount=imgs.length;
		for (var i=0; i<iCount; i++) {
			if (this.bLengthMode){
				if ( i==0 ) this.objScreen.style.height=parseInt( imgs[i].getAttribute("height") )+"px";
				iLength+=parseInt( imgs[i].getAttribute("width") )+this._iImgPaddingRight;
			}else{
				this.objScreen.style.height=this.iPicHeight;
				iLength+=this.iPicWidth+this._iImgPaddingRight;
			}
		}
		this._iListCount=iCount;
		this._iListLength=iLength;
		this.objList.style.left=(-1)*(Math.round( (this._iListLength-this._iScreenWidth)/2 ))+"px";
		//alert(Math.round( (this._iListLength-this._iScreenWidth)/2 ));
}

PlayerPicture.prototype._fSetLeftMove=function(){
	this._iStep=(-1)*this._iConstStep;
}
PlayerPicture.prototype._fSetRightMove=function(){
	this._iStep=this._iConstStep;
	//alert(this._iStep);
}
PlayerPicture.prototype._fSetStatic=function(){
	//alert(this._iImgPaddingRight)
	this._iStep=0;
}
PlayerPicture.prototype._fRun=function(){
	if ( this._iStep == 0 )
	{
		return;
	}
	var iTemp=parseInt(this.objList.style.left);
	//if( this._iStep>0 && t<this._iPaddingLeftWidth){
		
	if( this._iStep>0 && iTemp< this._iPaddingLeftWidth+this._iImgPaddingRight){
	//if( this._iStep>0 ){
		this.objList.style.left=(iTemp+this._iStep)+"px";
		return;
	}
	//if(this._iStep<0 && t>((-1)*this._iListLength+this._iPaddingRightWidth) ){
	if(this._iStep<0  && iTemp > (-1)*(this._iListLength-this._iScreenWidth+this._iImgPaddingRight) ){
		this.objList.style.left=(iTemp+this._iStep)+"px";
		//this._iStep;
		return;
	}
	this._iStep = 0;
}

// 消失顶部的flash
function DisappearFlash(){
	this.obj=$(arguments[0]);
	this.iCount=arguments[1];
}
DisappearFlash.prototype._fRun=function(){
	if (this.iCount>0){
		this.iCount-=1;
		//alert(this.iCount);
		if (this.iCount == 0) this.obj.style.display="none";
	}
	else{
		return;
	}
}

//ShrinkWin
/*
<div style="position:absolute;">
<div id="Topic">
<div id="TopicBarID" style="top:-40px;" >
<div id="TopicID">
<div align="center" style="padding-top: 9px;color:#000">
<a href="../newppc/index.htm" class="top_nav">首页</a>　　<a href="../newppc/xiha_index.htm" class="top_nav">嘻哈</a>　　<a href="../newppc/dianyin_index.htm" class="top_nav">电音</a>　　<a href="../newppc/yedian_index.htm" class="top_nav">夜店</a>　　<a href="../newppc/blog_index.htm" class="top_nav">日志</a>　　<a href="../newppc/photo_index.htm" class="top_nav">图片</a>　　<a href="../newppc/music_index.htm" class="top_nav">音频</a>　　<a href="../newppc/video_index.htm" class="top_nav">视频</a>　　<a href="../newppc/user_index.htm" class="top_nav">用户</a>　　<a href="../newppc/shequ_index.htm" class="top_nav">社区</a></div></div>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><img src="../images/index/top_nav.png" /></td>
    </tr>
  </table>
</div>
</div>
</div>
*/
function SpreadWin(){
	this.winID=arguments[0];
	this.iConstCount=arguments[1];
	
	this.iCount=0;
	this.iStep=0;
	this.iCount=0;
	this.iExit=0;
}
SpreadWin.prototype.Create=function(){
	
 
		var objFrm=document.createElement("div")
		objFrm.setAttribute("id",this.winID+"Spread");
		objFrm.style.position = "absolute";
		objFrm.style.display = "block";
		//objFrm.style.width = "300px";
		//objFrm.style.height ="200px";
		//objFrm.style.background="red";
		objFrm.onclick=function(){alert(this.innerHTML);}

		
		var objFrmStopDiv=document.createElement("div")
		objFrmStopDiv.setAttribute("id",this.winID+"_Spread_StopDiv");
		objFrmStopDiv.style.position = "absolute";
		objFrmStopDiv.style.display = "block";
		objFrmStopDiv.style.overflow = "hidden";
		//objFrm.style.background="black";
		//objFrmStopDiv.style.top = "22px";
		objFrmStopDiv.style.border="1px solid red";
		objFrmStopDiv.style.width = "300px";
		objFrmStopDiv.style.height ="200px";

		var objFrmStopMoveDiv=document.createElement("div")
		objFrmStopMoveDiv.setAttribute("id",this.winID+"_Spread_MoveDiv");
		objFrmStopMoveDiv.style.position = "absolute";
		objFrmStopMoveDiv.style.display = "block";
		objFrmStopMoveDiv.style.zIndex = "10000";
		objFrmStopMoveDiv.style.top = "22px";

		//alert(arguments.length);
		var objUl=document.createElement("ul");
		objUl.style.listStyle="none";
		objUl.style.padding="0px";
		objUl.style.background="green";
		var objLi,objA,objT;
		for (var i=arguments.length-1;i>=0;i--)
		{
			objLi=document.createElement("li");
			objA=document.createElement("a");
			objA.style.paddingLeft="0px";
			objA.align="left";
			objT=document.createTextNode(arguments[i]);
			objA.appendChild(objT);
			//objA.innerHTML=arguments[i];
			objLi.appendChild(objA);
			objUl.appendChild(objLi);
		}


		objFrmStopMoveDiv.appendChild(objUl);
		objFrmStopDiv.appendChild(objFrmStopMoveDiv);
		objFrm.appendChild(objFrmStopDiv);

	    document.body.appendChild(objFrm);
		//alert($(this.winID).offsetHeight);
		
}
SpreadWin.prototype.Run=function(){
	if (this.iCount>0){
		this.iCount-=1;
	}
	else{
		return;
	}
}
SpreadWin.prototype.Open=function(){
}



function fShow(strID,iCur,iCount){
       for(var i=iCount;i>0;i--){
	   		if (i ==iCur ){
			   if($(strID+i).style.display=="none"){
					try{$(strID+i).style.display="block"}catch(e){};
			   		continue;
				}
			}
			try{$(strID+i).style.display="none"}catch(e){};
	   }
}















