
function CanJobWidget_ShowPopup(iSelectedValue){MultiSelect.ChangeSelectedPath(iSelectedValue.toString());MultiSelect.Show(function(oState){var iLocations=0;var iCategories=0;var sLocationsPrefix=oCanJobWidget.LOCATIONS.toString()+".";var sCategoriesPrefix=oCanJobWidget.CATEGORIES.toString()+".";if(oState.SelectedIDs){for(var i=0;i<oState.SelectedIDs.length;i++){if(oState.SelectedIDs[i].substr(0,2)==sLocationsPrefix)
iLocations++;if(oState.SelectedIDs[i].substr(0,2)==sCategoriesPrefix)
iCategories++;}}
if(iLocations==0){document.getElementById(oCanJobWidget.StatesID).innerHTML=oCanJobWidget.MSG_ALL;}else{document.getElementById(oCanJobWidget.StatesID).innerHTML=iLocations.toString();}
if(iCategories==0){document.getElementById(oCanJobWidget.CategoriesID).innerHTML=oCanJobWidget.MSG_ALL;}else{document.getElementById(oCanJobWidget.CategoriesID).innerHTML=iCategories.toString();}});}
function CanJobWidget_UpdatePreview(){var oWrapper=document.getElementById(oCanJobWidget.PreviewWrapperID);var sSize=document.getElementById(oCanJobWidget.SizeComboClientID).value;var iSeparator=sSize.indexOf('x');var iWidth=parseInt(sSize.substr(0,iSeparator));var iHeight=parseInt(sSize.substr(iSeparator+1));oWrapper.style.height=iHeight.toString()+'px';oWrapper.style.width=iWidth.toString()+'px';var oIFrame=document.getElementById(oCanJobWidget.IFrameClientID);oIFrame.width=iWidth.toString();oIFrame.height=iHeight.toString();var sUrl='/Services/CanHandler.ashx?Preview='+oCanJobWidget.PreviewCode+'&Width='+iWidth.toString()+'&Height='+iHeight.toString();oIFrame.src=sUrl;};
;

function ColorSelect_Click(oValue){var oContainer=document.getElementById(oValue.ContainerID).State;var oBackgroundColor=document.getElementById(oContainer.BackgroundColorID);var oLabel=document.getElementById(oContainer.LabelID);var oState=document.getElementById(oContainer.StateID);var oTooltip=$find(oContainer.TooltipID);oBackgroundColor.style.backgroundColor=oValue.Code;oState.value=oValue.Code;oLabel.innerHTML=oValue.Name;oTooltip.hide();if(oContainer.Callback){oContainer.Callback(oValue);}}
;

function Report_SetDate(dtFrom,dtTo){var oPickerFrom=$find(oReport.FromClientID);var oPickerTo=$find(oReport.ToClientID);oPickerFrom.set_selectedDate(dtFrom);oPickerTo.set_selectedDate(dtTo);}
function EndRequestHandler(sender,args)
{if(args.get_error()!=undefined&&args.get_error().httpStatusCode=='500')
{var errorMessage=args.get_error().message;args.set_errorHandled(true);$get('AlertDiv').style.display='block';$get('AlertMessage').innerHTML=errorMessage;}}
function HideAlertDiv()
{$get('AlertDiv').style.display='none';}
var Distro={OpenNotice:function(sKey,bScrollBars){if(bScrollBars){window.open(sKey,'','status=0,scrollbars=1,location=0,resizable=0,width=600,height=450');}else{window.open(sKey,'','status=0,scrollbars=0,location=0,resizable=0,width=600,height=450');}},CloseYellowAlert:function(){document.getElementById('yellowAlert').style.display='none';var oProxy=new Monster.Distro.Web.Services.RenderService();oProxy.SetDontShowEmailVerifiedMessageFlag();}}
;

function EditProfile_ValidatePassword(sender,args){args.IsValid=document.getElementById(oEditProfile.PasswordClientID).value==args.Value;}
var EditProfile={ResendEmail:function(){document.getElementById(oEditProfile.EmailConfirmationPlaceholderID).innerHTML='';var oProxy=new Monster.Distro.Web.Services.RenderService();oProxy.ResendEmail(function(){document.getElementById(oEditProfile.EmailConfirmationPlaceholderID).innerHTML=oEditProfile.MSG_287089;});}};
;

