
function checkFrequencyBox(obj,id){if($(obj).hasClass("uncheck")){$("span[id*='freq_checkbox']").each(function(){if($(this).hasClass("check")){uncheckBox(this);}});checkBox(obj);if(subs.update!=null&&!subs.update){subs.update=true;}}}
function selectADeviceBox(obj){objChkbox=$(obj).prev()[0];if(objChkbox.disabled==true){objChkbox.disabled=false;}
if($(obj).hasClass("uncheck")){$(obj).removeClass("uncheck").addClass("check").prev()[0].value=1;}else{$(obj).removeClass("check").addClass("uncheck").prev()[0].value=0;}
if(subs.update!=null&&!subs.update){subs.update=true;}}
function checkDocTypeBox(obj){if($(obj).hasClass("uncheck")){checkBox(obj);}else{objCheckAll=document.getElementById("doctype_checkbox_all");if(objCheckAll){uncheckBox(objCheckAll);}
uncheckBox(obj);}
if(subs.update!=null&&!subs.update){subs.update=true;}}
function boxCheckAll(obj){if($(obj).hasClass("uncheck")){$(obj).parent().parent().find("span").filter(".uncheck").each(function(){checkBox(this);});checkBox(obj);}else{$(obj).parent().parent().find("span").filter(".check").each(function(){uncheckBox(this);});uncheckBox(obj);}
if(subs.update!=null&&!subs.update){subs.update=true;}}
function uncheckBox(obj){$(obj).removeClass("check").addClass("uncheck").prev()[0].checked=false;}
function checkBox(obj){$(obj).removeClass("uncheck").addClass("check").prev()[0].checked=true;}
Subscribe=function(){this.htmlSubscribePanel='<span><div class="popup pos w300" id="subscribePanel" style="display: none; z-index: 4; float: right; margin-left: 2px;">'
+' <div id="psub" class="bgbox">'
+'  <img align="left" src="'+themeImagePath+'/boxa.png"/>'
+'  <div id="subtask">'
+'   <img align="left" src="'+themeImagePath+'/leftline.png"/>'
+'   <div id="bgsubs">'
+'    <div>Subscription Preferences</div>'
+'    <img id="flrght" align="right" class="cur" src="'+themeImagePath
+'/btclose.png" border="0" style="margin-top:4px; float: right;" />'
+'    </div>'
+'   <img align="left" src="'+themeImagePath+'/rightlines.png" />'
+'  </div>'
+'  <div id="subsContent">'
+'   <img align=left src="'+themeImagePath+'/boxd.png" />'
+'   <center style="background-color: #CECDCD; margin: 0px 10px 0px 10px;">'
+'    <img align="center" src="'+contextPath+'/images/ajax_loader.gif" style="margin: 10px 114px 10px 114px; float: none;" />'
+'   </center>'
+'  </div>'
+'   <img align=left src="'+themeImagePath+'/boxb.png" />'
+' </div>'
+'</div></span>';this.loadSubsPanel=function(objectId,objectType){if($("#subscribePanel").length==0){var containerId="panel";$("div#"+containerId).prepend(this.htmlSubscribePanel);$("#subscribePanel").slideDown("slow");$("#subscribePanel").find("img#flrght").unbind("click").bind("click",function(){if(typeof(subs)=='object'&&subs.update==true){Common.confirmClosePopup({success:function(){popupManager.closePopup();subs.onSubmit();},cancel:function(){popupManager.closePopup();subsHandler.closeSubsPanel();},close:function(){popupManager.closePopup();}});}else{subsHandler.closeSubsPanel();}});datas={objectId:objectId,objectType:objectType};gotoSWRAjax(contextPath+"/swr/viewSubscribe",null,subsHandler.loadSubsHtml,datas,function(){$("#subscribePanel").remove();});scroll(JSUtil.getXScroll(),0);}}
this.closeSubsPanel=function(){$("#subscribePanel").slideUp("slow",function(){$("#subscribePanel").remove();});}
this.loadSubsHtml=function(strHtml){if(strHtml!=null&&strHtml!=""){$("#subsContent").html(strHtml);}else{subsHandler.closeSubsPanel();}}}
subsHandler=new Subscribe();