/* <![CDATA[ */
//GenFuncs.js
(function(){
	window.Sanity=window.Sanity||{
		counter:0,check:function(test,fn,timeout){
			if(!eval(test)){
				if(Sanity.counter++<(timeout*75)){window.setTimeout(function(){Sanity.check(test,fn,timeout);},10);}
				else{throw new Error('Script timed out: cannot run '+fn.toString().substr(0,fn.toString().indexOf('('))+'()');}
			}
			else{Sanity.counter=0;fn();}
		},reset:function(){Sanity.counter=0;}
	};
})();


	var d = document;
  
  function resizeBox(){

	if(d.getElementById("container")){
		    
		sObj = d.getElementById("container").style
   		if(d.body.clientWidth){sObj.width=(d.body.clientWidth>800)?"430px":"100%";}
	}
  }
  
  window.onload=function(){
	  resizeBox();
	 // if(searchBoxFuncs){searchBoxFuncs();}
  }
  window.onresize=resizeBox;
  
  function toggleDescription(oBut,oDesc){ 
  	if (oDesc.style.display=='none'){
	  	oDesc.style.display='block';
		oBut.value='-';
	}else{
		oDesc.style.display='none';
		oBut.value='+';
	}
  }
  
  function openTerms(){
	  	document.getElementById('termsDiv').style.display='block';
	}
	
	function checkSearch(theText){
		if (theText == '' || theText == 'find...'){
			alert('You must enter something to search on');
			return false;
		}else{
			location.href='/events.aspx?p=s&s=' + theText;
		}
	}	
	
/* ]]> */