function EmergingWorkforceJobWidget_UpdatePreview(){EmergingWorkforceJobWidget.UpdatePreview();}
function EmergingWorkforceJobWidget_CustomWidthFieldFocus(){EmergingWorkforceJobWidget.CustomWidthFieldFocus();}
function EmergingWorkforceJobWidget_ValidateCustomWidth(sender,args){args.IsValid=EmergingWorkforceJobWidget.ValidateCustomWidth(args.Value);}
var EmergingWorkforceJobWidget={UpdatePreview:function(){var oHead=document.getElementsByTagName('head')[0];var oScript=document.createElement('script');oScript.type='text/javascript';var oTrakCategories=document.getElementById('MonsterJobSearchResultPlaceHolder0TrakCategoriesClone');if(oTrakCategories!=null){document.body.removeChild(oTrakCategories);oTrakCategories=null;}
var oDropDownWidth=document.getElementById(oEmergingWorkforceJobWidget.DropdownWidthID);var oTextboxWidth=document.getElementById(oEmergingWorkforceJobWidget.TextboxWidthID);var iWidth;iWidth=parseInt(oDropDownWidth.value);if(isNaN(iWidth)||iWidth==0){iWidth=parseInt(oTextboxWidth.value);if(isNaN(iWidth)||iWidth==0){iWidth=oEmergingWorkforceJobWidget.DefaultWidth;}}
if(iWidth<400||iWidth>1000){iWidth=oEmergingWorkforceJobWidget.DefaultWidth;}
document.getElementById(oEmergingWorkforceJobWidget.PreviewWrapperID).style.width=iWidth.toString()+'px';var sCityLocationIDs='';var sStateLocationIDs='';var sPrimaryCategories='';var sSecondaryCategories='';var oState=MultiSelect.get_state();var aSelectedIDs=oState.SelectedIDs;for(var i=0;i<aSelectedIDs.length;i++){var sID=aSelectedIDs[i];aIDParts=sID.split('.');switch(aIDParts[1]){case'0':if(aIDParts.length==4){sCityLocationIDs+=','+aIDParts[3];break;}
if(aIDParts.length==3){sStateLocationIDs+=','+aIDParts[2];break;}
throw new Error('Invalid location ID.');case'1':if(aIDParts.length==4){sSecondaryCategories+=','+aIDParts[2]+'.'+aIDParts[3];break;}
if(aIDParts.length==3){sPrimaryCategories+=','+aIDParts[2];break;}
throw new Error('Invalid category ID.');default:throw new Error('Invalid ID.');}}
var sUrl='/Services/WidgetHandler.ashx?Verb=Refresh&EnablePaging=false&Preview='+oEmergingWorkforceJobWidget.PreviewCode+'&Width='+iWidth.toString()+'&PageSize='+document.getElementById(oEmergingWorkforceJobWidget.DropdownRowsID).value+'&CountryAbbrev=US'+'&MultiLine='+document.getElementById(oEmergingWorkforceJobWidget.CheckboxMultilineID).checked+'&ChannelID='+oEmergingWorkforceJobWidget.ChannelID.toString()+'&ColorSearchBackground='+encodeURIComponent($find(oEmergingWorkforceJobWidget.ColorSearchBackgroundID).get_selectedColor())+'&ColorContentBackground='+encodeURIComponent($find(oEmergingWorkforceJobWidget.ColorContentBackgroundID).get_selectedColor())+'&ColorPrimaryFont='+encodeURIComponent($find(oEmergingWorkforceJobWidget.ColorPrimaryFontID).get_selectedColor())+'&ColorSecondaryFont='+encodeURIComponent($find(oEmergingWorkforceJobWidget.ColorSecondaryFontID).get_selectedColor());if(oEmergingWorkforceJobWidget.DebugQuery){sUrl+='&DebugQuery=true';}
if(sPrimaryCategories!=''){sUrl+='&PrimaryCategories='+sPrimaryCategories.substr(1);}
if(sSecondaryCategories!=''){sUrl+='&SecondaryCategories='+sSecondaryCategories.substr(1);}
if(sCityLocationIDs!=''){sUrl+='&CityLocationIDs='+sCityLocationIDs.substr(1);}
if(sStateLocationIDs!=''){sUrl+='&StateLocationIDs='+sStateLocationIDs.substr(1);}
oScript.src=sUrl;oHead.appendChild(oScript);},updateCounters:function(oState){var iLocations=0;var iCategories=0;var sLocationsID=oEmergingWorkforceJobWidget.LOCATIONS.toString();var sCategoriesID=oEmergingWorkforceJobWidget.CATEGORIES.toString();if(oState.SelectedIDs){for(var i=0;i<oState.SelectedIDs.length;i++){var tier2id=oState.SelectedIDs[i].substr(oState.SelectedIDs[i].indexOf(".")+1,1);if(tier2id==sLocationsID){iLocations++;}
if(tier2id==sCategoriesID){iCategories++;}}}
if(iLocations==0){document.getElementById(oEmergingWorkforceJobWidget.StatesID).innerHTML=oEmergingWorkforceJobWidget.MSG_ALL;}else{document.getElementById(oEmergingWorkforceJobWidget.StatesID).innerHTML=iLocations.toString();}
if(iCategories==0){document.getElementById(oEmergingWorkforceJobWidget.CategoriesID).innerHTML=oEmergingWorkforceJobWidget.MSG_ALL;}else{document.getElementById(oEmergingWorkforceJobWidget.CategoriesID).innerHTML=iCategories.toString();}},ShowPopup:function(iSelectedValue){var sRoot=oEmergingWorkforceJobWidget.US_COUNTRY_ID.toString()+"."+iSelectedValue.toString();MultiSelect.ChangeSelectedPath(sRoot);MultiSelect.Show(function(oState){EmergingWorkforceJobWidget.updateCounters(oState);EmergingWorkforceJobWidget.UpdatePreview();});},CustomWidthFieldFocus:function(){document.getElementById(oEmergingWorkforceJobWidget.DropdownWidthID).value='';},ValidateCustomWidth:function(sValue){var sDropDownValue=document.getElementById(oEmergingWorkforceJobWidget.DropdownWidthID).value;return(sDropDownValue!=null&&sDropDownValue!='')||(sValue!=null&&sValue!='');}};
;

