                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

if(!window.__td){window.__MT=100;window.__ti=0;window.__td=[];window.__td.length=__MT;window.__noTrace=false;}
if(typeof(vp)=="undefined")
{var vp={};}
if(!vp.studio)
{vp.studio={};}
vp.studio.ColorPicker=function studio_ColorPicker(oElement)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var me=this;this.element=oElement;var _aColors=["231F20","9E280E","8A713C","007236","007D97","2E3092","5D1E79","4C4C4E","88191C","F5821F","727C28","1E9860","00837D","0071BC","7C51A1","939598","ED1C24","FCAF17","A5A85A","57BD7C","57C5C7","00AEEF","AA4A9C","A7A9AC","EC008C","FFCE71","FFF200","BED630","95D5D1","42C7F4","BC7BB5","DCDDDE","F49AC1","FEDCC6","FFF78F","E5F0CB","E2F3F4","9FC9EB","C7B2D6","FFFFFF"];var _aGrays=['000000','111111','222222','333333','444444','555555','666666','777777','FFFFFF','EEEEEE','DDDDDD','CCCCCC','BBBBBB','AAAAAA','999999','888888'];var _aSchemes=['000000','333333','666666','999999','CCCCCC','FFFFFF'];this.selectedColor=null;this.renderInParentWindow=false;this.showSchemes=true;this.onbeforeshowmenu=new vp.events.CustomEvent(this,"onbeforeshowmenu");this.onselectcolor=new vp.events.CustomEvent(this,"onselectcolor");var getTargetWindow=function pv_getTargetWindow()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
return me.renderInParentWindow?vp.dialog.getParent():window;};var render=function pv_render()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oMenu=getTargetWindow().document.__colorPickerMenu;if(!oMenu)
{oMenu=getTargetWindow().document.createElement("DIV");oMenu.style.position="absolute";oMenu.style.textAlign="left";oMenu.style.left="0px";oMenu.style.width="215px";oMenu.style.padding="10px";oMenu.style.border="1px black solid";oMenu.style.backgroundColor="white";oMenu.style.visibility="hidden";oMenu.style.zIndex=10000100;if(this.showSchemes)
{var oSchemeText=getTargetWindow().document.createElement("SPAN");oSchemeText.innerHTML=JSLM_VPLSJSColorPickerScheme;oSchemeText.style.margin=4;oMenu.appendChild(oSchemeText);me.schemeElement=getTargetWindow().document.createElement("DIV");me.schemeElement.style.width="100%";me.schemeElement.style.borderBottom="1px black solid";me.schemeElement.style.paddingBottom="8px";me.schemeElement.style.marginBottom="8px";me.schemeElement.style.height="30px";oMenu.appendChild(me.schemeElement);var i;for(i=0;i<_aSchemes.length;i++)
{me.schemeElement.appendChild(getSwatch(_aSchemes[i]));}}
for(i=0;i<_aColors.length;i++)
{oMenu.appendChild(getSwatch(_aColors[i]));}
var oBottom=getTargetWindow().document.createElement("DIV");oBottom.style.clear="both";oBottom.style.height="30px";oBottom.style.paddingTop="15px";oBottom.style.textAlign="center";var oCancelButton=getTargetWindow().document.createElement("A");oCancelButton.href="#";oCancelButton.innerHTML=JSLM_CancelButton;getTargetWindow().document.__colorPickerMenuCancelButton=oCancelButton;var oMoreColorsButton=getTargetWindow().document.createElement("A");oMoreColorsButton.href="#";oMoreColorsButton.innerHTML=JSLM_VPLSJSColorPickerMore;oMoreColorsButton.style.marginRight=20;getTargetWindow().document.__colorPickerMenuMoreColorsButton=oMoreColorsButton;if(me.allowUserEnteredColors)
{var oEnterColorLink=getTargetWindow().document.createElement("A");oEnterColorLink.href="#";oEnterColorLink.innerHTML="Enter color...";oEnterColorLink.style.marginRight=10;var fnOnClick=function pv_fnOnClick(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var sNewColor=vp.studio.ColorPicker.promptForHexColor(me.selectedColor);if(sNewColor)
{selectColor(sNewColor);}
else
{cancel();}};oEnterColorLink.onclick=fnOnClick;oBottom.appendChild(oEnterColorLink);}
oBottom.appendChild(oMoreColorsButton);oBottom.appendChild(oCancelButton);oMenu.appendChild(oBottom);getTargetWindow().document.body.appendChild(oMenu);}
me.menuElement=oMenu;me.cancelButton=getTargetWindow().document.__colorPickerMenuCancelButton;me.moreColorsButton=getTargetWindow().document.__colorPickerMenuMoreColorsButton;};var getSwatch=function pv_getSwatch(sColor)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oColor=getTargetWindow().document.createElement("DIV");vp.ui.setStyleValue(oColor,"float","left");oColor.style.position="relative";oColor.style.width="20px";oColor.style.height="20px";oColor.style.margin=2;oColor.style.lineHeight=1;oColor.style.fontSize=1;oColor.style.border="1px black solid";oColor.unselectable="on";oColor.setColor=function(sValue)
{if(sValue.indexOf("#")!==0)
{sValue="#"+sValue;}
this.style.backgroundColor=sValue;this.colorValue=sValue;}.getClosure(oColor);oColor.setColor(sColor);vp.events.add(oColor,"click",colorClickHandler);return oColor;};this.openMoreColorsWin=function pb_this_openMoreColorsWin(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var iCallbackID=vp.win.createCallbackHandler(selectColor);var oURL="/vp/ns/color_picker.aspx?cbid="+iCallbackID+"&initial_color="+vp.web.urlEncode(me.selectedColor);vp.studio.ui.openDialog("ColorPickerDialog",JSLM_VPLSJSColorPickerMore,oURL,vp.dialog.chrome.Primary,520,250,{scrollType:DIALOG_SCROLL_TYPE_NO});vp.events.cancelEvent(e);};var _bIsRendered;var onClickHandler=function pv_onClickHandler(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!_bIsRendered)
{render();_bIsRendered=true;}
if(me.isOpen)
{me.hideMenu(e);}
else
{me.showMenu(e);}};var cancel=function pv_cancel(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
me.hideMenu();vp.events.cancel(e);};var _sOriginalTooltip;this.hideMenu=function pb_this_hideMenu(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!me.menuElement)
{return;}
me.element.title=_sOriginalTooltip;me.menuElement.style.visibility="hidden";me.isOpen=false;vp.events.remove(vp.ui.getRootElement(),"click",me.hideMenu);vp.events.remove(me.menuElement,"mousedown",vp.events.cancelBubble);vp.events.remove(me.cancelButton,"click",cancel);vp.events.remove(me.moreColorsButton,"click",me.openMoreColorsWin);};this.showMenu=function pb_this_showMenu(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
e=vp.events.getEvent(e);me.onbeforeshowmenu.fire(e);if(e.cancelShow)
{return;}
if(e.position)
{me.menuElement.style.top=e.position.top;me.menuElement.style.left=e.position.left;}
else
{var oRect=vp.ui.getRect(me.element);me.menuElement.style.top=oRect.bottom-1;me.menuElement.style.left=oRect.left;}
_sOriginalTooltip=me.element.title;me.element.title="";me.menuElement.style.visibility="visible";me.isOpen=true;vp.events.add(me.menuElement,"mousedown",vp.events.cancelBubble);vp.events.add(me.cancelButton,"click",cancel);vp.events.add(me.moreColorsButton,"click",me.openMoreColorsWin);var fnSetEvent=function pv_fnSetEvent()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.events.add(vp.ui.getRootElement(),"click",me.hideMenu);};window.setTimeout(fnSetEvent,100);};this.setCustomColors=function pb_this_setCustomColors(aCustomColors)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
_aSchemes=aCustomColors;if(me.schemeElement)
{var iLen=Math.min(me.schemeElement.childNodes.length,aCustomColors.length);for(var i=0;i<iLen;i++)
{me.schemeElement.childNodes[i].setColor(aCustomColors[i]);}}};var selectColor=function pv_selectColor(sColor)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
me.selectedColor=sColor.toUpperCase();me.onselectcolor.fire();};var colorClickHandler=function pv_colorClickHandler(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
e=vp.events.getEvent(e);selectColor(e.target.colorValue);me.hideMenu();vp.events.cancel(e);};vp.events.add(me.element,"mouseup",onClickHandler);this.addActivator=function pb_this_addActivator(oElement)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.events.add(oElement,"mousedown",onClickHandler);};};vp.studio.ColorPicker.promptForHexColor=function studio_ColorPicker_promptForHexColor(sInitialColor)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(sInitialColor)
{if(sInitialColor.indexOf("#")!==0)
{sInitialColor="#"+sInitialColor;}}
else
{sInitialColor="";}
var sVal=prompt("Hex color",sInitialColor);if(sVal)
{if(!vp.color.validateHex(sVal))
{alert("Invalid format. Please use a hexadecimal color value (i.e. #FFEEDD).");return arguments.callee(sVal);}
else
{return sVal;}}
else
{return null;}};