// JavaScript Document
//js弹层 
//by mc 2010-06-27
//type:类型 1,框架，2,文本标记
layer=function(title,width,height,C,type){
			this.title=title;
			this.width=width;
			this.height=height;
			this.Cwidth=this.width-10;
			this.Cheight=this.height-31;
			this.C=C;
			this.type=type;
			this.Sl=null;
				this.bigLayer=function(){
						    Bl = document.createElement("div");
						    Bl.setAttribute("id","T1");						   
						    Bl.style.width="100%";
						    Bl.style.height=document.documentElement.scrollHeight+"px";
						   document.body.appendChild(Bl); 
					}
				this.smLayer=function(){
						
						I('T2').style.width=this.width+"px";
						I('T2').style.height=this.height+"px";
						I('dialog-title').innerHTML=this.title;
						I('C-contC').style.width=this.Cwidth+"px";
						I('C-contC').style.height=this.Cheight+"px";
						//I('load').style.display='block';
					if(this.type==1){
						I('C-contC').innerHTML="<div id='load'>loading....</div><iframe width='100%' height='100%' id='ffff' frameborder='0' src='' style='display:none'></iframe>";	
						I('ffff').src=this.C;
						I('ffff').onreadystatechange=function(){
								if(this.readyState=="interactive"){
										I('load').innerHTML="";
										I('load').style.display="none";
										this.style.display="block";
									}
							}
						I('ffff').onload=function(){
										I('load').innerHTML="";
										I('load').style.display="none";
										this.style.display="block";
								
							}	
						}
					else if(this.type==2){
							I('C-contC').innerHTML=this.C;
						}
                      I('T2').style.display="block";
					}	
				this.scrollmove=function(){
					    scrollTop=window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
						with(I('T2').style){
						top=(document.documentElement.clientHeight-parseInt(I('T2').style.height))/2+scrollTop+"px";
						left=(document.documentElement.clientWidth-parseInt(I('T2').style.width))/2+"px";
						}
					}
					
					this.bigLayer();//div遮罩
					this.smLayer();	
					
			}
			
			 function closediglog(){
							I('T2').style.display="none";
							document.body.removeChild(I('T1'));
						}	
			/*taglist*/
			
			    function I(f){return document.getElementById(f);}
				
				function taglist(id,classtype,child){
						for(var i=0;i<=I(id).getElementsByTagName(child).length-1;i++){
							I(id).getElementsByTagName(child)[i].onclick=function(){
									for(var j=0;j<=I(id).getElementsByTagName(child).length-1;j++){
										if(I(id).getElementsByTagName(child)[j]==this){
											I(id).getElementsByTagName(child)[j].className=classtype;
											I(id+j.toString()).style.display="block";
										}
									else{
											I(id).getElementsByTagName(child)[j].className="";
											I(id+j.toString()).style.display="none";
										}
										}
								}
							}
					}