function JobBoardWidget_LocationItemsRequesting(sender,args){var oContext=args.get_context();var oCountryCombo=document.getElementById(oJobBoardWidget.DropdownCountryID);oContext.CountryID=parseInt(oCountryCombo.value);}
function JobBoardWidget_LocationSelectedIndexChanged(sender,args){var sText=sender.get_text().replace('<b>','').replace('</b>','');sender.set_text(sText);}
function JobBoardWidget_CustomWidthFieldFocus(){JobBoardWidget.CustomWidthFieldFocus();}
function JobBoardWidget_ValidateCustomWidth(sender,args){args.IsValid=JobBoardWidget.ValidateCustomWidth(args.Value);}
function JobBoardWidget_UpdatePreview(){JobBoardWidget.UpdatePreview();}
var JobBoardWidget={UpdatePreview:function(){var oHead=document.getElementsByTagName('head')[0];var oScript=document.createElement('script');oScript.type='text/javascript';var oDropDownWidth=document.getElementById(oJobBoardWidget.DropdownWidthID);var oTextboxWidth=document.getElementById(oJobBoardWidget.TextboxWidthID);var iWidth;iWidth=parseInt(oDropDownWidth.value);if(isNaN(iWidth)||iWidth==0){iWidth=parseInt(oTextboxWidth.value);if(isNaN(iWidth)||iWidth==0){iWidth=oJobBoardWidget.DefaultWidth;}}
if(iWidth<400||iWidth>1000){iWidth=oJobBoardWidget.DefaultWidth;}
document.getElementById(oJobBoardWidget.PreviewWrapperID).style.width=iWidth.toString()+'px';var countryID=parseInt(document.getElementById(oJobBoardWidget.DropdownCountryID).value);var countryAbbrev;for(var i=0;i<oJobBoardWidget.Countries.length;i++){if(oJobBoardWidget.Countries[i].ID==countryID){countryAbbrev=oJobBoardWidget.Countries[i].C;break;}}
var sUrl='/Services/WidgetHandler.ashx?Verb=Refresh&Preview='+oJobBoardWidget.PreviewCode+'&Width='+iWidth.toString()+'&PageSize='+document.getElementById(oJobBoardWidget.DropdownRowsID).value+'&CountryAbbrev='+countryAbbrev+'&MultiLine='+document.getElementById(oJobBoardWidget.CheckboxMultilineID).checked+'&ColorSearchBackground='+encodeURIComponent($find(oJobBoardWidget.ColorSearchBackgroundID).get_selectedColor())+'&ColorContentBackground='+encodeURIComponent($find(oJobBoardWidget.ColorContentBackgroundID).get_selectedColor())+'&ColorPrimaryFont='+encodeURIComponent($find(oJobBoardWidget.ColorPrimaryFontID).get_selectedColor())+'&ColorSecondaryFont='+encodeURIComponent($find(oJobBoardWidget.ColorSecondaryFontID).get_selectedColor())+'&ChannelID='+oJobBoardWidget.ChannelID.toString();if(oJobBoardWidget.DebugQuery){sUrl+='&DebugQuery=true';}
var sLocation=$find(oJobBoardWidget.DropdownLocationID).get_text();var sKeyword=$find(oJobBoardWidget.TextboxKeywordID).get_value();if(sLocation&&sLocation!=''){sUrl+='&DefaultWhere='+encodeURIComponent(sLocation);}
if(sKeyword&&sKeyword!=''){sUrl+='&DefaultQuery='+encodeURIComponent(sKeyword);}
oScript.src=sUrl;oHead.appendChild(oScript);},CustomWidthFieldFocus:function(){document.getElementById(oJobBoardWidget.DropdownWidthID).value='';},ValidateCustomWidth:function(sValue){var sDropDownValue=document.getElementById(oJobBoardWidget.DropdownWidthID).value;return(sDropDownValue!=null&&sDropDownValue!='')||(sValue!=null&&sValue!='');},ChangeCountry:function(){var countryID=parseInt(document.getElementById(oJobBoardWidget.DropdownCountryID).value);var AUSTRALIA_COUNTRY_ID=8;if(countryID==AUSTRALIA_COUNTRY_ID){$find(oJobBoardWidget.ColorSearchBackgroundID).set_selectedColor('#00cc00');}
$find(oJobBoardWidget.DropdownLocationID).set_text('');this.UpdatePreview();},DropdownWidthChange:function(){$find(oJobBoardWidget.TextboxWidthID).set_value('');this.UpdatePreview();}};
;

