//alert("loaded"); var sErr__=""; var sSysFolders__="|/app_data/|/css/|/__cmsys/|/__interface/|/upload/|/images/|/aspnet_client/|/seaworld root/|/js/|/myfun root/|/__logs/|/__utils/|"; var sFirstInvalidField__=""; function setParentID(oSelObj__,bChangeLink__) { //alert(""); if(oSelObj__.name.substr(0,2)=="__") { //alert("1"); var sChildSelName__=oSelObj__.name.substr(2); sChildSelName__=sChildSelName__.substr(0,sChildSelName__.indexOf("_")); //alert(sChildSelName__); eval("document.Form." + sChildSelName__ + ".options").length=0; eval("document.Form." + sChildSelName__ + ".options[0]=new Option('','" + oSelObj__.value + "')"); var i=1; for (j=0;j'); function setTemplate(oForm,sTemplate__File) { bUseVersioning__=false; bForceNewVersion__=false; try { bUseVersioning__=(eval("oForm.VersionParent" + oForm.elements[0].name + ".value").length>0) ? true : false; } catch(e) {} if (bUseVersioning__) { try { if(oForm.elements[0].options[oForm.elements[0].selectedIndex].text.indexOf("(Archived)")!=-1) bForceNewVersion__=true; } catch(e) {} } if(bForceNewVersion__) { setRadioCheckedValue(oForm.PageTemplateID,oForm.__OldPageTemplateID.value); alert("You cannot alter templates on an old version of a page. If you wish to change templates do so from the Current version."); } else { oForm.target='_self'; oForm.__ACTION.value="8"; oForm.__CustomType.value=oForm.Category.options[oForm.Category.selectedIndex].text; oForm.CategoryTitle.value=oForm.Category.options[oForm.Category.selectedIndex].text; //oForm.action='/__cmsys/@Content/@updatepreview.asp'; oForm.action=''; oForm.submit(); } } function setRightList(oForm,sListTypeID__) { oForm.target='_self'; oForm.__ACTION.value="8"; oForm.__RightListCategoryTitle.value=oForm.RightListCategory.options[oForm.RightListCategory.selectedIndex].text; if(oForm.RightListCategory.value>0) oForm.RightListTitle.value=oForm.RightListCategory.options[oForm.RightListCategory.selectedIndex].text; oForm.action=''; oForm.submit(); } function postBack(oForm) { oForm.target='_self'; oForm.__ACTION.value="8"; oForm.action=''; oForm.enctype=''; //VCA oForm.submit(); } function closePreview() { parent.document.getElementById("UpdatePreviewDiv").style.display="none"; } function parseLink(sLink__) { var sParsedLink__=""; sLink__=sLink__.split("&").join("-and-"); var sReplaceChars__=" -&- -"; for(var i=0;i-1) { sChar__=sReplaceChars__.substr(sReplaceChars__.indexOf(sChar__)+1,1); } else { sChar__=""; } } sParsedLink__+=sChar__; } return sParsedLink__; } function parseInternalLink(sBasePath__,sPageTitle__,sExt__) { var sParsedPageTitle__=""; var sChar__; sPageTitle__=sPageTitle__.split("/").join("-and-"); sBasePath__=sBasePath__.split("//").join("/"); sParsedPageTitle__=parseLink(sBasePath__)+parseLink(sPageTitle__); return sParsedPageTitle__ + sExt__; } function autoFillFromTitle(sBasePath__,sPageTitle__,sExt__,bChangeLink__) { try { if(document.Form.BrowserTitle.value=="") document.Form.BrowserTitle.value=sPageTitle__; } catch(e) {} try { if(document.Form.NavTitle.value=="") document.Form.NavTitle.value=sPageTitle__; } catch(e) {} try { if(document.Form.MetaDescription.value=="") document.Form.MetaDescription.value=sPageTitle__; } catch(e) {} try { if(document.Form.MetaKeywords.value=="") document.Form.MetaKeywords.value=sPageTitle__; } catch(e) {} if(bChangeLink__) { try { if(getRadioCheckedValue(document.Form.PageTemplateID)!=-1) document.Form.InternalLink.value=parseInternalLink(sBasePath__,sPageTitle__,sExt__); } catch(e) {} } try { document.Form.__BreadCrumbPath.value=""; sBreadCrumb__=document.Form.__ParentID_1.options[document.Form.__ParentID_1.selectedIndex].text; if(sBreadCrumb__!='') document.Form.__BreadCrumbPath.value+=sBreadCrumb__+'#%|##%|'; } catch(e) {} try { sBreadCrumb__=document.Form.ParentID.options[document.Form.ParentID.selectedIndex].text; if(sBreadCrumb__!='') document.Form.__BreadCrumbPath.value+=sBreadCrumb__+'#%|##%|'; //.split('/').join('#%|##%|') } catch(e) {} } function autoFillFromTitle2(sBasePath__,sPageTitle__,sExt__,bChangeLink__) { try { if(document.Form.BrowserTitle.value=="") document.Form.BrowserTitle.value=sPageTitle__; } catch(e) {} try { if(document.Form.NavTitle.value=="" && document.Form.VersionParentContentID.value=='') document.Form.NavTitle.value=sPageTitle__; } catch(e) {} try { if(document.Form.MetaDescription.value=="") document.Form.MetaDescription.value=sPageTitle__; } catch(e) {} try { if(document.Form.MetaKeywords.value=="") document.Form.MetaKeywords.value=sPageTitle__; } catch(e) {} if(bChangeLink__) { try { if(getRadioCheckedValue(document.Form.PageTemplateID)!=-1) document.Form.InternalLink.value=parseInternalLink(sBasePath__,sPageTitle__,sExt__); } catch(e) {} } try { document.Form.__BreadCrumbPath.value=""; sBreadCrumb__=document.Form.__ParentID_2.options[document.Form.__ParentID_2.selectedIndex].text; if(sBreadCrumb__!='') document.Form.__BreadCrumbPath.value+=sBreadCrumb__+'#%|##%|'; sBreadCrumb__=document.Form.__ParentID_3.options[document.Form.__ParentID_3.selectedIndex].text; if(sBreadCrumb__!='') document.Form.__BreadCrumbPath.value+=sBreadCrumb__+'#%|##%|'; sBreadCrumb__=document.Form.__ParentID_4.options[document.Form.__ParentID_4.selectedIndex].text; if(sBreadCrumb__!='') document.Form.__BreadCrumbPath.value+=sBreadCrumb__+'#%|##%|'; } catch(e) {} } function getBodyHeight() { var x,y; var test1__ = document.body.scrollHeight; var test2__ = document.body.offsetHeight if (test1__ > test2__) // all but Explorer Mac { x = document.body.scrollWidth; y = document.body.scrollHeight; } else // Explorer Mac; //would also work in Explorer 6 Strict, Mozilla and Safari { x = document.body.offsetWidth; y = document.body.offsetHeight; } return y; } function displayImages(sField__){ openWindow__('/__cmsys/@image/@windowlist.asp?window=1&type=image&field__=' + sField__,'ImageReference','','',''); } //function displayIDPicker(sField__,sClass__){ // openWindow__('/__cmsys/@display/@selectdocument.asp?window=1&class=cContent__&field__=' + sField__,'PickerReference','','',''); //} function insertPromotion(sContentID__,sTitle__,sField__) { eval("parent.document.Form."+ sField__).value=sContentID__; eval("parent.document.Form.__"+ sField__+"Display").value=sTitle__; } function openWindow__(sUrl__,sRef__,sWidth__,sHeight__,sProperties__) { //alert(''); if(sProperties__=='') { sWidth__= (sWidth__=='') ? screen.width * 0.85 : sWidth__ ; // 70% sHeight__= (sHeight__=='') ? screen.height * 0.75 : sHeight__; // 70% var iLeft = (screen.width - sWidth__ ) / 2 ; var iTop = ( screen.height - sHeight__ ) / 2 ; var sProperties__ = "toolbar=no,status=yes,resizable=yes,dependent=yes,scrollbars=yes" ; sProperties__ += ",width=" + sWidth__ ; sProperties__ += ",height=" + sHeight__ ; sProperties__ += ",left=" + iLeft ; sProperties__ += ",top=" + iTop ; //'toolbar=no,width=800,height=670,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no'; } window.open(sUrl__,sRef__,sProperties__); } function checkPhones() { var oPhoneCheck = document.getElementById( 'hidCheckPhones' ); oPhoneCheck.value = ''; var aPhone=new Array(5); aPhone[0]="telephone"; aPhone[1]="mobile"; aPhone[2]="phone"; aPhone[3]="workPhone"; aPhone[4]="mobilePhone"; for(i=0; i <= aPhone.length; i++) { var el = document.getElementById(aPhone[i]); if( el ) { if(el.value != '') { oPhoneCheck.value = 'Yes'; return; } } } } function checkNameCompany() { var oNameCompanyCheck = document.getElementById( 'hidCheckNameCompany' ); oNameCompanyCheck.value = ''; var aCheck=new Array(2); aCheck[0]="firstname"; aCheck[1]="companyName"; for(i=0; i <= aCheck.length; i++) { var el = document.getElementById(aCheck[i]); if( el ) { if(el.value != '') { oNameCompanyCheck.value = 'Yes'; return; } } } }