var domovie = {
	indexShow:'',
	showTime:3000,
	moveTime:2000
};

domovie.on = function(f){
	var s = window.onload;
	if(typeof(s)!='function'){
		window.onload = f;
	}else{
		window.onload = function(){
			s();f();
		};
	};
}
domovie.album = {
	current:0,
	width:120,//默认的宽度
	height:80,//默认的高度
	sWidth:600,
	sHeight:450,
	set:function(s,w,h){//图片的ID,指定的宽度,指定的高度;其中高和宽可以为空,则用默认的宽高值代替
		if(!s||!document.getElementById(s)){return false;};
		var album = document.getElementById(s);
		var album_width = parseInt(album.width);//取到图片宽
		var album_height = parseInt(album.height);//取到图片高
		var width = parseInt(w)&&w ? w : domovie.album.width;
		var height = parseInt(h)&&h ? h : domovie.album.height;
		var hrate=parseInt((height/album_height)*10000);
		var wrate=parseInt((width/album_width)*10000);
		if(wrate>hrate){
			if(album_width > width){
				album.width = width;
				album.height = (width/(album_width))*(album_height);
			}//第一次设置完成；宽度设置完毕；
			if(album_height > height){
				album.height = height;
				album.width = (height/(album_height))*(album_width);
			}//第二次设置完成；高度设置完毕；
		}else{
			if(album_height > height){
				album.height = height;
				album.width = (height/(album_height))*(album_width);
			}//第二次设置完成；高度设置完毕；
			if(album_width > width){
				album.width = width;
				album.height = (width/(album_width))*(album_height);
			}//第一次设置完成；宽度设置完毕；
		}
		if(album.width == width){
			album.style.marginTop = (height - album.height)/2 + 'px';
		}
		/*
		if(album.height == height){
			album.style.marginLeft = (width - album.width)/2 + 'px';
		}
		*/
		//album.style.display = 'block';
	},
	init:function(s,w,h){
		if(!s||!document.getElementById(s)){return false;};
		var image = document.getElementById(s+'-image');
		var width = parseInt(w)&&w ? w : domovie.album.sWidth;
		var height = parseInt(h)&&h ? h : domovie.album.sHeight;
		domovie.album.focus(image,width,height);
		var sLast = document.getElementById(s+'-last');
		var sNext = document.getElementById(s+'-next');
		sLast.onclick = function(){
			if(domovie.album.current==0){return false;};
			domovie.album.current--;
			domovie.album.focus(image,width,height);
		};
		sNext.onclick = function(){
			domovie.album.current++;
			if(!domovie.album.imageArr[domovie.album.current]){
				domovie.album.current--;
				return false;
			};
			domovie.album.focus(image,width,height);
		}
	},
	focus:function(s,w,h){
		var link = domovie.album.imageArr[domovie.album.current];
		s.innerHTML = '<a href="'+link+'" target="_blank"><img src="'+link+'" id="show-'+domovie.album.current+'" onload="domovie.album.set(\'show-'+domovie.album.current+'\','+w+','+h+')"></a>';
	}
}
domovie.movie = {
	current:false,
	li:false,
	init:function(s){
		if(!domovie.event.get(s)){return false;};
		var base = s;
		if(domovie.event.get(base+'-area')){
			var lis = domovie.event.get(base+'-area').getElementsByTagName('li');
			for(var i=0;i<lis.length;i++){
				var li = lis[i];
				li.setAttribute('id',base+'-'+i);
				li.onclick = function(){
					//alert(this.value);
					if(!domovie.movie.li){
						this.setAttribute('class','onmouseover');this.setAttribute('className','onmouseover');
						domovie.movie.li = this.id;
					}else{
						var old = domovie.event.get(domovie.movie.li);
						old.setAttribute('class','onmouseoute');old.setAttribute('className','onmouseoute');
						var current = domovie.event.get(this.id);
						current.setAttribute('class','onmouseover');current.setAttribute('className','onmouseover');
						domovie.movie.li = this.id;
					}
					if(!domovie.event.get('moviePlay')){return false;};
					var iframe = domovie.event.get('moviePlay');
					//iframe.src = "http://www.baidu.com/s?wd="+this.innerHTML;
					iframe.src = "./movie.play.php?id="+this.value;
				}
			}
		}
		var s = domovie.event.get(s);
		var spans = s.getElementsByTagName('span');
		for(var i=0;i<spans.length;i++){
			var current = domovie.event.get(base+'-'+i+'-tag');
			current.onclick = function(){
				if(!domovie.movie.current){
					var old = domovie.event.get(base+'-0-tag');
					if(domovie.event.get(base+'-0-tag-area')){
						domovie.event.get(base+'-0-tag-area').style.display = 'none';
					}
					old.setAttribute('class','onmouseoute');old.setAttribute('className','onmouseoute');
					if(domovie.event.get(this.id+'-area')){
						domovie.event.get(this.id+'-area').style.display = 'block';
					}
					this.setAttribute('class','onmouseover');this.setAttribute('className','onmouseover');
					domovie.movie.current = this.id;
				}else{
					var old = domovie.event.get(domovie.movie.current);
					if(domovie.event.get(domovie.movie.current+'-area')){
						domovie.event.get(domovie.movie.current+'-area').style.display = 'none';
					}
					old.setAttribute('class','onmouseoute');old.setAttribute('className','onmouseoute');
					this.setAttribute('class','onmouseover');this.setAttribute('className','onmouseover');
					if(domovie.event.get(this.id+'-area')){
						domovie.event.get(this.id+'-area').style.display = 'block';
					}
					domovie.movie.current = this.id;
				}
			}
		}
	}
}
domovie.search = {
	current:false,
	base:'user-info',
	init:function(){
		var s = document.getElementById(domovie.search.base);
		var spans = s.getElementsByTagName('span');
		for(var i=0;i<spans.length;i++){
			var btn = domovie.event.get(domovie.search.base+'-'+i+'-tag');
			if(i==0){
				btn.setAttribute('class','onmouseover');btn.setAttribute('className','onmouseover');
				domovie.search.current = domovie.search.base+'-'+i+'-tag';
			}else{
				btn.setAttribute('class','onmouseoute');btn.setAttribute('className','onmouseoute');
			}
			btn.onclick = function(){
				if(this.id==domovie.search.current){return false;};
				if(domovie.search.current){
					var old = domovie.event.get(domovie.search.current);
					old.setAttribute('class','onmouseoute');old.setAttribute('className','onmouseoute');
				}
				var current = domovie.event.get(this.id);
				current.setAttribute('class','onmouseover');current.setAttribute('className','onmouseover');
				domovie.search.current = this.id;
			}
		}
	},
	set:function(f){
		if(!f||f=='0'){return false;};
		var btnName = domovie.search.base+'-'+f+'-tag';
		if(btnName==domovie.search.current){return false;};
		if(domovie.search.current){
			var old = domovie.event.get(domovie.search.current);
			old.setAttribute('class','onmouseoute');old.setAttribute('className','onmouseoute');
		}
		var current = domovie.event.get(btnName);
		current.setAttribute('class','onmouseover');current.setAttribute('className','onmouseover');
		domovie.search.current = btnName;
	}
}
domovie.move = {
	init:function(s,unit,full){
		var sa = domovie.event.get(s+'-list');
		var imgs = sa.getElementsByTagName('img');
		sa.style.width = unit*imgs.length+'px';
		sa.style.left = 0;
		var l = s=='indexMove'?domovie.event.get('mBtn-left'):domovie.event.get('sBtn-left');
		var r = s=='indexMove'?domovie.event.get('mBtn-right'):domovie.event.get('sBtn-right');
		l.onclick = function(){
			if(parseInt(sa.style.left) =='0'){
				return false;
		  };
			sa.style.left = parseInt(sa.style.left) + unit*4 +'px';
		}
		r.onclick = function(){
			if(parseInt(sa.style.left)==full-parseInt(sa.style.width)){return false;};
			sa.style.left = parseInt(sa.style.left) - unit*4 +'px';
		}
	}
}
domovie.show = {
	current:'',
	number:0,
	init:function(s,w,h){
		var event = domovie.event.get(s);
		var imgs = document.createElement('div');imgs.setAttribute('id','s-imgs');
		var text = document.createElement('div');text.setAttribute('id','s-text');
		var icon = document.createElement('div');icon.setAttribute('id','s-icon');
		var sdow = document.createElement('div');sdow.setAttribute('id','s-sdow');
		var show = document.createElement('div');show.setAttribute('class','show-btns');show.setAttribute('className','show-btns');
		var i=1;
		for(ad in domovie.show.events[s]['item']){
			if(i==1){
				imgs.innerHTML = '<a href="'+domovie.show.events[s]['item'][ad]['link']+'" target="_blank"><img src="'+domovie.show.events[s]['item'][ad]['image']+'" width="'+w+'" height="'+h+'"/></a>';
				text.innerHTML = domovie.show.events[s]['item'][ad]['title'];
				var number_class = 'onmouseover';
				domovie.indexShow = s+'-'+i;
				domovie.show.current = i;
			}else
			{
				var number_class = 'onmouseoute';
			};
			var number = document.createElement('div');
			number.setAttribute('class',number_class);number.setAttribute('className',number_class);
			number.setAttribute('id',s+'-'+i);number.innerHTML = i;
			number.onmouseover = function(){
				domovie.show.save(this.id,s,this.innerHTML,w,h);
			}
			show.appendChild(number);
			i++;
		}
		domovie.show.number = i-1;
		icon.appendChild(show);
		event.appendChild(imgs);event.appendChild(text);event.appendChild(icon);event.appendChild(sdow);
		var j = domovie.show.current;
		setInterval(function(){j++;if(j>domovie.show.number){j=1;};domovie.show.save(s+'-'+j,s,j,w,h);},domovie.showTime);
	},
	save:function(id,s,j,w,h){
		var imgs = domovie.event.get('s-imgs');
		var text = domovie.event.get('s-text');
		var i=1;
		for(var ad in domovie.show.events[s]['item']){
			if(i==j){
				imgs.innerHTML = '<a href="'+domovie.show.events[s]['item'][ad]['link']+'" target="_blank"><img src="'+domovie.show.events[s]['item'][ad]['image']+'" width="'+w+'" height="'+h+'"/></a>';
				text.innerHTML = domovie.show.events[s]['item'][ad]['title'];
			};
			i++;
		};
		if(domovie.indexShow){
			var old = domovie.event.get(domovie.indexShow);
			old.setAttribute('class','onmouseoute');old.setAttribute('className','onmouseoute');
		}
		var current = domovie.event.get(id);
		current.setAttribute('class','onmouseover');current.setAttribute('className','onmouseover');
		domovie.indexShow = id;
		domovie.show.current = j;
	}
}
domovie.btns = {
	init:function(s,f){
		var btns = s.getElementsByTagName('span');
		for(var i=0;i<btns.length;i++){
			var btn = domovie.event.get(s.id+'-'+i+'-tag');
			btn.onclick = function(){
				domovie.btns.change(s,this.id);
			}
		}
	},
	change:function(s,f){
		var btns = s.getElementsByTagName('span');
		for(var i=0;i<btns.length;i++){
			var btn = domovie.event.get(s.id+'-'+i+'-tag');
			btn.setAttribute('class','onmouseoute');btn.setAttribute('className','onmouseoute');
			var area = domovie.event.get(s.id+'-'+i+'-tag-area');
			area.style.display = 'none';
			if(domovie.event.get(s.id+'-'+i+'-tag-more')){
				var more = domovie.event.get(s.id+'-'+i+'-tag-more');
				more.style.display = 'none';
			}
		}
		var btn = domovie.event.get(f);btn.setAttribute('class','onmouseover');btn.setAttribute('className','onmouseover');
		var area = domovie.event.get(f+'-area');area.style.display = 'block';
		if(domovie.event.get(f+'-more')){
			var more = domovie.event.get(f+'-more');
			more.style.display = 'block';
		}
	}
}
domovie.tags = {
	init:function(s,f){
		var f = 'onmouseover';
		var tags = s.getElementsByTagName('div');
		for(var i=0;i<tags.length;i++){
			var tag = tags[i];tag.setAttribute('id',s.id+'-'+i+'-tag');
			tag.onmouseover = function(){
				domovie.tags.change(s,this);
			}
		};
	},
	change:function(s,f,cls){
		var tags = s.getElementsByTagName('div');
		var cls = cls?cls:'onmouseover';
		for(var j=0;j<tags.length;j++){
			var tag = tags[j];tag.setAttribute('class','onmouseoute');tag.setAttribute('className','onmouseoute');
			if(domovie.event.get(s.id+'-'+j+'-tag-area')){
				domovie.event.get(s.id+'-'+j+'-tag-area').style.display = 'none';
			}
		}
		f.setAttribute('class',cls);
		f.setAttribute('className',cls);
		if(domovie.event.get(f.id+'-area')){
			domovie.event.get(f.id+'-area').style.display = 'block';
		};
	}
}
domovie.user = {
	current:{
		menu:''
	},
	menu:function(s){
		document.body.onclick = function(){
			if(domovie.user.current.menu){
				var span_area = domovie.event.get(domovie.user.current.menu+'-area');
				span_area.style.display = 'none';
				domovie.user.current.menu = '';
			}
		}
		var spans = s.getElementsByTagName('span');
		for(var i=0;i<spans.length;i++){
			if(spans[i]['id']){
				spans[i].onmouseover = function(){
					if(domovie.user.current.menu==this.id){return false;};
					if(domovie.user.current.menu&&domovie.user.current.menu!=this.id){
						var span_area = domovie.event.get(domovie.user.current.menu+'-area');
						span_area.style.display = 'none';
						domovie.user.current.menu = '';
					}
					if(domovie.event.get(this.id+'-area')){
						var span_area = domovie.event.get(this.id+'-area');
						span_area.style.display = 'block';
						domovie.user.current.menu = this.id;
					}
					/*
					var span_area = domovie.event.get(this.id+'-area');
					span_area.onmouseout = function(){
						this.style.display = 'none';
						domovie.user.current.menu = '';
					}
					*/
				}
			}
		}
		var lis = s.getElementsByTagName('li');
		for(var i=0;i<lis.length;i++){
			lis[i].onmouseover = function(){
				this.style.backgroundPosition = 'left -40px';
				this.onmouseout = function(){
					this.style.backgroundPosition = 'left -60px';
				}
			}
		}
		var as = s.getElementsByTagName('a');
		for(var i=0;i<as.length;i++){
			as[i].onclick = function(){
				var currentSpan = domovie.event.get('currentWork');
				currentSpan.innerHTML = this.innerHTML;
			};
		}
	},
	index:function(s){
		var as = s.getElementsByTagName('a');
		for(var i=0;i<as.length;i++){
			as[i].onclick = function(){
				var currentSpan = domovie.event.get('currentWork');
				currentSpan.innerHTML = this.innerHTML;
			};
		}
	}
}
domovie.channel = {
	current:{
		menu:'',
		init:false
	},
	show:function(menu){
		if(!domovie.channel.current.init){domovie.channel.init(menu);};
		var domovie_menu = domovie.event.get('domovie-menu');
		var domovie_list = domovie.event.get('domovie-list');
		if(domovie.channel.current.menu&&typeof(domovie.channel.events[domovie.channel.current.menu])=='object'){
			var old_li = domovie.event.get(domovie.channel.current.menu);old_li.setAttribute('class','mBnone');old_li.setAttribute('className','mBnone');
			var old_a = domovie.event.get(domovie.channel.current.menu+'-link');old_a.setAttribute('class','cBnone');old_a.setAttribute('className','cBnone');
			domovie_list.innerHTML = '';
		}
		var new_li = domovie.event.get(menu);new_li.setAttribute('class','mB'+menu);new_li.setAttribute('className','mB'+menu);
		var new_a = domovie.event.get(menu+'-link');new_a.setAttribute('class','cB'+menu);new_a.setAttribute('className','cB'+menu);
		var domovie_area = document.createElement('div');
		domovie_area.setAttribute('class','menu-dmns mB'+menu);domovie_area.setAttribute('className','menu-dmns mB'+menu);
		for(var menu_list in domovie.channel.events[menu]['item']){
			if(domovie.channel.events[menu]['item'][menu_list]['name']&&domovie.channel.events[menu]['item'][menu_list]['link']){
				var menu_li = document.createElement('li');
				var menu_a = document.createElement('a');
				menu_a.setAttribute('class','cB'+menu);menu_a.setAttribute('className','cB'+menu);
				menu_a.setAttribute('href',domovie.channel.events[menu]['item'][menu_list]['link']);
				menu_a.innerHTML = domovie.channel.events[menu]['item'][menu_list]['name'];
				menu_li.appendChild(menu_a);domovie_area.appendChild(menu_li);
			}
		}
		domovie_list.appendChild(domovie_area);
		domovie.channel.current.menu = menu;
	},
	init:function(menu){
		var domovie_menu = domovie.event.get('domovie-menu');
		var domovie_list = domovie.event.get('domovie-list');
		for(var menu_list in domovie.channel.events){
			var menu_li = document.createElement('li');
			var menu_a = document.createElement('a');
			menu_li.setAttribute('id',menu_list);menu_a.setAttribute('id',menu_list+'-link');
			menu_li.setAttribute('class','mBnone');menu_li.setAttribute('className','mBnone');
			menu_a.setAttribute('class','cBnone');menu_a.setAttribute('className','cBnone');
			if(domovie.channel.events[menu_list]['link']){
				menu_a.setAttribute('href',domovie.channel.events[menu_list]['link']);
			}
			menu_a.innerHTML = domovie.channel.events[menu_list]['name'];
			menu_li.appendChild(menu_a);domovie_menu.appendChild(menu_li);
			menu_li.onmouseover = function(){
				domovie.channel.show(this.id);
			};
		};
		domovie.channel.current.init = true;
		for(var menu_list in domovie.channel.events){
			if(domovie.channel.events[menu_list]['index']){
				domovie.channel.show(menu_list);
			}
		};
		if(menu&&typeof(domovie.channel.events[menu])=='object'){
			domovie.channel.show(menu);
		}
	}
}
domovie.event = {
	get:function(f){
		if(!f||!document.getElementById(f)){return false;};
		return document.getElementById(f);
	},
	mouse:function(){
		var t,l,w,h;          
		if(document.documentElement && document.documentElement.scrollTop) {         
			t = document.documentElement.scrollTop;         
			l = document.documentElement.scrollLeft;         
			w = document.documentElement.scrollWidth;         
			h = document.documentElement.scrollHeight;     
		}else if(document.body) {         
			t = document.body.scrollTop;         
			l = document.body.scrollLeft;         
			w = document.body.scrollWidth;         
			h = document.body.scrollHeight;    
		}
		return {"t":t,"l":l,"w":w,"h":h};
	},
	topmouse:function(){
		var t,l,w,h;          
		if(window.top.document.documentElement && window.top.document.documentElement.scrollTop) {         
			t = window.top.document.documentElement.scrollTop;         
			l = window.top.document.documentElement.scrollLeft;         
			w = window.top.document.documentElement.scrollWidth;         
			h = window.top.document.documentElement.scrollHeight;     
		}else if(window.top.document.body) {         
			t = window.top.document.body.scrollTop;         
			l = window.top.document.body.scrollLeft;         
			w = window.top.document.body.scrollWidth;         
			h = window.top.document.body.scrollHeight;    
		}
		return {"t":t,"l":l,"w":w,"h":h};
	},
	screen:function(s){
		h = parseInt(document.documentElement.clientHeight);
		w = parseInt(document.documentElement.clientWidth);
		return {'width':w,'height':h};
	},
	topscreen:function(s){
		h = parseInt(window.top.document.documentElement.clientHeight);
		w = parseInt(window.top.document.documentElement.clientWidth);
		return {'width':w,'height':h};
	}
}