function JobSearchResultsWidget_UpdatePreview(){JobSearchResultsWidget.UpdatePreview();}
function JobSearchResultsWidget_CustomWidthFieldFocus(){JobSearchResultsWidget.CustomWidthFieldFocus();}
function JobSearchResultsWidget_ValidateCustomWidth(sender,args){args.IsValid=JobSearchResultsWidget.ValidateCustomWidth(args.Value);}
var JobSearchResultsWidget={updateCounters:function(oState){var iLocations=0;var iCategories=0;var sLocationsID=oJobSearchResultsWidget.LOCATIONS.toString();var sCategoriesID=oJobSearchResultsWidget.CATEGORIES.toString();if(oState.SelectedIDs){for(var i=0;i<oState.SelectedIDs.length;i++){var tier2id=oState.SelectedIDs[i].substr(oState.SelectedIDs[i].indexOf(".")+1,1);if(tier2id==sLocationsID){iLocations++;}
if(tier2id==sCategoriesID){iCategories++;}}}
if(iLocations==0){document.getElementById(oJobSearchResultsWidget.StatesID).innerHTML=oJobSearchResultsWidget.MSG_ALL;}else{document.getElementById(oJobSearchResultsWidget.StatesID).innerHTML=iLocations.toString();}
if(iCategories==0){document.getElementById(oJobSearchResultsWidget.CategoriesID).innerHTML=oJobSearchResultsWidget.MSG_ALL;}else{document.getElementById(oJobSearchResultsWidget.CategoriesID).innerHTML=iCategories.toString();}},DropdownWidthChange:function(){$find(oJobSearchResultsWidget.TextboxWidthID).set_value('');this.UpdatePreview();},CustomWidthFieldFocus:function(){document.getElementById(oJobSearchResultsWidget.DropdownWidthID).value='';},ValidateCustomWidth:function(sValue){var sDropDownValue=document.getElementById(oJobSearchResultsWidget.DropdownWidthID).value;return(sDropDownValue!=null&&sDropDownValue!='')||(sValue!=null&&sValue!='');},ShowPopup:function(iSelectedValue){var oCountryCombo=document.getElementById(oJobSearchResultsWidget.DropdownCountryID);var sRoot=oCountryCombo.value+"."+iSelectedValue.toString();MultiSelect.ChangeSelectedPath(sRoot);MultiSelect.Show(function(oState){JobSearchResultsWidget.updateCounters(oState);JobSearchResultsWidget.UpdatePreview();});},ChangeCountry:function(){var oCountryCombo=document.getElementById(oJobSearchResultsWidget.DropdownCountryID);MultiSelect.Reset(oCountryCombo.value,oCountryCombo.value+'.0');this.updateCounters(MultiSelect.get_state());this.UpdatePreview();},UpdatePreview:function(){var oHead=document.getElementsByTagName('head')[0];var oScript=document.createElement('script');oScript.type='text/javascript';var oDropDownWidth=document.getElementById(oJobSearchResultsWidget.DropdownWidthID);var oTextboxWidth=document.getElementById(oJobSearchResultsWidget.TextboxWidthID);var iWidth;iWidth=parseInt(oDropDownWidth.value);if(isNaN(iWidth)||iWidth==0){iWidth=parseInt(oTextboxWidth.value);if(isNaN(iWidth)||iWidth==0){iWidth=oJobSearchResultsWidget.DefaultWidth;}}
if(iWidth<400||iWidth>1000){iWidth=oJobSearchResultsWidget.DefaultWidth;}
document.getElementById(oJobSearchResultsWidget.PreviewWrapperID).style.width=iWidth.toString()+'px';var countryID=parseInt(document.getElementById(oJobSearchResultsWidget.DropdownCountryID).value);var countryAbbrev;for(var i=0;i<oJobSearchResultsWidget.Countries.length;i++){if(oJobSearchResultsWidget.Countries[i].ID==countryID){countryAbbrev=oJobSearchResultsWidget.Countries[i].C;break;}}
var sCityLocationIDs='';var sStateLocationIDs='';var sPrimaryCategories='';var sSecondaryCategories='';var oState=MultiSelect.get_state();var aSelectedIDs=oState.SelectedIDs;for(var i=0;i<aSelectedIDs.length;i++){var sID=aSelectedIDs[i];aIDParts=sID.split('.');switch(aIDParts[1]){case'0':if(aIDParts.length==4){sCityLocationIDs+=','+aIDParts[3];break;}
if(aIDParts.length==3){sStateLocationIDs+=','+aIDParts[2];break;}
throw new Error('Invalid location ID.');case'1':if(aIDParts.length==4){sSecondaryCategories+=','+aIDParts[2]+'.'+aIDParts[3];break;}
if(aIDParts.length==3){sPrimaryCategories+=','+aIDParts[2];break;}
throw new Error('Invalid category ID.');default:throw new Error('Invalid ID.');}}
var sUrl='/Services/WidgetHandler.ashx?Verb=Refresh&EnablePaging=false&Preview='+oJobSearchResultsWidget.PreviewCode+'&Width='+iWidth.toString()+'&PageSize='+document.getElementById(oJobSearchResultsWidget.DropdownRowsID).value+'&CountryAbbrev='+countryAbbrev+'&MultiLine='+document.getElementById(oJobSearchResultsWidget.CheckboxMultilineID).checked+'&ChannelID='+oJobSearchResultsWidget.ChannelID.toString()+'&ColorContentBackground='+encodeURIComponent($find(oJobSearchResultsWidget.ColorContentBackgroundID).get_selectedColor())+'&ColorPrimaryFont='+encodeURIComponent($find(oJobSearchResultsWidget.ColorPrimaryFontID).get_selectedColor())+'&ColorSecondaryFont='+encodeURIComponent($find(oJobSearchResultsWidget.ColorSecondaryFontID).get_selectedColor());if(oJobSearchResultsWidget.DebugQuery){sUrl+='&DebugQuery=true';}
if(sPrimaryCategories!=''){sUrl+='&PrimaryCategories='+sPrimaryCategories.substr(1);}
if(sSecondaryCategories!=''){sUrl+='&SecondaryCategories='+sSecondaryCategories.substr(1);}
if(sCityLocationIDs!=''){sUrl+='&CityLocationIDs='+sCityLocationIDs.substr(1);}
if(sStateLocationIDs!=''){sUrl+='&StateLocationIDs='+sStateLocationIDs.substr(1);}
oScript.src=sUrl;oHead.appendChild(oScript);}};
;

