function addLoadEvent(func){var oldonload=window.onload;if (typeof window.onload !='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
initAjax=function (){var xmlHttp=false;self=this;if(window.XMLHttpRequest){
xmlHttp=new XMLHttpRequest();return xmlHttp;}else if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft XMLHTTP");return xmlHttp;}else{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");return xmlHttp;}}
initAjax.prototype.ajaxPostData=function(url){self.open("POST", url)
self.send(null);}
function textfield_hint(obj, value){if(!obj.value){obj.value=value;}}
function prepareInputsForHints(){var inputs=document.getElementsByTagName("input");for (var i=0;i<inputs.length;i++){
if (inputs[i].parentNode.getElementsByTagName("span")[0]){
inputs[i].onfocus=function (){this.parentNode.getElementsByTagName("span")[0].style.display="inline";}
inputs[i].onblur=function (){this.parentNode.getElementsByTagName("span")[0].style.display="none";}}}
var selects=document.getElementsByTagName("select");for (var k=0;k<selects.length;k++){if (selects[k].parentNode.getElementsByTagName("span")[0]){selects[k].onfocus=function (){this.parentNode.getElementsByTagName("span")[0].style.display="inline";}
selects[k].onblur=function (){this.parentNode.getElementsByTagName("span")[0].style.display="none";}}}}
function boxECToggle(id, auth_id){var object=document.getElementById(id);if(object.style.display=='none'){object.style.display='block';new Ajax.Request("http://mycrib.net/custom/ajax.php?show="+id+'&auth='+auth_id,{method:"get"});}else{object.style.display='none';new Ajax.Request("http://mycrib.net/custom/ajax.php?hide="+id+'&auth='+auth_id,{method:"get"});}}
function displayObjectx(id){var object=document.getElementById(id);if(object.style.display=='none'){object.style.display='block';}else{object.style.display='none';}}
function submitForm(selectedForm){document.getElementById(selectedForm).submit();}
var timeout=500;var closetimer=0;var ddmenuitem=0;function mopen(id){
mcancelclosetime();if(ddmenuitem)ddmenuitem.style.visibility='hidden';ddmenuitem=document.getElementById(id);ddmenuitem.style.visibility='visible';}
function mclose(){if(ddmenuitem.style.visibility=='visible'){if(ddmenuitem)ddmenuitem.style.visibility='hidden';}}
function mclosetime(){closetimer=window.setTimeout(mclose, timeout);}
function mcancelclosetime(){if(closetimer){window.clearTimeout(closetimer);closetimer=null;}}
