window.onerror=function(){return true};

fUrl=false;

function flariaFlash(){result=false;if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]){result=navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;}else if (document.all && (navigator.appVersion.indexOf("Mac")==-1)){eval ('try {var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if (xObj) result = true; xObj = null; } catch (e) {}');}return result;}

function flariaUrl(u){u=="index"?window.location = "#":window.location = "#/"+u+"/";fUrl=true;current_hash = ""}
function flariaTitle(t){document.title=t}

var current_hash = window.location.hash;
var flariaIndex = current_hash.replace("#","").replace(/\//g,"");

function check_hash() {
    if ( window.location.hash != current_hash ) {
        current_hash = window.location.hash;
    if(!fUrl){as_wysiwyg(current_hash.replace("#","").replace(/\//g,""))}fUrl=false;
	}else{
	
	}
}



hashCheck = setInterval( "check_hash()", 50 );

function changeStyle(url) {document.getElementById('stylesheet').href = url;}function clearDiv(id){document.getElementById(id).innerHTML=""}
function open_wrapper(c,b){if(c == "getStatus"){return true}else{flariaCMS("","",c,"","",b);}};
function flariaMod(c){flariaDiv();fHide('rteSave');document.getElementById('modAdmin').src=c;fShow('modEdit')}





function flariaHeight(h){
	document.getElementById("flaria_container").style.height = h + "px";
     document.getElementById("flaria_swf").style.height = h + "px";
}

    function showDiv(style,id) {
       var e = document.getElementById(id);
       if(style == 'false')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	
	var me;

function getID( swfID ){
     if(navigator.appName.indexOf("Microsoft") != -1){
          me = window[swfID];
     }else{
          me = document[swfID];
     }
}

function update_text( str ){
     me.update_text(str);
}

function as_wysiwyg( str ){
	me.as_wysiwyg(str);
}


var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
page_request.open('GET', url, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