function JobSearchWidget_LocationItemsRequesting(sender,args){var oContext=args.get_context();var oCountryCombo=document.getElementById(oJobSearchWidget.CountryID);oContext.CountryID=parseInt(oCountryCombo.value);if(args.get_text().length==0)
args.set_cancel(true)
else
args.set_cancel(false);}
function JobSearchWidget_LocationDropDownOpening(sender,args){if(sender.get_items().get_count()==0)
args.set_cancel(true);}
function JobSearchWidget_LocationSelectedIndexChanged(sender,args){var sText=sender.get_text().replace('<b>','').replace('</b>','');sender.set_text(sText);}
function JobSearchWidget_UpdatePreview(){JobSearchWidget.UpdatePreview();}
var JobSearchWidget={UpdatePreview:function(){var oHead=document.getElementsByTagName('head')[0];var oScript=document.createElement('script');oScript.type='text/javascript';var sSelectedSize=document.getElementById(oJobSearchWidget.DropdownSizesID).value;var iSeparator=sSelectedSize.indexOf('x');var iWidth=parseInt(sSelectedSize.substr(0,iSeparator));var iHeight=parseInt(sSelectedSize.substr(iSeparator+1));document.getElementById(oJobSearchWidget.PreviewWrapperID).style.width=iWidth.toString()+'px';var countryID=parseInt(document.getElementById(oJobSearchWidget.DropdownCountryID).value);var countryAbbrev;for(var i=0;i<oJobSearchWidget.Countries.length;i++){if(oJobSearchWidget.Countries[i].ID==countryID){countryAbbrev=oJobSearchWidget.Countries[i].C;break;}}
var sUrl='/Services/WidgetHandler.ashx?Verb=Refresh&Preview='+oJobSearchWidget.PreviewCode+'&Width='+iWidth.toString()+'&Height='+iHeight.toString()+'&CountryAbbrev='+countryAbbrev+'&ColorSearchBackground='+encodeURIComponent($find(oJobSearchWidget.ColorSearchBackgroundID).get_selectedColor())+'&ChannelID='+oJobSearchWidget.ChannelID.toString();var sLocation=$find(oJobSearchWidget.DropdownLocationID).get_text();var sKeyword=$find(oJobSearchWidget.TextboxKeywordID).get_value();if(sLocation&&sLocation!=''){sUrl+='&DefaultWhere='+encodeURIComponent(sLocation);}
if(sKeyword&&sKeyword!=''){sUrl+='&DefaultQuery='+encodeURIComponent(sKeyword);}
oScript.src=sUrl;oHead.appendChild(oScript);},ChangeCountry:function(){var countryID=parseInt(document.getElementById(oJobSearchWidget.DropdownCountryID).value);var AUSTRALIA_COUNTRY_ID=8;if(countryID==AUSTRALIA_COUNTRY_ID){$find(oJobSearchWidget.ColorSearchBackgroundID).set_selectedColor('#00cc00');}
$find(oJobSearchWidget.DropdownLocationID).set_text('');this.UpdatePreview();}};
;

