//// begin script ////

//// local debug vars ////
var debug = false;

// check browser ///////////////////////
agent = navigator.userAgent.toLowerCase(); 
mac = (agent.indexOf("mac")!=-1);
win = (!this.mac) ?true:false;
w3c = (document.getElementById) ?true:false;
iex = (document.all) ?true:false;
ns4 = (document.layers) ?true:false;

if(debug) {
	if(w3c) alert("w3c");
	if (iex) alert("iex");
	if (ns4) alert("ns4");
}

//// anti-spam script //////////////
function safemail(name, domain, display) {
    displayed=(typeof(display)=="undefined") ? name+"@"+domain : display
    document.write('<a class="sub" href=mailto:' + name + '@' + domain + '>' + displayed + '</a>');
}

//// opens a window ////////////////
function openWin(url, name, width, height, kind) {
	var my_win;
	if (kind == "ws") {
	 	w = ((screen.width - 40) - 10);
	 	h = ((screen.height - 40) - 75);
	 	l = 20;
	 	t = 20;
	 	full = 0;
	 } else if (kind == "fs") {
	 	if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
   			w = screen.width;
   			h = screen.height;
   			l = 0;
   			t = 0
	 		full = 1;
	 	} else {
	 		h = screen.height - 40;
	 		w = screen.width;
	 		l = 0;
	 		t = 0;
	 		full = 0;
	 	}
	 } else {
	 	h = height;
	 	w = width;
	 	l = ((screen.width - w) / 2);
	 	t = ((screen.height - h) / 2 - 40);
	 	full = 0;
	 }
	my_win = open(url, name, "width="+ w +",height="+ h 
		+",left=" + l + ",top=" + t 
		+ ",directories=0,location=0,menubar=0,scrollbars=0"
		+ ",status=0,toolbar=0,fullscreen=" + full 
		+ ",resizable=0");
	my_win.focus();
}

//// move and resize window /////			
function moveAndResize(w,h) {
	if (w == null) {
    	w = 600;
    	h = 450;
	}
    l = ((screen.width - w) / 2);
    t = ((screen.height - h) / 2 - 40);
    window.moveTo(l,60);
    window.resizeTo(w,h);
}

//// end script ////