var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	closeWin();
		
	type = type.toLowerCase();
	
	if (type == "fullscreen"){
		strWidth = screen.availWidth;
		strHeight = screen.availHeight;
	}
	var tools="";
	var left = (screen.width/2) - (strWidth/2);
	var top = (screen.height/2) - (strHeight/2) - 40;
	
	
	if (type == "movie") tools = "resizable,toolbar=no,location=no,scrollbars=no,menubar=no,width=522,height=316";

	if (type == "standard") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console" || type == "fullscreen") tools = "resizable,status=no,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",top="+top+",left="+left+"";

	//alert(tools);
	
	newWindow = window.open(url, 'newWin'+type, tools);
	newWindow.focus();
}


function swapimage(linky, number, total){
	for (i=1;i<=total;i++) {
		document.getElementById('swap'+i).className='';
	}
	document.getElementById('swap'+number).className='highlight';
	document.getElementById('theimage').src = linky.href;
	return false;
}