var Messages={UpdateContent:function(iEmailSentID,source){var oContainer=document.getElementById(oMessages.LinkContainerID);oNodes=document.getElementsByTagName('A');for(var i=0;i<oNodes.length;i++){var sClassName=oNodes[i].className;if(sClassName.length>7){if(sClassName.substr(sClassName.length-7)==" active"){oNodes[i].className=sClassName.substr(0,sClassName.length-7);}}}
if(source.className=='unread'){source.className='read';}
source.className=source.className+" active";var oProxy=new Monster.Distro.Web.Services.RenderService();oProxy.RenderMessageDetail(iEmailSentID,function(sResult){document.getElementById(oMessages.MessageDetailID).innerHTML=sResult;});},ShowWindow:function(){Distro.OpenNotice('/Account/Messages.aspx',true);}};
;

MultiSelect={_callback:null,_state:null,clone:function(obj){if(null==obj||"object"!=typeof obj){return obj;}
if(obj instanceof Date){var copy=new Date();copy.setTime(obj.getTime());return copy;}
if(obj instanceof Array){var copy=[];var len=obj.length;for(var i=0;i<len;++i){copy[i]=this.clone(obj[i]);}
return copy;}
if(obj instanceof Object){var copy={};for(var attr in obj){if(obj.hasOwnProperty(attr)){copy[attr]=this.clone(obj[attr]);}}
return copy;}
throw new Error("Unable to copy obj! Its type isn't supported.");},get_state:function(){if(this._state==null){var oHfState=document.getElementById(oMultiSelect.StateID);this._state=Sys.Serialization.JavaScriptSerializer.deserialize(oHfState.value);}
return this._state;},set_state:function(oState){this._state=oState;var oHfState=document.getElementById(oMultiSelect.StateID);oHfState.value=Sys.Serialization.JavaScriptSerializer.serialize(oState);},Show:function(fCallback){this._callback=fCallback;this._backupState=this.clone(this.get_state());var oPopupBackground=document.getElementById(oMultiSelect.PopupBackgroundID);oPopupBackground.style.display='block';var oPopup=document.getElementById(oMultiSelect.PopupID);oPopup.style.display='block';},Done:function(){var oPopup=document.getElementById(oMultiSelect.PopupID);oPopup.style.display='none';var oPopupBackground=document.getElementById(oMultiSelect.PopupBackgroundID);oPopupBackground.style.display='none';if(this._callback){this._callback(this.get_state());}},Cancel:function(){this.set_state(this._backupState);var oPopup=document.getElementById(oMultiSelect.PopupID);oPopup.style.display='none';var oPopupBackground=document.getElementById(oMultiSelect.PopupBackgroundID);oPopupBackground.style.display='none';this.Render();if(this._callback){this._callback(this.get_state());}},removeParentIDs:function(oState,sChildID){var iLastDot=sChildID.lastIndexOf('.');if(iLastDot!=-1){var sParentID=sChildID.substr(0,iLastDot);var aIDs=[];for(var i=0;i<oState.SelectedIDs.length;i++){if(oState.SelectedIDs[i]!=sParentID){aIDs.push(oState.SelectedIDs[i]);}}
oState.SelectedIDs=aIDs;}},ChangeSelectedPathAndSelect:function(sSelectedPath,oElement){if(oElement.DisableClicks==null){oElement.DisableClicks=true;var oState=this.get_state();oState.SelectedPath=sSelectedPath;oState.SelectedIDs.push(sSelectedPath);this.removeParentIDs(oState,sSelectedPath);this.set_state(oState);this.Render();}},ChangeSelectedPath:function(sSelectedPath){var oState=this.get_state();oState.SelectedPath=sSelectedPath;this.set_state(oState);this.Render();},Render:function(){var oState=this.get_state();var oProxy=new Monster.Distro.Web.Services.RenderService();oProxy.RenderMultiSelect(oState,function(oResult){document.getElementById(oMultiSelect.ContainerID).innerHTML=oResult.HtmlContent;var oTitle=document.getElementById(oMultiSelect.PopupTitleID);var oNotice=document.getElementById(oMultiSelect.PopupNoticeID);if(oTitle!=null){oTitle.innerHTML=oResult.Title;}
if(oNotice!=null){oNotice.innerHTML=oResult.Notice;}});},Select:function(sSelectID,oElement){if(oElement.DisableClicks==null){oElement.DisableClicks=true;var oState=this.get_state();oState.SelectedIDs.push(sSelectID);this.removeParentIDs(oState,sSelectID);this.set_state(oState);this.Render();}},Unselect:function(sSelectID){var oState=this.get_state();var i=-1;for(var j=0;j<oState.SelectedIDs.length;j++){if(oState.SelectedIDs[j]==sSelectID){i=j;break;}}
if(i!=-1){for(var j=i+1;j<oState.SelectedIDs.length;j++){oState.SelectedIDs[j-1]=oState.SelectedIDs[j];}
oState.SelectedIDs.pop();}
this.set_state(oState);this.Render();},Reset:function(sRootPath,sSelectedPath){var oState=this.get_state();oState.RootPath=sRootPath;oState.SelectedPath=sSelectedPath;oState.SelectedIDs=[];this.set_state(oState);this.Render();},Clear:function(){var oState=this.get_state();oState.SelectedIDs=[];this.set_state(oState);this.Render();}};
;

