function fof_spam(d, s, u, e){str="mailto:"+u+"@"+s+'.'+d+e;return str;}

window.onload = function(){
	defocus();
}

function defocus(){
	var a = document.getElementsByTagName('a');
	for(i=0;i<a.length;i++){
		a[i].onfocus=function(){
			if(this.blur)this.blur();
		}
	}
}

function clear_tiny_mce_editors() {
    $$('textarea.mceEditor').each(function(e){ tinyMCE.execCommand('mceRemoveControl', false, e.id);})
}

function restore_tiny_mce_editors() {
    $$('textarea.mceEditor').each(function(e){ tinyMCE.execCommand('mceAddControl', false, e.id);})
}

function closeComponentRedBox() {
    clear_tiny_mce_editors();
    RedBox.close();
}

function editModeOn() {
    $('edit_on').hide();
    $('edit_off').show();
    $$('div.component_settings', 'div.add_component', 'div.item_editor').each(function(item) {
        item.show();
    });
    $$('div.component_box').each(function(item) {
        item.addClassName('edit_component')
    });
}

function editModeOff() {
    $('edit_off').hide();
    $('edit_on').show();
    $$('div.component_settings', 'div.add_component', 'div.item_editor').each(function(item) {
        item.hide();
    });
    $$('div.component_box').each(function(item) {
        item.removeClassName('edit_component')
    });
}

function initialize_gmaps(id, lat, lng, zoom_level, html) {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById(id));
    map.setCenter(new GLatLng(lat, lng), zoom_level);

    map.addControl(new GSmallMapControl());

    var marker = new GMarker(new GLatLng(lat, lng));
    GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml(html);
    });
    map.addOverlay(marker);
  }
};
