var imageUrl="/_assets/img/icons/color.png";function iColorShow(id,id2){var eICP=jQuery("#"+id2).position();jQuery("#iColorPicker").css({}).fadeIn("fast");jQuery("#iColorPickerBg").css({}).fadeIn("fast");var def=jQuery("#"+id).val();jQuery("#colorPreview span").text(def);jQuery("#colorPreview").css("background",def);jQuery("#color").val(def);var hxs=jQuery("#iColorPicker");for(i=0;i<hxs.length;i++){var tbl=document.getElementById("hexSection"+i),tblChilds=tbl.childNodes;for(j=0;j<tblChilds.length;j++){var tblCells=tblChilds[j].childNodes;for(k=0;k<tblCells.length;k++)jQuery(tblChilds[j].childNodes[k]).unbind().mouseover(function(){var aaa="#"+jQuery(this).attr("hx");jQuery("#colorPreview").css("background",aaa);jQuery("#colorPreview span").text(aaa);jQuery("#"+id).val(aaa).css("background",aaa)}).click(function(){var aaa="#"+jQuery(this).attr("hx");jQuery("#"+id).val(aaa).css("background",aaa);jQuery("#iColorPickerBg").hide();jQuery("#iColorPicker").fadeOut();jQuery(this)})}}}this.iColorPicker=function(){jQuery("input.iColorPicker").each(function(i){if(i==0){jQuery(document.createElement("div")).attr("id","iColorPicker").css("display","none").html('<table class="pickerTable" id="pickerTable0"><thead id="hexSection0"><tr><td style="background:#f7e7e8" hx="f7e7e8"></td><td style="background:#f7ebe3" hx="f7ebe3"></td><td style="background:#f5ede1" hx="f5ede1"></td>\t<td style="background:#f5f4df" hx="f5f4df"></td><td style="background:#edf4df" hx="edf4df"></td><td style="background:#e2f3ef" hx="e2f3ef"></td><td style="background:#e5eef6" hx="e5eef6"></td><td style="background:#e1e6f2" hx="e1e6f2"></td><td style="background:#e4e0ef" hx="e4e0ef"></td><td style="background:#f8ebf9" hx="f8ebf9"></td><td style="background:#ffffff" hx="ffffff"></td></tr><tr><td style="background:#dfc9cb" hx="dfc9cb"></td><td style="background:#decdc2" hx="decdc2"></td><td style="background:#dacebb" hx="dacebb"></td><td style="background:#d9d7b4" hx="d9d7b4"></td><td style="background:#cfd9b9" hx="cfd9b9"></td><td style="background:#b4dad1" hx="b4dad1"></td><td style="background:#b1cce3" hx="b1cce3"></td><td style="background:#c0cbe6" hx="c0cbe6"></td><td style="background:#c5bddb" hx="c5bddb"></td><td style="background:#e1cee3" hx="e1cee3"></td><td style="background:#c7c7c7" hx="c7c7c7"></td></tr><tr><td style="background:#ae9092" hx="ae9092"></td><td style="background:#c3a998" hx="c3a998"></td><td style="background:#beae95" hx="beae95"></td>\t<td style="background:#cecb99" hx="cecb99"></td><td style="background:#b0bf90" hx="b0bf90"></td><td style="background:#7db0a5" hx="7db0a5"></td><td style="background:#7daed8" hx="7daed8"></td><td style="background:#95abe4" hx="95abe4"></td><td style="background:#aa9ad2" hx="aa9ad2"></td><td style="background:#c5a0c8" hx="c5a0c8"></td><td style="background:#7f7f7f" hx="7f7f7f"></td></tr><tr><td style="background:#684749" hx="684749"></td><td style="background:#977662" hx="977662"></td><td style="background:#938061" hx="938061"></td>\t<td style="background:#94915e" hx="94915e"></td><td style="background:#7b895f" hx="7b895f"></td><td style="background:#466e65" hx="466e65"></td><td style="background:#517a9b" hx="517a9b"></td><td style="background:#617bbf" hx="617bbf"></td><td style="background:#7f6fa3" hx="7f6fa3"></td><td style="background:#936797" hx="936797"></td><td style="background:#5b5b5b" hx="5b5b5b"></td></tr><tr><td style="background:#41292b" hx="41292b"></td><td style="background:#594335" hx="594335"></td><td style="background:#5f4f35" hx="5f4f35"></td>\t<td style="background:#595631" hx="595631"></td><td style="background:#495431" hx="495431"></td><td style="background:#2a4640" hx="2a4640"></td><td style="background:#2e4a60" hx="2e4a60"></td><td style="background:#3a4a73" hx="3a4a73"></td><td style="background:#4c3e71" hx="4c3e71"></td><td style="background:#4c3055" hx="4c3055"></td><td style="background:#353535" hx="353535"></td></tr><tr><td style="background:#211414" hx="211414"></td><td style="background:#2f2119" hx="2f2119"></td><td style="background:#382d1d" hx="382d1d"></td>\t<td style="background:#2e2d15" hx="2e2d15"></td><td style="background:#262c18" hx="262c18"></td><td style="background:#111f1c" hx="111f1c"></td><td style="background:#162029" hx="162029"></td><td style="background:#1b2337" hx="1b2337"></td><td style="background:#2a203f" hx="2a203f"></td><td style="background:#221222" hx="221222"></td><td style="background:#1a1a1a" hx="1a1a1a"></td></tr><tr><td style="background:#140b0b" hx="140b0b"></td><td style="background:#18110d" hx="18110d"></td><td style="background:#1c1509" hx="1c1509"></td>\t<td style="background:#0e0d06" hx="0e0d06"></td><td style="background:#10130a" hx="10130a"></td><td style="background:#09100e" hx="09100e"></td><td style="background:#0c1116" hx="0c1116"></td><td style="background:#0c101a" hx="0c101a"></td><td style="background:#16111b" hx="16111b"></td><td style="background:#0f0810" hx="0f0810"></td><td style="background:#000000" hx="000000"></td></tr></thead><tbody></tbody></table><style>#iColorPicker input{margin:2px}</style>').appendTo("#MetadataModal .modaltext");jQuery(document.createElement("div")).attr("id","iColorPickerBg").click(function(){jQuery("#iColorPickerBg").hide();jQuery("#iColorPicker").fadeOut()}).appendTo("#MetadataModal .modaltext");jQuery("table.pickerTable td").css({width:"5px",height:"10px",border:"1px solid #000",cursor:"pointer"});jQuery("#iColorPicker table.pickerTable").css({"border-collapse":"collapse"});jQuery("#iColorPicker").css({border:"1px solid #ccc",background:"#333",padding:"5px",color:"#fff"})}jQuery("#colorPreview").css({height:"50px"});jQuery(this).css("backgroundColor",jQuery(this).val()).after('<a href="javascript:void(null)" id="icp_'+this.id+'" onclick="iColorShow(\''+this.id+"','icp_"+this.id+'\')"><img src="'+imageUrl+'" style="border:0;margin:0 0 0 3px" align="middle" ></a>')})};jQuery(function(){iColorPicker()});