var PaymentSetupWizard={UpdateScreenIndex:function(iIndex){document.getElementById(oPaymentSetupWizard.ScreenIndexID).value=iIndex.toString();document.getElementById(oPaymentSetupWizard.FirstScreenID).style.display=(iIndex==1?'block':'none');document.getElementById(oPaymentSetupWizard.SecondScreenID).style.display=(iIndex==2?'block':'none');var oScreenError=document.getElementById(oPaymentSetupWizard.ScreenErrorID);if(oScreenError){oScreenError.style.display=(iIndex==3?'block':'none');}},ExpandScreen:function(iIndex){if(document.getElementById(oPaymentSetupQuickInfo.IsExpandedID).value=='false'){document.getElementById(oPaymentSetupQuickInfo.IsExpandedID).value='true';document.getElementById(oPaymentSetupQuickInfo.ExpandControlID).src=oPaymentSetupQuickInfo.MinusUrl;document.getElementById(oPaymentSetupWizard.WrapperID).style.display='block';document.getElementById(oPaymentSetupWizard.IsHiddenID).value='false';this.UpdateScreenIndex(iIndex);}else{document.getElementById(oPaymentSetupQuickInfo.IsExpandedID).value='false';document.getElementById(oPaymentSetupQuickInfo.ExpandControlID).src=oPaymentSetupQuickInfo.PlusUrl;document.getElementById(oPaymentSetupWizard.WrapperID).style.display='none';document.getElementById(oPaymentSetupWizard.IsHiddenID).value='true';}},ShowCJRegistration:function(){var oWindow=radopen('/Account/Commission-Junction-Registration.aspx');oWindow.setSize(625,600);oWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);oWindow.set_visibleStatusbar(false);oWindow.center();var oBounds=oWindow.getWindowBounds();if(oBounds.y<=0){oWindow.moveTo(oBounds.x,50);}}};
;

function Reports_DateSet(){Reports.DateSet();}
function Reports_ValidateDateRange(sender,args){var oDropDown=document.getElementById(oReports.DateRangeClientID);if(parseInt(oDropDown.value)!=oReports.CustomRangeValue){args.IsValid=true;return;}
args.IsValid=($find(oReports.StartDateClientID).get_selectedDate()!=null&&$find(oReports.EndDateClientID).get_selectedDate()!=null);}
Reports={_disableEvents:false,_deleteReportID:null,DateRangeChange:function(){var oDropDown=document.getElementById(oReports.DateRangeClientID);if(parseInt(oDropDown.value)!=oReports.CustomRangeValue){this._disableEvents=true;$find(oReports.StartDateClientID).clear();$find(oReports.EndDateClientID).clear();this._disableEvents=false;}},DateSet:function(){if(this._disableEvents)
return;var oDropDown=document.getElementById(oReports.DateRangeClientID);var sValue=oReports.CustomRangeValue.toString();var iIndex=0;for(var i=0;i<oDropDown.options.length;i++){if(oDropDown.options[i].value==sValue){iIndex=i;break;}}
oDropDown.selectedIndex=iIndex;},CloseDeleteDialog:function(bDelete){var oDeleteDialog=document.getElementById(oReports.DeleteDialogClientID);oDeleteDialog.style.display='none';if(bDelete){var oRow=document.getElementById('rr_'+this._deleteReportID.toString());oRow.style.display='none';var oProxy=new Monster.Distro.Web.Services.RenderService();oProxy.DeleteReport(this._deleteReportID);}},ShowDetail:function(iReportID){var oReportToRun=document.getElementById(oReports.ReportToRunClientID);oReportToRun.value=iReportID;var oBtnRunReport=document.getElementById(oReports.ButtonRunReportClientID);oBtnRunReport.click();},Action:function(iReportID,oDropDown){var sAction=oDropDown.value;if(sAction==''){return;}
switch(sAction){case'Run':this.ShowDetail(iReportID);break;case'Delete':this._deleteReportID=iReportID;var oDeleteDialog=document.getElementById(oReports.DeleteDialogClientID);oDeleteDialog.style.display='block';break;default:throw Error('Unkown report action.');};}};
;