domovie.panel = {
	show:function(f,unit){
		if(!domovie.event.get(f)){return false;};
		var s = domovie.event.get(f);
		if(s.style.display == 'block'){s.style.display = 'none';return false;};
		var screen = domovie.event.screen();
		if(unit){
			s.style.right = (screen['width']-950)/2 + unit + 'px';
		}
		s.style.display = 'block';
		if(domovie.event.get(f+'-close')){
			var close = domovie.event.get(f+'-close');
			close.onclick = function(){
				s.style.display = 'none';
			}
		}
	},
	
	showlink:function(f,unit,tid,tname,uid,ispay,state){
		if(!uid){alert("请先登陆");return false};
		if(!ispay){alert("您不是付费会员，不能查看");return false};
		if(state!=1){alert("您的帐号没有审核通过，不能查看");return false};
		if(!tid){return false};
		if(!tname){return false};
		//if(!domovie.event.get(f)){return false;};
	
		var url="user.getcontacts.php?uid="+uid+"&tid="+tid+"&tname="+tname;
		//var url="user.getcontacts.php?uid=1&tname=partiv&tid=1";
		var xml = domovie.panel.xml();
		if(xml!=null){
			xml.onreadystatechange = function(){
				if(xml.readyState==4){
					if(xml.status==200){
						var data =eval('(' + xml.responseText + ')');
						if(data.msg){
							alert(data.msg);return false;
						}else{
							var pdiv = document.createElement('div');
							var content='';
							pdiv.id=f;
							pdiv.style.display = 'block';
							if(unit){
								pdiv.style.right = (screen['width']-950)/2 + unit + 'px';
							}
							if(data.linkunit){
								content+='<div class="m-line"><div class="m-name">联系单位：</div><div class="m-content">'+data.linkunit+'</div></div>';
							}
							if(data.address){
								content+='<div class="m-line"><div class="m-name">地址：</div><div class="m-content">'+data.address+'</div></div>';
							}
							if(data.contact){
								content+='<div class="m-line"><div class="m-name">联系人：</div><div class="m-content">'+data.contact+'</div></div>';
							}
							if(data.phone){
								content+='<div class="m-line"><div class="m-name">电话：</div><div class="m-content">'+data.phone+'</div></div>';
							}
							if(data.mobile){
								content+='<div class="m-line"><div class="m-name">手机：</div><div class="m-content">'+data.mobile+'</div></div>';
							}
							if(data.email){
								content+='<div class="m-line"><div class="m-name">邮箱：</div><div class="m-content">'+data.email+'</div></div>';
							}
							if(data.qq){
								content+='<div class="m-line"><div class="m-name">QQ：</div><div class="m-content">'+data.qq+'</div></div>';
							}
							if(data.qqmsn){
								content+='<div class="m-line"><div class="m-name">QQ/MSN：</div><div class="m-content">'+data.qqmsn+'</div></div>';
							}
							if(data.msn){
								content+='<div class="m-line"><div class="m-name">MSN：</div><div class="m-content">'+data.msn+'</div></div>';
							}
							if(data.address){
								content+='<div class="m-line"><div class="m-name">地址：</div><div class="m-content">'+data.address+'</div></div>';
							}
							
							if(data.code){
								content+='<div class="m-line"><div class="m-name">邮码：</div><div class="m-content">'+data.code+'</div></div>';
							}
							content += '<div class="m-menu"><div class="m-title"></div><div class="m-close" id="m-content-close">关闭</div></div>';
							pdiv.innerHTML=content;
							document.body.appendChild(pdiv);
							if(domovie.event.get(f+'-close')){
								var close = domovie.event.get(f+'-close');
								close.onclick = function(){
									document.body.removeChild(pdiv);
								}
							}
		
						}
					}else{}
				}else{}
			}
			xml.open("GET",url,true);
			xml.send(null);
		}else{
			alert("您的浏览器不支持AJAX");
		}
	},
	xml:function(){
		var xmlhttp=null;
		if(window.XMLHttpRequest){
			xmlhttp = new XMLHttpRequest();
		}else if(window.ActiveXObject){
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		return xmlhttp;
	},
	current:false,
	user:function(){
		var screen = domovie.event.screen();
		var panel = document.createElement('div');
		panel.style.position = 'absolute';
		panel.style.width = '760'+'px';
		panel.style.height = 1000+'px';
		panel.style.left = (parseInt(screen.width)-parseInt(panel.style.width))/2+'px';
		panel.style.top = '100'+'px';
		panel.style.backgroundColor = '#DDD';
		var frame = document.createElement('iframe');
		frame.setAttribute('frameborder','0');
		frame.src = './user.panel.php';
		frame.style.width = panel.style.width;
		frame.style.height = panel.style.height;
		panel.appendChild(frame);
		var close = document.createElement('div');
		close.style.position = 'absolute';
		close.style.top = '10px';
		close.style.right = '10px';
		close.innerHTML = '<span style="color:#000;cursor:pointer;background:#FFF;padding:6px">关闭简历</span>';
		panel.appendChild(close);
		close.onclick = function(){
			document.body.removeChild(panel);
		}
		document.body.appendChild(panel);
	},
	alertform:function(url,w,h,state,uid){
		if(!uid){alert('请先登陆！');return false;}
		var screen = domovie.event.screen();
		var mouse = domovie.event.mouse();
		var panel = document.createElement('div');
		panel.setAttribute('id','reportid');
		panel.style.position = 'absolute';
		panel.style.width = (w?w:300)+'px';
		panel.style.height = (h?h:150)+'px';
		panel.style.left = (parseInt(screen.width)-parseInt(panel.style.width))/2+'px';
		panel.style.top =  mouse.t +100+'px';
		panel.style.backgroundColor = '#DDD';
		panel.style.border = '1px solid #DDD';
		panel.style.padding = 6 + 'px';
		panel.style.zIndex = 10000;
		var frame = document.createElement('iframe');
		frame.setAttribute('frameBorder','0');frame.frameBorder = '0';
		frame.src = "./"+url;
		frame.style.width = panel.style.width;
		frame.style.height = panel.style.height;
		frame.style.backgroundColor = '#FFFFFF';
		panel.appendChild(frame);
		var close = document.createElement('div');
		close.style.position = 'absolute';
		close.style.top = '5px';
		close.style.right = '0px';
		close.innerHTML = '<span style=" background-color:#DDD;width:25px;height:30px;color:#000;cursor:pointer;margin-right:24px;padding:2px;">关闭</span>';
		panel.appendChild(close);
		close.onclick = function(){
			document.body.removeChild(panel);
		}
		document.body.appendChild(panel);
	},
	alertparentform:function(url,w,h,state,uid){
		if(!uid){alert('请先登陆！');return false;}
		var screen = domovie.event.topscreen();
		var mouse = domovie.event.topmouse();
		var panel = document.createElement('div');
		panel.setAttribute('id','reportid');
		panel.style.position = 'absolute';
		panel.style.width = (w?w:300)+'px';
		panel.style.height = (h?h:150)+'px';
		panel.style.left = (parseInt(screen.width)-parseInt(panel.style.width))/2+'px';
		panel.style.top =  mouse.t +100+'px';
		panel.style.backgroundColor = '#DDD';
		panel.style.border = '1px solid #DDD';
		panel.style.padding = 6 + 'px';
		panel.style.zIndex = 10000;
		var frame = document.createElement('iframe');
		frame.setAttribute('frameBorder','0');frame.frameBorder = '0';
		frame.src = "./"+url;
		frame.style.width = panel.style.width;
		frame.style.height = panel.style.height;
		frame.style.backgroundColor = '#FFFFFF';
		panel.appendChild(frame);
		var close = document.createElement('div');
		close.style.position = 'absolute';
		close.style.top = '5px';
		close.style.right = '0px';
		close.innerHTML = '<span style=" background-color:#DDD;width:25px;height:30px;color:#000;cursor:pointer;margin-right:24px;padding:2px;">关闭</span>';
		panel.appendChild(close);
		close.onclick = function(){
			window.top.document.body.removeChild(panel);
		}
		window.top.document.body.appendChild(panel);
	},
	init:function(s,m,w,h,state,uid,fid,fclass,fname){
		if(!uid){alert('请先登陆！');return false;}
		//if(!fid){alert('帖子ID为空！');return false;}
		//if(!fclass){alert('版块样子为空！');return false;}
		//if(!fname){alert('版块名称为空！');return false;}
		if(domovie.panel.current){
			var current = domovie.event.get(domovie.panel.current+'-area');
			current.parentNode.removeChild(current);
			domovie.panel.current = false;
		}
		var mouse = domovie.event.mouse();
		var screen = domovie.event.screen();
		var event = document.createElement('div');
		event.setAttribute('id',s+'-area');
		event.style.width = (w?w:300)+'px';
		event.style.height = (h?h:150)+'px';
		event.style.position = 'absolute';
		event.style.top = mouse.t + 100 + 'px';
		event.style.left = (parseInt(screen.width)-parseInt(event.style.width))/2+'px';
		var content = '<form action="report.save.php" method="post" onsubmit="if(!this.content.value){return false;}"><table cellspacing="0" cellpadding="0" style="border:6px solid #DDD;background:#EEE;width:300px;"><tr style="height:30px;"><td style="width:80px;font-weight:bold;text-align:left;padding-left:12px;">版主举报</td><td style="text-align:right;width:220px;padding-right:12px;"><span style="cursor:pointer;" onclick="domovie.panel.remove();">关闭</span></td></tr><tr style="height:60px;"><td style="width:80px;text-align:right;width:90px;">举报内容：</td><td style="text-align:left;"><input type="hidden" name="uid" id="uid" value="'+uid+'"><input type="hidden" name="fid" id="fid" value="'+fid+'"><input type="hidden" name="fclass" id="fclass" value="'+fclass+'"><input type="hidden" name="fname" id="fname" value="'+fname+'"><textarea name="content" id="content" style="width:200px;height:80px;"></textarea></td></tr><tr style="height:40px;"><td>&nbsp;</td><td style="text-align:left;"><input type="submit" style="width:57px;height:22px;background:url(\'./resource/images/bi-btns.gif\') left center no-repeat;" id="subreport" value="报告"></td></tr></table></form>';
		event.innerHTML = state?content:'';
		document.body.appendChild(event);
		domovie.panel.current = s;
	},
	remove:function(){
		var current = domovie.event.get(domovie.panel.current+'-area');
		current.parentNode.removeChild(current);
		domovie.panel.current = false;
	}
}

domovie.forum = {
	list:function(s,n){
		var tree = s;
		s.onclick = function(){
			var style = this.className;
			if(n==0){return false;};
			if(style=='open'){
				this.setAttribute('class','close');this.setAttribute('className','close');
				for(i=0;i<n;i++){
					var list = domovie.event.get(s.id+'_'+i);
					list.style.display = "none";
				}
			}else{
				this.setAttribute('class','open');this.setAttribute('className','open');
				for(i=0;i<n;i++){
					var list = domovie.event.get(s.id+'_'+i);
					list.style.display = "block";
				}
			}
		}
	},
	show:{
		index:false,
		speed:2000,
		init:function(s,n){
			domovie.forum.show.set(s+'-1');
			for(var i=1;i<=n;i++){
				if(domovie.event.get(s+'-'+i)){
					if(i==1){
						domovie.forum.show.set(s+'-'+i);	
					}
					var btn = domovie.event.get(s+'-'+i);
					btn.onclick = function(){
						domovie.forum.show.set(this.id);
					}		
				}
			}
			var j = 1;
			var marquee = setInterval(function(){
				j++;if(j>n)j=1;
				domovie.forum.show.set(s+'-'+j);
			},domovie.forum.show.speed);
		},
		set:function(s){
			//document.title = s;
			if(domovie.forum.show.index){
				var btn_r = domovie.event.get(domovie.forum.show.index);btn_r.setAttribute('class','onmouseoute');btn_r.setAttribute('className','onmouseoute');
				var img_r = domovie.event.get(domovie.forum.show.index+'-icon');img_r.style.display = 'none';
				var txt_r = domovie.event.get(domovie.forum.show.index+'-text');txt_r.style.display = 'none';
			}
			var btn_c = domovie.event.get(s);btn_c.setAttribute('class','onmouseover');btn_c.setAttribute('className','onmouseover');
			var img_c = domovie.event.get(s+'-icon');img_c.style.display = 'block';
			var txt_c = domovie.event.get(s+'-text');txt_c.style.display = 'block';
			domovie.forum.show.index = s;
		},
		loop:function(s,i,n){
		}
	},
	move:{
		speed:{fast:5,slow:1},
		init:function(s,w,auto){
			var event = domovie.event.get(s);
			var content = event.innerHTML;event.innerHTML = '';
			var start = document.createElement('div');start.setAttribute('id',s+'-start');
			var begin = document.createElement('div');begin.setAttribute('id',s+'-begin');
			var ender = document.createElement('div');ender.setAttribute('id',s+'-ender');
			start.style.styleFloat = start.style.cssFloat = begin.style.styleFloat = begin.style.cssFloat = ender.style.styleFloat = ender.style.cssFloat = 'left';
			start.style.width = w*4+'px';
			begin.innerHTML = ender.innerHTML = content;
			event.appendChild(start);start.appendChild(begin);start.appendChild(ender);
			var marquee = setInterval(function(){domovie.forum.move.marquee(start,begin,ender,w,domovie.forum.move.speed.slow);},10);
			start.onmouseover = function(){
				clearInterval(marquee);
			}
			start.onmouseout = function(){
				marquee = setInterval(function(){domovie.forum.move.marquee(start,begin,ender,w,domovie.forum.move.speed.slow);},10);
			}
			if(domovie.event.get(s+'-left')){
				var left = domovie.event.get(s+'-left');
				left.onmousedown = function(){
					clearInterval(marquee);
					marquee = setInterval(function(){domovie.forum.move.marquee(start,begin,ender,w,domovie.forum.move.speed.fast);},10);
				}
				left.onmouseup = function(){
					clearInterval(marquee);
					marquee = setInterval(function(){domovie.forum.move.marquee(start,begin,ender,w,domovie.forum.move.speed.slow);},10);
				}
			}
			if(domovie.event.get(s+'-right')){
				var right = domovie.event.get(s+'-right');
				right.onmousedown = function(){
					clearInterval(marquee);
					marquee = setInterval(function(){domovie.forum.move.marquee_r(start,begin,ender,w,domovie.forum.move.speed.fast);},10);
				}
				right.onmouseup = function(){
					clearInterval(marquee);
					marquee = setInterval(function(){domovie.forum.move.marquee_r(start,begin,ender,w,domovie.forum.move.speed.slow);},10);
				}
			}
		},
		marquee:function(start,begin,ender,w,u){
			if(parseInt(start.style.marginLeft)+parseInt(start.style.width)>=w){
				start.style.marginLeft = parseInt(start.style.marginLeft)-u+'px';
			}else{
				start.style.marginLeft = 0-w*2+'px';
			}
		},
		marquee_r:function(start,begin,ender,w,u){
			if(parseInt(start.style.marginLeft)+parseInt(start.style.width)>=4*w){
				start.style.marginLeft = 0-w*2+'px';
			}else{
				start.style.marginLeft = parseInt(start.style.marginLeft)+u+'px';
			}
		}
	}
}

var dm = {
	tab:{
		common:false,
		init:function(f,n,t){
			for(var i=0;i<n;i++){
				var tab = f+'_tab_'+i;
				var sub = f+'_div_'+i;
				var event = document.getElementById(tab);
				if(!t){
					event.onclick = function(){
						dm.tab.change(f,this.id,n);
					};
				}else{
					event.onmouseover = function(){
						dm.tab.change(f,this.id,n);
					};
				}
			}
		},
		change:function(f,tab,n){
			var s = 0;
			for(var i=0;i<n;i++){
				if(document.getElementById(f+'_tab_'+i)){
					var tab_old = document.getElementById(f+'_tab_'+i);
					tab_old.setAttribute('class','onmouseoute');tab_old.setAttribute('className','onmouseoute');
				}
				if(document.getElementById(f+'_div_'+i)){
					var sub_old = document.getElementById(f+'_div_'+i);
					sub_old.style.display = 'none';
				}
				if((f+'_tab_'+i)==tab){s = i;};
			};
			if(document.getElementById(tab)){
				var tab_new = document.getElementById(tab);
				tab_new.setAttribute('class','onmouseover');tab_new.setAttribute('className','onmouseover');
			};
			if(document.getElementById(f+'_div_'+s)){
				var sub_new = document.getElementById(f+'_div_'+s);
				sub_new.style.display = 'block';
			};
		}
	}
}
