var DialogCount=0;function ShowHide(a){ele=document.getElementById(a).style;if(ele.visibility=="hidden"){ele.visibility="visible"}else{ele.visibility="hidden"}}function OpenCloseFieldSet(a,b,d){EleCheck=document.getElementById("FormDiv_"+a);if(EleCheck!=null){ele=document.getElementById("FormDiv_"+a)}else{ele=document.getElementById(a)}fie=document.getElementById("FieldSet_"+a);img=document.getElementById("Image_"+a);if(ele.style.display=="block"){ele.style.display="none";img.src=img.src.replace("minus","plus")}else{ele.style.display="block";img.src=img.src.replace("plus","minus");if(ele.innerHTML.length<10&&b.length!=0){LoadDiv(a,b,"&"+d)}}}function swithTab(b,a){Tabobj=document.getElementById(b);TabBtnobj=document.getElementById(b+"Btn");if(a){Tabobj.style.display="inline";Tabobj.style.visibility="visible";TabBtnobj.className="active"}else{Tabobj.style.visibility="hidden";Tabobj.style.display="none";TabBtnobj.className=""}}function showTab(a,b){Tabobj=document.getElementById("tab"+a);TabBtnobj=document.getElementById("tab"+a+"Btn");Tabobj.style.display="inline";Tabobj.style.visibility="visible";TabBtnobj.className="active";for(i=0;i<b.length;i++){if(a!=b[i]){Tabobj=document.getElementById("tab"+b[i]);TabBtnobj=document.getElementById("tab"+b[i]+"Btn");Tabobj.style.visibility="hidden";Tabobj.style.display="none";TabBtnobj.className=""}}}function LoadPages(d,b,a){LoadDiv("DivMainContainer",d,b,a)}function LoadDiv(f,h,g,d){if(d==null){d={}}var a={type:"GET"};for(var b in a){if(typeof d[b]=="undefined"){d[b]=a[b]}}if(!g){g=""}jQuery.blockUI({baseZ:getMaxzIndex()+20});jQuery.ajax({type:d.type,url:"index.cfm?fa="+h,data:g,cache:false,success:function(k){$("#"+f).html(k);if(d.onSuccess!=null){d.onSuccess()}jQuery.unblockUI()},error:function(k,m,l){DisplayGlobalError(k)}})}function CallJSonFuse(b,a){jQuery.blockUI();jQuery.ajax({type:"GET",dataType:"json",url:"index.cfm?fa="+b,data:a,success:function(d){$.unblockUI();return d},error:function(d,g,f){DisplayGlobalError(d)}})}function getMaxzIndex(){var a=1000;$(".ui-dialog").each(function(){a=Math.max(a,$(this).css("z-index"))});return a}function DisplayGlobalError(a){if(a!=undefined){$("#divErrDialogDetail").html(a.responseText);$.blockUI({message:$("#ErrDialog"),css:{border:"none",width:"500px"},baseZ:getMaxzIndex()+20})}}function LoadNewScript(d,b,a){if(!b){b=""}jQuery.getScript("index.cfm?fa="+d+b)}function LoadScript(b,a){var d=document.getElementsByTagName("head")[0];sSRCArray=a.split(",");for(i=0;i<document.getElementsByTagName("script").length;i++){NameArray=document.getElementsByTagName("script")[i].src.split("/");FileName=NameArray[NameArray.length-1];for(j=sSRCArray.length;j>=0;j--){if(sSRCArray[j]==FileName){sSRCArray.splice(j)}}}for(i=0;i<sSRCArray.length;i++){NewScript=document.createElement("script");NewScript.src="/GlobalIncludes_Sub/js/"+b+"/"+sSRCArray[i];NewScript.type="text/javascript";d.appendChild(NewScript)}}function LoadDynamicFunction(b){var a=document.getElementsByTagName("head")[0];NewScript=document.createElement("script");NewScript.type="text/javascript";NewScript.innerHTML=b;a.appendChild(NewScript)}function trim(b){if(b!=null){var d=/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g;var a=b.replace(d,"");return a}else{return""}}function ConfirmFunction(a,g,d,b){var f=confirm(a);if(f==true){if(b!=null){LoadDiv(b,g,d)}else{LoadPages(g,d)}}}function ConfirmSubmitForm(a,f,d,b){var g=confirm(a);if(g==true){CreateFormFieldObj(f,d,b)}}function CreateFormFieldObj(l,a,p){var h=l;var d=false;if(a==null){a="DivMainContainer"}if(p==null){p={}}var g={SkipClientSide:true,ValidationFunc:GenericValidation};for(var k in g){if(typeof p[k]=="undefined"){p[k]=g[k]}}if(p.SkipClientSide||p.ValidationFunc(h)){var n=new Array();for(i=0;i<h.length;i++){e=h.elements[i];if((e.type!="button")){if((e.type!="checkbox")&&(e.type!="radio")&&(e.type!="select-multiple")){n[n.length]=e}else{if(e.type!="select-multiple"){chkObjExist=0;for(j=0;j<n.length;j++){if(n[j].name==e.name){chkObjExist=j}}if(!chkObjExist){idx=n.length;n[idx]=new oCR(e);n[idx].myOptions[n[idx].myOptions.length]=new oCROption(e.checked,e.value)}else{n[chkObjExist].myOptions[n[chkObjExist].myOptions.length]=new oCROption(e.checked,e.value)}}else{idx=n.length;n[idx]=new oCR(e);for(j=0;j<e.length;j++){n[idx].myOptions[n[idx].myOptions.length]=new oCROption(e[j].selected,e[j].value)}}}}}var b="";for(i=0;i<n.length;i++){if((n[i].type!="checkbox")&&(n[i].type!="radio")&&(n[i].type!="select-multiple")){b+="&"+n[i].name+"="+encodeURIComponent(n[i].value)}else{var o=new Array();for(j=0;j<n[i].myOptions.length;j++){if(n[i].myOptions[j].checked){o.push(n[i].myOptions[j].value)}}b+="&"+n[i].name+"="+encodeURIComponent(o);if(n[i].name=="fuseaction"){var m=o}}}if(h.fuseaction.value!=null){LoadDiv(a,h.fuseaction.value,b,p)}else{LoadDiv(a,m,b,p)}return true}else{return false}}function GenericValidation(d,a){var g=d;for(i=0;i<g.length;i++){e=g.elements[i];if((a!=null)&&(a[e.name]!=null)){continue}e.alt=trim(e.alt);var h=e.getAttribute("valrequired");var k=e.getAttribute("format");var b=e.getAttribute("allowedchar");if(e.name!=null&&e.name.search(/_compare/)!=-1){c=e.name.split("_");document.getElementById(c[0]).compare=e}if((h!=null)&&(h.toLowerCase()=="true")){e.optional=false}else{e.optional=true}if((e.type=="select-one")&&(e.value==0)){e.alt=trim(e.title);e.min=1}else{if((e.type=="text")&&((k!=null)&&(k.toLowerCase()=="email"))){e.emailFormat=true;e.allowChar="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_@.+-*"}else{if((e.type=="text")&&((k!=null)&&(k.toLowerCase()=="numeric"))){e.numeric=true;if(e.getAttribute("min")!="null"){e.min=e.getAttribute("min")}if(e.getAttribute("max")!="null"){e.max=e.getAttribute("max")}}else{if((e.type=="text")&&b!=null&&b!=""){e.allowChar=b}else{if(e.type=="textarea"){e.alt=trim(e.title)}else{if((e.type=="hidden")&&(e.name.search(/FileUploaded/)==0)){e.alt=trim(e.title)}}}}}}}if(clickcheck==0){return verify(g,true,false)}else{return false}}EvalScript=function(sString){if(sString!=null){var regEx=/<script\b[^>]*>([\s\S]*?)<\/script>/ig;while((scripts=regEx.exec(trim(sString)))!=null){eval(scripts[1])}}};function ShowTabItem(a,f,b,d){Tab=document.getElementById(a+"_"+f);TabLength=(document.getElementById(a+"_Length").value);for(i=1;i<=TabLength;i++){document.getElementById(a+"_"+i).className="TabOff"}for(i=1;i<=TabLength;i++){if(document.getElementById(a+"_"+i)){document.getElementById(a+"_"+i).className="TabOff"}}for(i=1;i<=TabLength;i++){if(document.getElementById("DivTab"+a+"_"+i)){document.getElementById("DivTab"+a+"_"+i).style.display="none"}}Tab.className="TabOn";LoadDiv("DivTab"+a,b,d)}function ShowTabDataItem(a,b){Tab=document.getElementById(a+"_"+b);TabDiv=document.getElementById("DivTab"+a+"_"+b);TabLength=(document.getElementById(a+"_Length").value);for(i=1;i<=TabLength;i++){if(document.getElementById(a+"_"+i)){document.getElementById(a+"_"+i).className="TabOff"}}for(i=1;i<=TabLength;i++){if(document.getElementById("DivTab"+a+"_"+i)){document.getElementById("DivTab"+a+"_"+i).style.display="none"}}Tab.className="TabOn";TabDiv.style.display="block";document.getElementById("DivTab"+a).innerHTML=""}function closePopWin(){$("#Dialog_"+(DialogCount-1)).dialog("close")}function showPopWin(m,l,d,g,f,n){if(n==null){n={}}var h={Resize:true,onClose:null,Type:"GET",Position:"center"};for(var k in h){if(typeof n[k]=="undefined"){n[k]=h[k]}}if(!l){l=""}if(d==null){d=window.innerWidth-60}if(g==null){g=window.innerHeight-80}var b="Dialog_"+DialogCount;newDiv=document.createElement("DIV");newDiv.setAttribute("id",b);document.body.appendChild(newDiv);DialogCount++;var a={title:f,modal:true,autoOpen:true,height:g,width:d,resizable:n.Resize,position:n.Position,open:function(){$.blockUI({baseZ:getMaxzIndex()+20});jQuery.ajax({type:n.Type,url:"index.cfm?fa="+m,data:l,cache:false,success:function(o){$("#"+b).html(o);$.unblockUI()},error:function(o,q,p){DisplayGlobalError(o)}})},close:function(o,p){$(this).remove();DialogCount--;if(n.onClose!=null){n.onClose()}}};$("#"+b).dialog(a)}function showPopWinByForm(l,f,g,m){if(m==null){m={}}var h={type:"GET",resize:true,DivName:"null",WindowTitle:""};for(var k in h){if(typeof m[k]=="undefined"){m[k]=h[k]}}var b=document.getElementById(l);var d="Dialog_"+DialogCount;newDiv=document.createElement("DIV");newDiv.setAttribute("id",d);document.body.appendChild(newDiv);DialogCount++;var a={title:m.WindowTitle,modal:true,autoOpen:true,height:g,width:f,resizable:m.resize,open:function(){CreateFormFieldObj(b,d,m)},close:function(n,o){$(this).remove();DialogCount--;if(m.closeFunction!=null){m.closeFunction()}}};$("#"+d).dialog(a)}function translate(a,b){google.language.translate(a,"en",b,function(d){if(!d.error){var f=document.getElementById("iLangID_"+b);f.value=d.translation}})}function ShowMediaTinyList(f,b,d,g){var a=window.location.toString();if(a.indexOf("?")<0){a=a+"?fa=MediaMod.BrowseTinyMceImageFile"}tinyMCE.activeEditor.windowManager.open({file:a,title:"Media Browser",width:900,height:750,resizable:"yes",inline:"yes",close_previous:"no"},{window:g,input:f});return false}function isCheckedByClass(b){var a=jQuery("."+b+":checked");return(a.length>0)}function GridCheckAll(b,a){jQuery("."+b).attr("checked",a)}function UploadFormFieldObj(d,f,b){var a=window["ajaxUpl_"+d];if((a!=null)&&(a.isOnQueue())){a.submit()}else{CreateFormFieldObj(document.getElementById(f),b,{type:"POST"})}};