var ZeroClipboard={version:"1.0.7",clients:{},moviePath:'ZeroClipboard.swf',nextId:1,$:function(thingy){if(typeof(thingy)=='string')thingy=document.getElementById(thingy);if(!thingy.addClass){thingy.hide=function(){this.style.display='none';};thingy.show=function(){this.style.display='';};thingy.addClass=function(name){this.removeClass(name);this.className+=' '+name;};thingy.removeClass=function(name){var classes=this.className.split(/\s+/);var idx=-1;for(var k=0;k<classes.length;k++){if(classes[k]==name){idx=k;k=classes.length;}}
if(idx>-1){classes.splice(idx,1);this.className=classes.join(' ');}
return this;};thingy.hasClass=function(name){return!!this.className.match(new RegExp("\\s*"+name+"\\s*"));};}
return thingy;},setMoviePath:function(path){this.moviePath=path;},dispatch:function(id,eventName,args){var client=this.clients[id];if(client){client.receiveEvent(eventName,args);}},register:function(id,client){this.clients[id]=client;},getDOMObjectPosition:function(obj,stopObj){var info={left:0,top:0,width:obj.width?obj.width:obj.offsetWidth,height:obj.height?obj.height:obj.offsetHeight};while(obj&&(obj!=stopObj)){info.left+=obj.offsetLeft;info.top+=obj.offsetTop;obj=obj.offsetParent;}
return info;},Client:function(elem){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId='ZeroClipboardMovie_'+this.id;ZeroClipboard.register(this.id,this);if(elem)this.glue(elem);}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:'',handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(elem,appendElem,stylesToAdd){this.domElement=ZeroClipboard.$(elem);var zIndex=99;if(this.domElement.style.zIndex){zIndex=parseInt(this.domElement.style.zIndex,10)+1;}
if(typeof(appendElem)=='string'){appendElem=ZeroClipboard.$(appendElem);}
else if(typeof(appendElem)=='undefined'){appendElem=document.getElementsByTagName('body')[0];}
var box=ZeroClipboard.getDOMObjectPosition(this.domElement,appendElem);this.div=document.createElement('div');var style=this.div.style;style.position='absolute';style.left=''+box.left+'px';style.top=''+box.top+'px';style.width=''+box.width+'px';style.height=''+box.height+'px';style.zIndex=zIndex;if(typeof(stylesToAdd)=='object'){for(addedStyle in stylesToAdd){style[addedStyle]=stylesToAdd[addedStyle];}}
appendElem.appendChild(this.div);this.div.innerHTML=this.getHTML(box.width,box.height);},getHTML:function(width,height){var html='';var flashvars='id='+this.id+'&width='+width+'&height='+height;if(navigator.userAgent.match(/MSIE/)){var protocol=location.href.match(/^https/i)?'https://':'http://';html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';}
else{html+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';}
return html;},hide:function(){if(this.div){this.div.style.left='-2000px';}},show:function(){this.reposition();},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML='';var body=document.getElementsByTagName('body')[0];try{body.removeChild(this.div);}catch(e){;}
this.domElement=null;this.div=null;}},reposition:function(elem){if(elem){this.domElement=ZeroClipboard.$(elem);if(!this.domElement)this.hide();}
if(this.domElement&&this.div){var box=ZeroClipboard.getDOMObjectPosition(this.domElement);var style=this.div.style;style.left=''+box.left+'px';style.top=''+box.top+'px';}},setText:function(newText){this.clipText=newText;if(this.ready)this.movie.setText(newText);},addEventListener:function(eventName,func){eventName=eventName.toString().toLowerCase().replace(/^on/,'');if(!this.handlers[eventName])this.handlers[eventName]=[];this.handlers[eventName].push(func);},setHandCursor:function(enabled){this.handCursorEnabled=enabled;if(this.ready)this.movie.setHandCursor(enabled);},setCSSEffects:function(enabled){this.cssEffects=!!enabled;},receiveEvent:function(eventName,args){eventName=eventName.toString().toLowerCase().replace(/^on/,'');switch(eventName){case'load':this.movie=document.getElementById(this.movieId);if(!this.movie){var self=this;setTimeout(function(){self.receiveEvent('load',null);},1);return;}
if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var self=this;setTimeout(function(){self.receiveEvent('load',null);},100);this.ready=true;return;}
this.ready=true;this.movie.setText(this.clipText);this.movie.setHandCursor(this.handCursorEnabled);break;case'mouseover':if(this.domElement&&this.cssEffects){this.domElement.addClass('hover');if(this.recoverActive)this.domElement.addClass('active');}
break;case'mouseout':if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass('active')){this.domElement.removeClass('active');this.recoverActive=true;}
this.domElement.removeClass('hover');}
break;case'mousedown':if(this.domElement&&this.cssEffects){this.domElement.addClass('active');}
break;case'mouseup':if(this.domElement&&this.cssEffects){this.domElement.removeClass('active');this.recoverActive=false;}
break;}
if(this.handlers[eventName]){for(var idx=0,len=this.handlers[eventName].length;idx<len;idx++){var func=this.handlers[eventName][idx];if(typeof(func)=='function'){func(this,args);}
else if((typeof(func)=='object')&&(func.length==2)){func[0][func[1]](this,args);}
else if(typeof(func)=='string'){window[func](this,args);}}}}};
;

