//这个是颜色选择模版的封装对象，只支持在ie中使用。
//使用时只需要调用SelColor.SetTargetId('targetid')通过设置不同的targetid就可以对不同的id赋选中的颜色值。
var SelColor={
	//定义iframe的id注意id在window中的唯一性
	id:"fr123456",
	//判断是否已经进行初始化
	existFlag:false,
	//初始化
	init:function(){
		//设置弹出位置
		var curpos={x:event.clientX+10,y:event.clientY+10};
	    var tmp = document.createElement("iframe");
		//设置iframe显示的相关参数
		tmp.src='SelColor.html?dfadfsadsasdff';
		tmp.id=this.id;
		tmp.style.position="absolute";
		tmp.style.left=(curpos.x-160)+"px";
		tmp.style.top=curpos.y+"px";
		tmp.scrolling ="no";
		tmp.style.width="320px";
		tmp.style.height="220px";
		tmp.style.zindex='1000';
		tmp.frameBorder ="0px";
		//tmp.allowTransparency="true";
		document.body.appendChild(tmp);	
	},	
	//设置要给哪个id进行赋值
	targetId:"",
	SetTargetId:function(objid){
		//iframe不存在则自动创建
		if(!this.existFlag){
			this.existFlag=true;
			this.init();
		}
		this.targetId=objid;
		var curpos={x:event.clientX+10,y:event.clientY+10};
		var tmp=document.getElementById(this.id);
		tmp.style.left=curpos.x+"px";
		tmp.style.top=curpos.y+"px";
		if(tmp.style.display=="none"){
			tmp.style.display="block";
		}
	}	
	
	//,Add more
}
