var portal = {

	addEvent: function(elm, evType, fn, useCapture) {
	    // cross-browser event handling for IE5+, NS6 and Mozilla
	    // By Scott Andrew
		  	if (elm.addEventListener) {
		      elm.addEventListener(evType, fn, useCapture);
		      return true;
		    } else if (elm.attachEvent) {
		      var r = elm.attachEvent('on' + evType, fn);
		      return r;
		    } else {
		      elm['on' + evType] = fn;
		    }
		return null;
		},
	
	checkJavaSupport: function() {
		  var result = { 
		    javaEnabled: false,
		    version: ''
		  	};
		  if (typeof navigator != 'undefined' && typeof navigator.javaEnabled != 'undefined') 
		    result.javaEnabled = navigator.javaEnabled();
		  else
		    result.javaEnabled = 'unknown';
		  if (navigator.javaEnabled() && typeof java != 'undefined')
		    result.version = java.lang.System.getProperty ("java.version");
		  return result;
		}
	}
	
						
function popup(code,w,h)
  { window.open('plug.php?o='+code,'','toolbar=0,location=0,directories=0,menuBar=0,resizable=0,scrollbars=yes,width='+w+',height='+h+',left=32,top=16'); }

function pfs(id,c1,c2)
  { window.open('pfs.php?c1='+c1+'&c2='+c2,'PFS','status=1, toolbar=0,location=0,directories=0,menuBar=0,resizable=1,scrollbars=yes,width=754,height=512,left=32,top=16'); }

function help(rcode,c1,c2)
  { window.open('plug.php?h='+rcode+'&c1='+c1+'&c2='+c2,'Help','toolbar=0,location=0,directories=0,menuBar=0,resizable=0,scrollbars=yes,width=480,height=512,left=32,top=16'); }

function comments(rcode)
  { window.open('comments.php?id='+rcode,'Comments','toolbar=0,location=0,directories=0,menuBar=0,resizable=0,scrollbars=yes,width=480,height=512,left=16,top=16'); }

function ratings(rcode)
  { window.open('ratings.php?id='+rcode,'Ratings','toolbar=0,location=0,directories=0,menuBar=0,resizable=0,scrollbars=yes,width=480,height=512,left=16,top=16'); }

function polls(rcode)
  { window.open('polls.php?id='+rcode,'Polls','toolbar=0,location=0,directories=0,menuBar=0,resizable=0,scrollbars=yes,width=608,height=448,left=16,top=16'); }

function pollvote(rcode,rvote)
  { window.open('polls.php?a=send&id='+rcode+'&vote='+rvote,'Polls','toolbar=0,location=0,directories=0,menuBar=0,resizable=0,scrollbars=yes,width=608,height=448,left=16,top=16'); }

function picture(url,sx,sy)
  { window.open('pfs.php?m=view&v='+url,'Picture','toolbar=0,location=0,directories=0,menuBar=0,resizable=1,scrollbars=yes,width='+sx+',height='+sy+',left=0,top=0'); }

function redirect(url)
  { location.href = url.options[url.selectedIndex].value; }
  
function showMore(id) {
	if(document.getElementById(id)) {
		if(document.getElementById(id).style.display == 'none') {
			document.getElementById(id).style.display = '';
			if(document.getElementById(id + 'Link'))
				document.getElementById(id + 'Link').innerHTML = less + '...';
			if(document.getElementById(id + 'Img')) {
				document.getElementById(id + 'Img').src = news_minusicon;
				document.getElementById(id + 'Img').setAttribute('alt', less, 'false');
			}
		}
		else {
			document.getElementById(id).style.display = 'none';
			if(document.getElementById(id + 'Link'))
				document.getElementById(id + 'Link').innerHTML = more + '...';
			if(document.getElementById(id + 'Img')) {
				document.getElementById(id + 'Img').src = news_plusicon;
				document.getElementById(id + 'Img').setAttribute('alt', more, 'false');
			}
		}
	}
}