// JavaScript Document


function $(v) { return(document.getElementById(v)); }
function $S(v) { return($(v).style); }
function toggle(v) { $S(v).display=($S(v).display=='none'?'block':'none'); }
function hide(v) { if ($(v)) $S(v).display='none'; }
function show(v) { if ($(v)) $S(v).display='block'; }


function pic(targetURL, targetWindow, width, height) {
	
	// targetURL+'?w='+width+'&h='+height
	
	width = width + 10;
	height = height + 60;
	
    newwindow=window.open(targetURL,targetWindow,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height);
	// center popup
	var newLeft = (screen.width - width)/2;
	var newTop = (screen.height - height)/3;
	if (newLeft < 0) newLeft = 0;
	if (newTop < 0) newTop = 0;
	newwindow.moveTo(newLeft, newTop);
	
	// resize
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			newwindow.outerWidth=width;
			newwindow.outerHeight=height;
		}
		else newwindow.resizeTo(width,height);
	}
	
	// bring popup to front
	if (window.focus) {
		newwindow.focus();
	}
	return false;
}


