$("[name=PicFlag]").change(function(){
	$("[name=PicDiv]").toggle()
})
</script>
<div id="Colorpanel" style="position: absolute; left: 0; top: 0; z-index: 1000;"></div>
<script>
var ColorHex=new Array('00','33','66','99','CC','FF')
var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF')
var current=null
function intoColor(dddd,ssss,ffff)
{	
    var ColorTable=''
    for (i=0;i<2;i++)
    {
        for (j=0;j<6;j++)
        {
            ColorTable=ColorTable+'  <tr>'
            ColorTable=ColorTable+'    <td style="width:12px; height:12px; background-Color: #000000;">'
            if (i==0){
                ColorTable=ColorTable+'    <td style="width:12px; height:12px; background-Color: #'+ColorHex[j]+ColorHex[j]+ColorHex[j]+';">'
            }
            else{
                ColorTable=ColorTable+'    <td style="width:12px; height:12px; background-Color: #'+SpColorHex[j]+';">'
            }
            ColorTable=ColorTable+'    <td style="width:12px; height:12px; background-Color: #000000;">'
            for (k=0;k<3;k++)
            {
                for (l=0;l<6;l++)
                {
                    ColorTable=ColorTable+'    <td style="width:12px; height:12px; background-Color: #'+ColorHex[k+i*3]+ColorHex[l]+ColorHex[j]+';">'
                }
            }
        }
    }
    ColorTable='<table width="253" border="0" cellspacing="0" cellpadding="0" style="border: 1px #000000 solid; border-bottom: none; border-collapse: collapse;" borderColor="000000">'
    +'  <tr height="30">'
    +'    <td colspan="21" bgColor="#cccccc"><table width="100%" cellpadding="0" cellspacing="1" border="0" style="border-collapse: collapse;">'
    +'        <tr>'
    +'          <td width="3"></td>'
    +'          <td><input type="text" id="DisColor" name="DisColor" size="6" disabled style="border: solid 1px #000000; background-Color: #ffff00;"></td>'
    +'          <td width="3"></td>'
    +'          <td><input type="text" id="HexColor" name="HexColor" size="7" style="border: inset 1px; font-family: Arial;" value="#000000">&nbsp;&nbsp;&nbsp;&nbsp;系统选色版</td>'
    +'          <td width="20" style="cursor:pointer" onclick="document.getElementById(\'Colorpanel\').style.visibility=\'hidden\'" title=\' 关闭\'>╳</td>'
    +'        </tr>'
    +'      </table></td>'
    +'</table>'
    +'<table border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse; cursor: pointer;" borderColor="000000" onmouseover="doOver(event)" onmouseout="doOut()" onclick="doclick(\''+dddd+'\',\''+ssss+'\',\''+ffff+'\',event)">'
    +ColorTable+'</table>';
    Colorpanel.innerHTML=ColorTable
}
function doOver(e) {
	if( !e ) e = window.event;
	var Colorxs = e.target||e.srcElement; 
	
    if ((Colorxs.tagName=="TD") && (current!=Colorxs)) {
        if (current!=null){
            current.style.backgroundColor = current._BackGround
        }
        Colorxs._BackGround = Colorxs.style.backgroundColor
		
		document.getElementById("DisColor").style.backgroundColor= Colorxs.style.backgroundColor
		document.getElementById("HexColor").value= Colorxs.style.backgroundColor
		Colorxs.style.backgroundColor = "white"
        current = Colorxs
    }
}
function doOut() {
    if (current!=null) current.style.backgroundColor = current._BackGround
}

function doclick(dddd,ssss,ffff,e){
	if( !e ) e = window.event;
	var Colorxs = e.target||e.srcElement; 

    if (Colorxs.tagName=="TD"){
        document.getElementById(ssss).value=Colorxs._BackGround
		document.getElementById(ffff).style.color=Colorxs._BackGround
		
		Colorxs.style.backgroundColor=Colorxs._BackGround
		document.getElementById("Colorpanel").style.visibility="hidden"
        return Colorxs._BackGround
    }
}
var Colorxs

function Colorcd(dddd,ssss,ffff,e){
	var Colorpanel=document.getElementById("Colorpanel")
	
	if( !e ) e = window.event;
	var Colorxs = e.target||e.srcElement; 

	var x=e.clientX
    var y=e.clientY
	
    var rightedge = document.body.clientWidth-x;
    var bottomedge = document.body.clientHeight-y;
	if (rightedge < Colorpanel.offsetWidth){
    	var palLeft = document.body.scrollLeft + x - Colorpanel.offsetWidth;
		Colorpanel.style.left = palLeft+'px'
	}
    else{
    	var palLeft = document.body.scrollLeft + x;
		Colorpanel.style.left = palLeft+'px'
	}
    
	if (bottomedge < Colorpanel.offsetHeight){
    	var palTop = document.body.scrollTop + y - Colorpanel.offsetHeight;
		Colorpanel.style.top = palTop + 'px'
	}
    else{
		var ScrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;   
		var palTop = ScrollTop + y;
		Colorpanel.style.top = palTop + 'px'
	}
	
	Colorpanel.style.visibility = "visible";
	
    e.cancelBubble=true
    intoColor(dddd,ssss,ffff)
    return false
}
function clear_color() {
	$('#Title').css('color','');
	$('#TitleFontColor').val('');
	$('#colorpanel_title').html(' ');
}