﻿function closedivs(_id){
	var cl=document.createElement('div');
	cl.style.position='absolute';
	cl.style.zIndex='999';
	cl.style.top='0';
	cl.style.left='0';
	cl.style.height='12px';
	cl.style.border='1px solid #000';
	cl.innerHTML='<a style="cursor:hand;color:red" onclick="javascript:document.getElementById(\''+_id+'\').style.display=\'none\';" title="关闭">×</a>';
	document.getElementById(_id).appendChild(cl);
}
function coupletL(imgpath,imgurl,width,height){
	if(document.body.offsetWidth>800){
		var ex=imgpath.substr(imgpath.lastIndexOf('.')+1);
		var vbody='';
		if(ex=='swf'){
			vbody='<EMBED src="'+imgpath+'" quality=high PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" WIDTH="'+width+'" HEIGHT="'+height+'" id="coupletadleft" wmode=opaque></EMBED>';
		}else{
			vbody='<a href="'+imgurl+'"><img src="'+imgpath+'" width="'+widht+'" height="'+height+'" border="0"></a>';
		}
		var obj=document.createElement('div');
		obj.id='coupletadleftdiv';
		obj.style.position='absolute';
		obj.style.zIndex='998';
		obj.style.top='10px';
		obj.style.left='5px';
		obj.style.width=width;
		obj.style.height=height;
		obj.innerHTML=vbody;
		document.body.appendChild(obj);
		closedivs(obj.id);
	}
}
function coupletR(imgpath,imgurl,width,height){
	if(document.body.offsetWidth>800){
		var ex=imgpath.substr(imgpath.lastIndexOf('.')+1);
		var vbody='';
		if(ex=='swf'){
			vbody='<EMBED src="'+imgpath+'" quality=high PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" WIDTH="'+width+'" HEIGHT="'+height+'" id="coupletadright" wmode=opaque></EMBED>';
		}else{
			vbody='<a href="'+imgurl+'"><img src="'+imgpath+'" width="'+widht+'" height="'+height+'" border="0"></a>';
		}
		var obj=document.createElement('div');
		obj.id='coupletadrightdiv';
		obj.style.position='absolute';
		obj.style.zIndex='998';
		obj.style.top='10px';
		obj.style.right='5px';
		obj.style.width=width;
		obj.style.height=height;
		obj.innerHTML=vbody;
		document.body.appendChild(obj);
		closedivs(obj.id);
	}
}
function justadL(imgpath,imgurl,width,height){    
	if(document.body.offsetWidth>800){
		var ex=imgpath.substr(imgpath.lastIndexOf('.')+1);
		var vbody='';
		if(ex=='swf'){
			vbody='<EMBED src="'+imgpath+'" quality=high PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" WIDTH="'+width+'" HEIGHT="'+height+'" id="justadleft" wmode=opaque></EMBED>';
		}else{
			vbody='<a href="'+imgurl+'"><img src="'+imgpath+'" width="'+widht+'" height="'+height+'" border="0"></a>';
		}
		var obj=document.createElement('div');
		obj.id='justadleftdiv';
		obj.style.position='absolute';
		obj.style.zIndex='998';
		obj.style.top='430px';
		obj.style.left='5px';
		obj.style.width=width+'px';
		obj.style.height=height+'px';
		obj.innerHTML=vbody;
		document.body.appendChild(obj);
		closedivs(obj.id);
	}
}
function justadR(imgpath,imgurl,width,height){
	if(document.body.offsetWidth>800){
	    
		var ex=imgpath.substr(imgpath.lastIndexOf('.')+1);
		var vbody='';
		if(ex=='swf'){
			vbody='<EMBED src="'+imgpath+'" quality=high PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" WIDTH="'+width+'" HEIGHT="'+height+'" id="justadright" wmode=opaque></EMBED>';
		}else{
			vbody='<a href="'+imgurl+'"><img src="'+imgpath+'" width="'+widht+'" height="'+height+'" border="0"></a>';
		}
		var obj=document.createElement('div');
		obj.id='justadrightdiv';
		obj.style.position='absolute';
		obj.style.zIndex='998';
		obj.style.top='430px';
		obj.style.right='5px';
		obj.style.width=width+'px';
		obj.style.height=height+'px';
		obj.innerHTML=vbody;
		document.body.appendChild(obj);
		closedivs(obj.id);
	}
}

