// Common Javascript Functions
// Author: Chris Yewchuk
// Date: 3.6.2006

	var iens6=document.all||document.getElementById;
	var ns4=document.layers;

    function getObject(id) {
	    if (document.layers) 
		    return document[id]
	    else if (document.all)
		    return document.all[id]
	    else if(document.getElementById)
		    return document.getElementById(id)
	    else return null
    }

	function showMoreDetails(layerName) {
	    // hide summary details
 		var gc = new getObject(layerName+'Summary');
		if (gc.style) gc.style.display = 'none';
		// show full details
		var gc = new getObject(layerName);
		if (gc.style) gc.style.display = 'inline';
		// hide 'view more..'
 		var gc = new getObject(layerName+'Expand');
		if (gc.style) gc.style.display = 'none';
		// show 'view less..'
 		var gc = new getObject(layerName+'Collapse');
		if (gc.style) gc.style.display = 'inline';
		
	}
	function showFewerDetails(layerName) {
	    // show summary details
 		var gc = new getObject(layerName+'Summary');
		if (gc.style) gc.style.display = 'inline';
		// hide full details
 		var gc = new getObject(layerName);
		if (gc.style) gc.style.display = 'none';
		// hide 'view less..'
 		var gc = new getObject(layerName+'Collapse');
		if (gc.style) gc.style.display = 'none';
		// show 'view more..'
 		var gc = new getObject(layerName+'Expand');
		if (gc.style) gc.style.display = 'inline';
	}

    function winPop(url,n,wid,height,scroll,toolbar,menubar) {
	    var strOpt = '';
	    strOpt = "height=" + height + ",width=" + wid + ",location=no";
	    if (scroll==1) strOpt += ',scrollbars=yes';
	    else strOpt += ',scrollbars=no';
	    if (toolbar==1) strOpt += ',toolbar=yes';
	    else strOpt += ',toolbar=no';
	    if (menubar==1) strOpt += ',menubar=yes';
	    else strOpt += ',menubar=no';
	    var w = window.open(url,n,strOpt);
	    w.focus();
    }
    function winPopCenter(url, name, width, height, scroll, toolbar, menubar, resizable) {
	    var winl = (screen.width-width)/2;
	    var wint = (screen.height-height)/2;

	    var strOpt = '';
	    strOpt = "height=" + height + ",width=" + width + ",location=no,top=" + wint + ", left=" + winl;
    	
	    if (scroll==1) strOpt += ',scrollbars=yes';
	    else strOpt += ',scrollbars=no';
	    if (toolbar==1) strOpt += ',toolbar=yes';
	    else strOpt += ',toolbar=no';
	    if (menubar==1) strOpt += ',menubar=yes';
	    else strOpt += ',menubar=no';
	    if (resizable==1) strOpt += ',resizable=yes';
	    else strOpt += ',resizable=no';
    	
	    var w = window.open(url,name,strOpt);
	    w.focus();
    }