/* DO NOT EDIT. THIS IS A CACHE FILE AND WILL GET OVERWRITTEN RANDOMLY.
INSTEAD EDIT THE TEMPLATE FROM WITHIN THE ADMIN ZONE, OR BY MANUALLY EDITING A TEMPLATES_CUSTOM OVERRIDE. */


new Image().src='http://ocportal.com/themes/default/images/bottom/loading.gif';function fix_form_enter_key(form)
{var submit=document.getElementById('submit_button');var inputs=form.getElementsByTagName('input');for(var i=0;i<inputs.length;i++)
{if(((inputs[i].type=='text')||(inputs[i].type=='password'))&&(typeof submit.onclick!='undefined')&&(submit.onclick)&&((typeof inputs[i].onkeypress=='undefined')||(!inputs[i].onkeypress)))
inputs[i].onkeypress=function(event){if(!event)event=window.event;if(enter_pressed(event))submit.onclick();};}}
function radioValue(radios)
{for(var i=0;i<radios.length;i++)
{if(radios[i].checked)return radios[i].value;}
return'';}
function confirmDelete()
{return window.confirm("Are you sure you want to delete this?");}
function setFieldError(theElement,errorMsg)
{var errorElement=null;if(typeof theElement.name!='undefined')
{var id=theElement.name;errorElement=document.getElementById('error_'+id);if(!errorElement)
{if((errorMsg=='')&&((id.indexOf('_month')!=-1)||(id.indexOf('_year')!=-1)||(id.indexOf('_hour')!=-1)||(id.indexOf('_minute')!=-1)))return;errorElement=document.getElementById('error_'+id.replace(/\_day$/,'').replace(/\_month$/,'').replace(/\_year$/,'').replace(/\_hour$/,'').replace(/\_minute$/,''));}
if(errorElement)
{errorElement.style.display=(errorMsg=='')?'none':'block';setInnerHTML(errorElement,'');if(errorMsg!='')
{var msgNode=document.createTextNode(errorMsg);errorElement.appendChild(msgNode);}}}
if(errorMsg!='')theElement.className=theElement.className+' input_erroneous';}
function try_to_simplify_iframe_form()
{var form_cat_selector=document.getElementById('form_cat_selector'),i,element,count=0,found,foundButton;var inputs=form_cat_selector.getElementsByTagName('input');var buttons=form_cat_selector.getElementsByTagName('button');var selects=form_cat_selector.getElementsByTagName('select');var elements=[];for(i=0;i<inputs.length;i++)elements.push(inputs[i]);for(i=0;i<buttons.length;i++)elements.push(buttons[i]);for(i=0;i<selects.length;i++)elements.push(selects[i]);for(i=0;i<elements.length;i++)
{element=elements[i];if(((element.nodeName.toLowerCase()=='input')&&(element.getAttribute('type')!='hidden')&&(element.getAttribute('type')!='button')&&(element.getAttribute('type')!='image')&&(element.getAttribute('type')!='submit'))||(element.nodeName.toLowerCase()=='select')||(element.nodeName.toLowerCase()=='textarea'))
{found=element;count++;}
if(((element.nodeName.toLowerCase()=='input')&&((element.getAttribute('type')=='button')||(element.getAttribute('type')=='image')||(element.getAttribute('type')=='submit')))||(element.nodeName.toLowerCase()=='button'))
{foundButton=element;}}
if((count==1)&&(found.nodeName.toLowerCase()=='select'))
{found.onclick=function(){var iframe=document.getElementById('iframe_under');if((iframe.contentDocument)&&(iframe.contentDocument.getElementsByTagName('form').length!=0))
{if(!window.confirm('Are you sure you want to switch to editing a different one? You will lose any unsaved changes you have made.'))return false;}
if(checkForm(form_cat_selector))
{animateFrameLoad(iframe,'iframe_under');form_cat_selector.submit();}
return true;}
foundButton.style.display='none';}}
function do_form_submit(form)
{if(!checkForm(form))return false;if((typeof form.old_action!='undefined')&&(form.old_action))form.setAttribute('action',form.old_action);if((typeof form.old_target!='undefined')&&(form.old_target))form.setAttribute('target',form.old_target);if(!form.getAttribute('target'))form.setAttribute('target','_top');if(form.getAttribute('method').toLowerCase()=='get')
{var i=0,name,elements=[];for(i=0;i<form.elements.length;i++)
{elements.push(form.elements[i]);}
for(i=0;i<elements.length;i++)
{name=elements[i].name;if((name.substr(0,11)=='label_for__')||(name.substr(0,14)=='tick_on_form__')||(name.substr(0,9)=='comcode__')||(name.substr(0,9)=='require__'))
{elements[i].parentNode.removeChild(elements[i]);}}}
if(form.onsubmit)
{var ret=form.onsubmit();if(!ret)return false;}
form.submit();disable_buttons_just_clicked(document.getElementsByTagName('input'));disable_buttons_just_clicked(document.getElementsByTagName('button'));return true;}
function disable_buttons_just_clicked(inputs)
{for(var i=0;i<inputs.length;i++)
{if((inputs[i].nodeName.toLowerCase()=='button')||(inputs[i].type=='image')||(inputs[i].type=='submit')||(inputs[i].type=='button'))
{if(inputs[i].getAttribute('accesskey')=='u')
{if((!inputs[i].disabled)&&(!inputs[i].under_timer))
{disable_button_just_clicked(inputs[i]);}}}}}
function do_form_preview(form,preview_url,has_separate_preview)
{if((window.checkForm)&&(!checkForm(form)))return false;var old_action=form.getAttribute('action');if((has_separate_preview)||(window.has_separate_preview))
{form.setAttribute('action',old_action+'&preview=1');return true;}
if(!form.old_action)form.old_action=old_action;form.setAttribute('action',preview_url+((form.old_action.indexOf('&uploading=1')!=-1)?'&uploading=1':''));var old_target=form.getAttribute('target');if(!old_target)old_target='_top';if(!form.old_target)form.old_target=old_target;form.setAttribute('target','preview_iframe');document.getElementById('submit_button').style.display='inline';var pf=document.getElementById('preview_iframe');window.setInterval(trigger_resize,500);animateFrameLoad(pf,'preview_iframe',50);var inputs=form.elements,input;for(var i=0;i<inputs.length-1;i++)
{input=inputs[i];if((input.type=='file')&&(!input.name.match(/file\d*/))&&(input.className.indexOf('previews')==-1)&&(!input.disabled)&&(input.value!=''))
{input.disabled=true;window.setTimeout('document.getElementById(\''+input.id+'\').disabled=false;',500);}}
return true;}
function checkForm(theForm)
{var i,j,theClass,theElement,required,myValue,erroneous=false,errorMsg,regexp,totalFileSize=0,alerted=false;for(j=0;j<theForm.elements.length;j++)
{if(!theForm.elements[j])continue;theElement=theForm.elements[j];errorMsg='';if(((theElement.type=='hidden')||((theElement.style.display=='none')&&((typeof window.areaedit_editors=='undefined')||(typeof areaedit_editors[theElement.id]=='undefined'))))&&((!theElement.className)||(theElement.className.indexOf('hidden_but_needed')==-1)))
{continue;}
if((theElement.type=='file')&&(theElement.files)&&(theElement.files.item)&&(theElement.files.item(0))&&(theElement.files.item(0).fileSize))
totalFileSize+=theElement.files.item(0).fileSize;if((theElement.type=='file')&&(theElement.value)&&(theElement.name!='file_novalidate'))
{var valid_types='asf,avi,bmp,css,csv,doc,docx,eml,gif,gz,ini,jpeg,jpg,mov,mp3,mpeg,mpg,odg,odp,ods,odt,ogg,pdf,php,png,ppt,pptx,ps,psd,pub,qt,ra,ram,rar,rm,sql,tar,tga,tif,torrent,tpl,txt,wav,wmv,xls,xlsx,zip'.split(/,/);var type_ok=false;var theFileType=theElement.value.indexOf('.')?theElement.value.substr(theElement.value.lastIndexOf('.')+1):'None';for(var k=0;k<valid_types.length;k++)
{if(valid_types[k].toLowerCase()==theFileType.toLowerCase())type_ok=true;}
if(!type_ok)
{errorMsg="Sorry, but &lsquo;xx1xx&rsquo; files are not enabled for this website.\n<br />The following file types are enabled: asf,avi,bmp,css,csv,doc,docx,eml,gif,gz,ini,jpeg,jpg,mov,mp3,mpeg,mpg,odg,odp,ods,odt,ogg,pdf,php,png,ppt,pptx,ps,psd,pub,qt,ra,ram,rar,rm,sql,tar,tga,tif,torrent,tpl,txt,wav,wmv,xls,xlsx,zip.".replace(/xx1xx/g,theFileType).replace(/<[^>]*>/g,'').replace(/&[lr][sd]quo;/g,"'").replace(/,/g,', ');if(!alerted)window.alert(errorMsg);alerted=true;}}
if((browser_matches('ie'))&&(theElement.value)&&(theElement.nodeName.toLowerCase()!='select'))
{bad_word_chars=[8216,8217,8220,8221];fixed_word_chars=["'","'",'"','"'];for(i=0;i<bad_word_chars.length;i++)
{regexp=new RegExp(String.fromCharCode(bad_word_chars[i]),'gm');theElement.value=theElement.value.replace(regexp,fixed_word_chars[i]);}}
theClass=firstClassName(theElement.className);if((theElement.name=='delete')&&(theClass=='input_tick')&&(theElement.checked))return confirmDelete();required=theElement.className.indexOf('_required');myValue=theElement.value;if(!myValue)myValue='';if((typeof window.areaedit_editors!='undefined')&&(theElement.style.display=='none')&&(typeof areaedit_editors[theElement.id]!='undefined'))
{myValue=areaedit_editors[theElement.id].getHTML();if((myValue=="\n")||(myValue=="<br />"))myValue="";}
if(theElement.getAttribute('type')=='radio')
{myValue='';for(i=0;i<=theForm.elements.length;i++)
{if(!theForm.elements[i])continue;if((theForm.elements[i].checked)&&(theForm.elements[i].name==theElement.name))
myValue=theForm.elements[i].value;}}
if((theElement.nodeName.toLowerCase()=='select')&&(theElement.selectedIndex>=0))
{myValue=theElement.options[theElement.selectedIndex].value;if((myValue=='')&&(theElement.getAttribute('size')>1))myValue='-1';}
if((required!=-1)&&((myValue=='')||(myValue=='****')))
{errorMsg="This is a required field and must therefore be filled in";}else
{if((theElement.className.indexOf('date')!=-1)&&(theElement.name.substr(theElement.name.length-4)=='_day')&&(myValue!=''))
{var day=myValue;var month=theForm.elements[theElement.name.replace('_day','_month')].options[theForm.elements[theElement.name.replace('_day','_month')].selectedIndex].value;var year=theForm.elements[theElement.name.replace('_day','_year')].options[theForm.elements[theElement.name.replace('_day','_year')].selectedIndex].value;var source_date=new Date(year,month-1,day);if(year!=source_date.getFullYear())errorMsg="This was not a real calendar date";if(month!=source_date.getMonth()+1)errorMsg="This was not a real calendar date";if(day!=source_date.getDate())errorMsg="This was not a real calendar date";}
if(((theClass=='input_email')||(theClass=='input_email_required'))&&(myValue!='')&&(myValue!='****')&&(!myValue.match(/^[a-zA-Z0-9\._\-]+@[a-zA-Z0-9\._\-]+$/)))
{errorMsg="You specified a non-valid e-mail address (e-mail addresses contain \"@\")".replace('xxx',myValue);}
if(((theClass=='input_username')||(theClass=='input_username_required'))&&(myValue!='')&&(myValue!='****')&&(window.do_ajax_field_test)&&(!do_ajax_field_test('/data/username_exists.php?username='+encodeURIComponent(myValue))))
{errorMsg="xxx is not an active username".replace('xxx',myValue);}
if(((theClass=='input_integer')||(theClass=='input_integer_required'))&&(myValue!='')&&(myValue!='****')&&(parseInt(myValue)!=myValue-0))
{errorMsg="A field that was supposed to be an integer (whole number) was not".replace('xxx',myValue);}
if(((theClass=='input_float')||(theClass=='input_float_required'))&&(myValue!='')&&(myValue!='****')&&(parseFloat(myValue)!=myValue-0))
{errorMsg="A field that was supposed to be a float (decimal number) was not".replace('xxx',myValue);}}
setFieldError(theElement,errorMsg);if((errorMsg!='')&&(!erroneous))
{try{theElement.focus();}catch(e){};erroneous=true;}}
if((totalFileSize>0)&&(theForm.elements['MAX_FILE_SIZE']))
{if(totalFileSize>theForm.elements['MAX_FILE_SIZE'].value)
{erroneous=true;if(!alerted)
{window.alert("The maximum upload limit is {2}KB, but you are trying to upload {1}KB.".replace(new RegExp('\\\{'+'1'+'\\\}','g'),Math.round(totalFileSize/1024)).replace(new RegExp('\\\{'+'2'+'\\\}','g'),Math.round(theForm.elements['MAX_FILE_SIZE'].value/1024)));}
alerted=true;}}
if(erroneous)
{window.scrollTo(0,0);if(!alerted)window.alert("You did not fill in all fields on the form correctly");}
return!erroneous;}
function standardAlternateFields(_a,_b,_c,non_actually_required)
{if(!non_actually_required)non_actually_required=false;var a=_standardAlternateFieldsGet(_a);var b=_standardAlternateFieldsGet(_b);var c;if(_c)c=_standardAlternateFieldsGet(_c);if(((a)&&(!a.alternating))||((b)&&(!b.alternating))||((c)&&(!c.alternating)))
{var selfFunction=function(e){standardAlternateFields(_a,_b,_c,non_actually_required);};_standardAlternateFieldEventSet(a,selfFunction);_standardAlternateFieldEventSet(b,selfFunction);_standardAlternateFieldEventSet(c,selfFunction);}
if((a)&&(a.value!='')&&(a.value!='-1'))return _standardAlternateFieldsSet(a,b,c,non_actually_required);if((b)&&(b.value!='')&&(b.value!='-1'))return _standardAlternateFieldsSet(b,a,c,non_actually_required);if((c)&&(c.value!='')&&(c.value!='-1'))return _standardAlternateFieldsSet(c,a,b,non_actually_required);if(a)_standardAlternateFieldSet(a,null,false,true,non_actually_required);if(b)_standardAlternateFieldSet(b,null,false,true,non_actually_required);if(c)_standardAlternateFieldSet(c,null,false,true,non_actually_required);return null;}
function _standardAlternateFieldEventSet(a,selfFunction)
{if(a)
{if(typeof a.name!='undefined')
{addEventListenerAbstract(a,"keyup",selfFunction);addEventListenerAbstract(a,"change",selfFunction);a.fakeonchange=selfFunction;a.alternating=true;}else
{var i;for(i=0;i<a.length;i++)
{addEventListenerAbstract(a[i],"keyup",selfFunction);addEventListenerAbstract(a[i],"change",selfFunction);a[i].fakeonchange=selfFunction;a[i].alternating=true;}
a.alternating=true;}}
return null;}
function _standardAlternateFieldsGet(x)
{if(x.indexOf('*')==-1)
{return document.getElementById(x);}
x=x.substr(0,x.length-1);var _x=[],i,j,c=0,e;_x['value']='';for(i=0;i<document.forms.length;i++)
{for(j=0;j<document.forms[i].elements.length;j++)
{e=document.forms[i].elements[j];if(e.name==x)
{_x[c]=e;if(e.checked)
{_x['value']=e.value;}
if(e.alternating)_x.alternating=true;c++;}}}
return _x;}
function _standardAlternateFieldsSet(a,b,c,non_actually_required)
{if(a)_standardAlternateFieldSet(a,a,false,true,non_actually_required);if(b)_standardAlternateFieldSet(b,a,true,false,non_actually_required);if(c)_standardAlternateFieldSet(c,a,true,false,non_actually_required);}
function _standardAlternateFieldSet(us,selected,locked,required,non_actually_required)
{if(typeof us.name!='undefined')
{setLocked(us.name,locked,selected);if(!non_actually_required)setRequired(us.name,required);}else
{if(us[0])
{if(!non_actually_required)setRequired(us[0].name,required);}
var i;for(i=0;i<us.length;i++)
{if(us[i].id)
{setLocked(us[i].id,locked,selected);if(!non_actually_required)setRequired(us[i].id,required);}}}}
function setLocked(name,locked,selected)
{var element=document.getElementById(name);if(element)
{if(locked)
{var labels=document.getElementsByTagName('label'),label=null;for(var i=0;i<labels.length;i++)
{if(labels[i].getAttribute('for')==selected.id)
{label=labels[i];break;}}
if(label)
{var label_nice=getInnerHTML(label).replace('&raquo;','').replace('»','').replace(/^\s*/,'').replace(/\s*$/,'');if(element.type=='file')
{setFieldError(element,'Blank out the \'{1}\' field if you wish to upload a new file'.replace(/\{1\}/,label_nice));}else
{setFieldError(element,'Blank out the \'{1}\' field if you wish to set this field instead'.replace(/\{1\}/,label_nice));}}else
{setFieldError(element,'Blank out the competing field (or set to N/A) if you wish to use this one instead');}}else
{setFieldError(element,'');}
element.disabled=locked;}}
function setRequired(name,required)
{var element=document.getElementById(name);var required_a=document.getElementById('requirea__'+name);var required_b=document.getElementById('requireb__'+name);var required_c=document.getElementById('requirec__'+name);var required_d=document.getElementById('required__'+name);if(element)element.className=element.className.replace(/(input\_[a-z\_]+)_required/g,'$1');if(required)
{if(element)element.className=element.className.replace(/(input\_[a-z\_]+)/g,'$1_required');if(required_a)required_a.className='de_th dottedborder_barrier_a_required';if(required_d)required_d.className='dottedborder_barrier_b_required';if(required_b)required_b.style.display='inline';if(required_c)required_c.value=1;}else
{var error=document.getElementById('error__'+name);if(error)error.style.display='none';if(required_a)required_a.className='de_th dottedborder_barrier_a_nonrequired';if(required_d)required_d.className='dottedborder_barrier_b_nonrequired';if(required_b)required_b.style.display='none';if(required_c)required_c.value=0;}}
function toggleSubordinateFields(pic,help_id)
{var new_state,new_state_2,new_state_3,i;var tr=pic.parentNode.parentNode.parentNode;var next=tr.nextSibling;if(!next)return;while(next.nodeName.toLowerCase()!='tr')
{next=next.nextSibling;if(next.className=='form_screen_field_spacer')
{next=null;break;}
if(!next)break;}
if(((!next)&&(pic.src.indexOf('expand')!=-1))||((next)&&(next.style.display=='none')))
{pic.src=(pic.src.indexOf("themewizard.php")!=-1)?pic.src.replace("expand","contract"):"http://ocportal.com/themes/default/images/contract.png";new_state=browser_matches('ie')?'block':'table-row';new_state_2='block';new_state_3='1px dashed';}else
{pic.src=(pic.src.indexOf("themewizard.php")!=-1)?pic.src.replace("contract","expand"):"http://ocportal.com/themes/default/images/expand.png";new_state='none';new_state_2='none';new_state_3='0';}
while(tr.nextSibling)
{tr=tr.nextSibling;if(tr.nodeName.toLowerCase()!='tr')continue;if(tr.className=='form_screen_field_spacer')break;tr.style.display=new_state;if(browser_matches('ie_old'))
{for(i=0;i<tr.cells.length;i++)
{tr.cells[i].style.border=new_state_3;tr.cells[i].style.display=new_state;}}}
if(!help_id)help_id=pic.parentNode.id+'_help';var help=document.getElementById(help_id);if(help)help.style.display=new_state_2;trigger_resize();}
function choose_picture(id,ob,name)
{var r=document.getElementById(id);if(!r)return;var e=r.form.elements[name];for(var i=0;i<e.length;i++)
{var img=e[i].parentNode.parentNode.getElementsByTagName('img')[0];if((img)&&(img!=ob))
{img.style.outline='0';if(!browser_matches('ie_decent'))img.style.background='none';if(!browser_matches('no_alpha_ie_with_opacity'))setOpacity(img.parentNode,0.5);}}
r.checked=true;if(r.onclick)r.onclick();if(typeof r.fakeonchange!='undefined'&&r.fakeonchange)r.fakeonchange();if(!browser_matches('no_alpha_ie_with_opacity'))setOpacity(ob.parentNode,1.0);ob.style.outline='1px dotted';if(!browser_matches('ie_decent'))ob.style.background='gray';}
function disable_preview_scripts(under)
{if(!under)under=document;var elements,i;var no_go=function(){window.alert('You are previewing, so button clicks have been disabled.');return false;};elements=under.getElementsByTagName('button');for(i=0;i<elements.length;i++)
elements[i].onclick=no_go;elements=under.getElementsByTagName('input');for(i=0;i<elements.length;i++)
if((elements[i].getAttribute('type')=='button')||(elements[i].getAttribute('type')=='image'))elements[i].onclick=no_go;elements=under.getElementsByTagName('a');for(i=0;i<elements.length;i++)
elements[i].target='false_blank';}