function stopError(){ return true; } //window.onerror=stopError;
//---------ERRORS & SNIFFING-----------------------------------------------
// browser SNIFF 
var browser,platform,firefoxversionerror,otherbrowsererror,iemacerror,tempsafarierror = false;
function browserSniff(){
	if( !document.getElementById ){ 
		alert("Your browser does not support the DHTML standard \"getElementById()\"\n please return to cumbancha with an updated browser.");
		document.location.href = "http://www.mozilla.com/";
	}
}	browserSniff();

//general vars, descriptions, etc.
var page_loaded = false;
var scroll_anchor = false;
//
function init(){
	//////////////////////////////////
}
//+++++++++++++++++++++++++++++++++++++++++++++++
function share( host, uri, title, via ){
	var uri = (host=='facebook')? 'http://www.facebook.com/sharer.php?u='+encodeURIComponent(uri)+'&t='+encodeURIComponent(title)
	: (host=='twitter')? 'http://www.twitter.com/share?url='+uri+'&via='+via+'&text='+encodeURIComponent(title) 
	: false;
	window.open(uri,'Cascadia Commons Share','toolbar=0,status=0,width=626,height=436');
	return false;
}
//+++++++++++++++++++++++++++++++++++++++++++++++
var last_showing = false;
function hide_it( id ){
	var obj = document.getElementById(id);
	if( !obj ){ alert("hide_it failed: "+id); }
	else{ document.getElementById(id).style.display = "none"; }
}
function show_it( id ){
	var obj = document.getElementById(id);
	if( !obj ){ alert("hide_it failed: "+id); }
	else{ document.getElementById(id).style.display = "block"; }
	last_showing = id;
}
function toggle_visibility( id ){
	var obj = document.getElementById(id);
	if( obj.style.display == "none" ){ obj.style.display = "block"; }
	else{ obj.style.display = "none"; }
	return false;
}
//+++++++++++++++++++++++++++++++++++++++++++++++
function ScrollTo(obj){
	try{ var objpos = ObjectPosition(obj); }catch(e){}
	try{ scroll(0,objpos[1]); }catch(e){}
	try{ window.scrollTo(0,objpos[1]); }catch(e){}
}
function ObjectPosition(obj) {
	var curleft = 0; var curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}
function scroll_to_top(){
	try{ scroll(0,0); }catch(e){}
	try{ window.scrollTo(0,0); }catch(e){}
	return true;
}
//+++++++++++++++++++++++++++++++++++++++++++++++

function pressed_enter( e ){ //e is event object passed from function invocation
	var characterCode;// literal character code will be stored in this variable
	//if which property of event object is supported (NN4)
	if( e && e.which ){ e = e; characterCode = e.which; }//character code is contained in NN4's which property
	else{ e = event; characterCode = e.keyCode; } //alert(characterCode); //character code is contained in IE's keyCode property;
	if( characterCode == 13 ){ return true; }//if generated character code is equal to ascii 13 (if enter key)
	else{ return false; }
}

