document.cookie="hasJavaScript=true";function showInfoBox(){$("#infoBox").fadeIn(500)
}function deleteLabel(a){document.labels.cmd.value="deleteLabel";document.labels.labelid.value=a;
document.labels.submit()}function dispRecordcompanyLabelsUpdate(a){document.labels.cmd.value="dispRecordcompanyLabelsUpdate";
document.labels.labelid.value=a;document.labels.submit()}function promotionFormUpdate(){document.getElementById("dj").style.visibility="visible"
}function showConfirmationAlert(a){confirmation=confirm(a);return confirmation}function toggleCollapse(a){element=document.getElementById(a);
if(element.style.display==""){element.style.display="none"}else{if(element.style.display=="none"){element.style.display=""
}}}function toggle(a){element=document.getElementById(a);element.style.display=element.style.display==""?"none":""
}function toggleEnable(a){element=document.getElementById(a);element.disabled=!element.disabled
}function updateAccessListForm(){var b=new Array("mageditor","radiostation","dj","licensee");
for(var a=0;a<b.length;a++){checkboxId="checkbox"+b[a];tbodyId="tbody"+b[a];if(document.getElementById(checkboxId).checked){document.getElementById(tbodyId).style.display=""
}else{document.getElementById(tbodyId).style.display="none"}}}function setStateOfAllCheckboxes(a,b){inputElements=document.getElementsByTagName("input");
for(i=0;i<inputElements.length;++i){inputElement=inputElements[i];if(inputElement.name.search(a)!=-1){inputElement.checked=b
}}}function setEnabledOfAllCheckboxes(b,a){inputElements=document.getElementsByTagName("input");
for(i=0;i<inputElements.length;++i){inputElement=inputElements[i];if(inputElement.name.search(b)!=-1){inputElement.disabled=!a
}}}function toggleShowHideColumns(){var a=document.getElementById("showHideColumnsBox");
if(a.style.visibility!="visible"){a.style.visibility="visible"}else{a.style.visibility="hidden"
}}function deleteSelection(a){element=document.getElementsByName(a)[0];for(i=0;i<element.options.length;
i++){element.options[i].selected=false}}function selectAll(a){element=document.getElementsByName(a)[0];
for(i=element.options.length-1;i>=0;--i){element.options[i].selected=true}}function allowOnlyNumbers(b,a){var c;
var d;if(window.event){c=window.event.keyCode}else{if(b){c=b.which}else{return true
}}d=String.fromCharCode(c);if((c==null)||(c==0)||(c==8)||(c==9)||(c==13)||(c==27)){return true
}else{if((("0123456789").indexOf(d)>-1)){return true}else{if(a&&(d==".")){return true
}else{return false}}}}function onDownload(b){var d=document.createElement("span");
d.className="normalGhost";var c=document.createElement("img");c.className="link";
c.src=b.firstChild.src.replace(/normal/,"normal_ghost");var a=document.createTextNode(b.lastChild.nodeValue);
d.appendChild(c);d.appendChild(a);b.parentNode.replaceChild(d,b)}function toggleInfoBox(a){a.blur();
$(a).next().slideToggle(200);if($(a).css("background-position")=="0px -18px"){$(a).css("background-position","0px 1px")
}else{$(a).css("background-position","0px -18px")}}function trace(a){if(typeof(console)!="undefined"&&typeof(console.log)=="function"){console.log(a)
}}function confirmLoadTemplate(d,c){var a=true;if(formHasChanges){a=confirm(c)}if(a){formHasChanges=false;
var b=$("#emailTemplateId").val();$.ajax({type:"POST",url:d,data:({cmd:"ajaxGetEMailTemplate",emailTemplateId:b}),success:function(g){$("#subject").val($(g).find("subject").text());
$("#queuePriority").val($(g).find("priority").text());var e=$(g).find("appearance").text();
if(e==1){$("#plainText").attr("checked","checked");hideEMailOptions()}else{if(e==2){$("#graphicalElements").attr("checked","checked");
var f=$(g).find("logoPictureId").text();if(f=="labellogo"){if($("#logoRadioButtonLabel").attr("disabled")){$("#logoRadioButtonNone").attr("checked","checked")
}else{$("#logoRadioButtonLabel").attr("checked","checked")}}else{if(f==""){$("#logoRadioButtonNone").attr("checked","checked")
}else{$("#logoRadioButtonOtherLogo").attr("checked","checked");$("#logoRadioButtonOtherLogo").attr("disabled",null);
if($("#emailLogo").length){$("#emailLogo").attr("src","images/emailLogoTemplate_"+f+".jpg")
}else{var h=$('<img id="emailLogo" style="max-width: 300px">');h.attr("src","images/emailLogoTemplate_"+f+".jpg");
$("#imageCell").append(h)}$("#emailLogo").attr("src","images/emailLogoTemplate_"+f+".jpg")
}}$("#headline").val($(g).find("headline").text());showEMailOptions()}}$("#notifyText").val($(g).find("text").text())
}})}}function showEMailOptions(){$("#eMailOptions").fadeIn(1000)}function hideEMailOptions(){$("#eMailOptions").hide()
}function showEMailPreview(){$("#previewButton").attr("disabled","disabled");var a=new IPoolWindow("","previewWindow");
a.setOnClose(enablePreviewButton);a.setWidth(657);a.setLocationInCenter();a.setSizeToFitInViewPort();
a.show();$.ajax({type:"POST",url:iPoolMain,data:({cmd:"ajaxGetEMailPreview",recipientType:$("#recipientType").val(),releaseId:$("#releaseId").val(),recipientUserId:$("#recipientUserId").val(),subject:$("#subject").val(),appearance:$("input[name='appearance']:checked").val(),logo:$("input[name='logo']:checked").val(),logoUrl:$("#emailLogo").attr("src"),headline:$("#headline").val(),notifyText:$("#notifyText").val()}),success:function(d){var b=d.split("|;|");
var e=b[0];var c=b[1];a.setTitle(e);a.setContent(c)},dataType:"text"})}function viewEMail(c,b){var a=new IPoolWindow(b,"emailWindow");
a.setWidth(657);a.setLocationInCenter();a.setSizeToFitInViewPort();a.show();$.ajax({type:"POST",url:iPoolMain,data:({cmd:"ajaxGetEMail",emailId:c}),success:function(e){var d=e;
a.setContent(d)},dataType:"text"})}function initAjaxUpload(a){new AjaxUpload("#logoUploadButton2",{action:a,name:"emailLogo",onSubmit:function(b,c){if(c&&/^(jpg|jpeg|png|gif)$/.test(c)){this.setData({key:"This string will be send with the file"})
}else{alert("Error: Only JPEG, GIF or PNG images are supported.");return false}$("#progressAnimation").css("visibility","visible");
$("#progressAnimation").css("display","");this.disable()},onComplete:function(d,c){this.enable();
$("#progressAnimation").fadeOut(500);if(c!="error"){var b="temp/emailLogoTmp_"+c+".jpg";
$("#logoRadioButtonOtherLogo").attr("disabled",null);$("#logoRadioButtonOtherLogo").attr("checked","checked");
$("#logoPictureId").attr("value",c);if($("#emailLogo").length){$("#emailLogo").attr("src",b)
}else{var e=$('<img id="emailLogo" style="max-width: 300px">');e.attr("src",b);$("#imageCell").append(e)
}setFormHasChanges()}}})}function onChangeReleaseId(){var a=$("#releaseId").val();
var b=$("#releaseId :selected").attr("class");if(a==0||b=="NoLabelPicture"){if($("#logoRadioButtonLabel").attr("checked")){$("#logoRadioButtonNone").attr("checked","checked")
}$("#logoRadioButtonLabel").attr("disabled","disabled")}else{$("#logoRadioButtonLabel").attr("disabled",null)
}}function enablePreviewButton(){$("#previewButton").attr("disabled",null)}function IPoolWindow(c,a){this.htmlId=a;
this.width=400;this.title="";this.contentHeight=200;this.dragOpacity=1;this.containment=null;
if($("#"+a).length){$("#"+a).remove()}this.setSizeToFitInViewPort();var b='<div class="iPoolWindow" id="'+this.htmlId+'" style="display: none; width: '+this.width+'px"><a class="windowCloseButton">&nbsp;</a><div class="windowTitle"></div><div class="windowContent" style="height: '+this.contentHeight+'px; overflow: auto;"></div></div>';
$("body").append(b);$("#"+this.htmlId).draggable({handle:".windowTitle",opacity:this.dragOpacity,containment:this.containment});
this.setTitle(c);this.setLocationInCenter();$("#"+this.htmlId+" .windowCloseButton").bind("click",this.close)
}IPoolWindow.prototype.setOnClose=function(a){$("#"+this.htmlId+" .windowCloseButton").bind("click",a)
};IPoolWindow.prototype.setSizeToFitInViewPort=function(){var b=$(window).height();
var a=b*0.85;if(a<300){a=300}this.setContentHeight(a)};IPoolWindow.prototype.setLocationInCenter=function(){var c=$(window).width();
var b=$(window).height();var a=(c-this.width)/2;var d=(b-this.contentHeight-35)/2;
if(a<0){a=0}if(d<0){d=0}$("#"+this.htmlId).css("left",a+"px");$("#"+this.htmlId).css("top",d+"px")
};IPoolWindow.prototype.setWidth=function(a){this.width=a;$("#"+this.htmlId).css("width",a+"px")
};IPoolWindow.prototype.setTitle=function(a){this.title=a;this._redrawTitle()};IPoolWindow.prototype.setContent=function(a){$("#"+this.htmlId+" > .windowContent").html(a)
};IPoolWindow.prototype.setContentHeight=function(a){this.contentHeight=a;$("#"+this.htmlId+" .windowContent").css("height",a+"px")
};IPoolWindow.prototype.show=function(){this._redrawTitle();$("#"+this.htmlId).show()
};IPoolWindow.prototype._redrawTitle=function(){var b=this.width/7.5;var a="";if(this.title.length<b){a=this.title
}else{a=this.title.substring(0,b)+"..."}$("#"+this.htmlId+" > .windowTitle").text(a)
};IPoolWindow.prototype.close=function(a){var b=$(a.target);var c=b.parent();c.remove()
};