/**
 * functions.js
 *
 * Released at      : Oktober 2004                             
 * Last modified by :                                         
 * Date modified    :                                         
 * Copyright (c) 2004 Malibomba                               
 * IT IS NOT ALLOWED TO USE OR MODIFY ANYTHING OF THIS SITE,  
 * WITHOUT THE PERMISION OF THE AUTHOR.                       
 * Info? Mail to info@malibomba.com
 */
_D = this.document;
 
/**
 * window.onerror = function blockException()
 *
 * Used to block all the javascript errors if they occur!
 *
 * @returns (Boolean) true
 */
window.onerror = function blockException() {

	return true;

}; // End of Function


function enableField(field) {

	if(field != '') {	
		_D.getElementById(field).className = '';
		_D.getElementById(field).disabled = false;
		_D.getElementById(field).focus();
		return true;
	} else {
		return false;
	}

} // End of Function


function disableField(field) {

	if(field != '') {
		_D.getElementById(field).className = 'disabled-area';
		_D.getElementById(field).disabled = true;
		return true;
	} else {
		return false;
	}

} // End of Function



function switchLocation(path) {
	this.document.location.href = path;
	return true;
}


function fontSize(adj) {
	var loc = this.document.location.href;
	loc = loc.replace(/[\?&]fa=[\+\-]?[0-9]+/, '');
	var sep = (loc.indexOf('?') == -1) ? '?' : '&';
	loc += sep + 'fa=' + adj;
	document.location.replace(loc);
}


function showDetails(document) {
	var leftPos = (screen.availWidth - 750) / 2;
	var topPos = (screen.availHeight - 550) / 2; 

	var opts = "toolbar=no, status=no, location=no, menubar=no, resizable=yes,";
		    opts += "width=750, height=550 , scrollbars=yes,";
		    opts += "top=" + topPos + ",left=" + leftPos;
	var popwin = window.open("", "", opts);
	popwin.focus();
	popwin.location = document;

	return false;
}



function checkBrowser() {
	var arg = navigator.userAgent.toLowerCase();
	if(arg.indexOf("opera") != -1) {
		return false;
	} else if(arg.indexOf("firefox") != -1) {
		return false;
	} else if(arg.indexOf("msie") != -1) {
		return true;
	} else if(arg.indexOf("netscape") != -1) {
		return false;
	} else if(arg.indexOf("mozilla/5.0") != -1) {
		return false;
	} else if(arg.indexOf('\/') != -1) {
		if(arg.substr(0,arg.indexOf('\/')) != 'mozilla') {
			return false;
		} else {
			return false;
		}
	} else if(arg.indexOf(' ') != -1) {
		return false;
	} else {
		return false;
	}		
} // End of Function;
	

