//// 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");
}

// Hides the layer onload and resizes the window //////
function hidelayer() {
	if(iex || ns4){
		if(ns4) document.loading.visibility="hidden";
		else loading.style.visibility="hidden";
	} else document.getElementById("loading").style.visibility="hidden";
	loaded = true;
}

function modifyLoadLayer(inner) {
	change = '<img src="/images/frwrd_logo.gif" /><br>&nbsp;&nbsp;<b>process:</b> '+inner;
	if(iex || ns4){
		if(ns4) document.content.innerHTML=change;
		else content.innerHTML=change;
	} else document.getElementById("content").innerHTML=change;
}

function writeLoadingLayer() {
	var layer = '<div id="loading" style="display:none; position:absolute; ';
	layer += 'top:0; left:0; width:100%; height:100%; ';
	layer += 'background-image: url(images/traslucent.png); ';
	layer += 'z-index:100; color:#fff;">'; 	
	layer += '<a href="javascript:;">';
	layer += '<div id="content" style="width:734px; height:52px; top:0; left:0; font-family:Verdana,Helvetica,Courier, sans-serif; color:#fff; font-size:9px; border:0px solid #666; padding:20px 20px 10px 46px; background:url(images/traslucent.png);">';
	//layer += '<img src="/images/frwrd_logo.gif" /><br>&nbsp;&nbsp;';
	layer += '<h3><b>process:</b> loading HTML...</h3>';
	layer += '</div></a>';
	layer += '</div>';
	
	document.write(layer);
}

//// 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 ////