// JavaScript Document
var newWindow = null;
function closeWin(){
	    if (newWindow != null){
	        if(!newWindow.closed)
	            newWindow.close();
	    }
	}
function popUpWin(url, type, strWidth, strHeight){
	
	    closeWin();
	
	     if (type == "fullScreen"){
	
	        strWidth = screen.availWidth - 10;
	        strHeight = screen.availHeight - 160;
	    }
	
	    var tools="";
	    if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=no,location=no,scrollbars=no,menubar=no,width="+strWidth+",height="+strHeight+",top=0,left=0";
	    if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	    newWindow = window.open(url, 'newWin', tools);
	    newWindow.focus();
	}
	
	
	function PopupImage(image, width, height, type) {
var hw = '';

	if(type=="small") {
    //windows_height = height + 25;
    windows_height = (height > 768 ? 768 : height);
    windows_width = (width > 1024 ? 1024 : width);
	asc='no';
    } else { 
	windows_height = (height > 1200 ? 1200 : height);
    windows_width = (width > 1800 ? 1800 : width);
	asc='yes';
	}
	
    if (!hw.closed && hw.location) {
        hw.focus();
    } else {
        hw=window.open('show_img.php?image='+image+'&width='+width+'&height='+height+'&with_join=1&lang=<? echo $lang; ?>&aff=<? echo $aff; ?>&gen=<? echo $gen; ?>', '','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+asc+',resizable=no,width='+windows_width+',height='+windows_height);
    }

    if (!hw.opener) {
       hw.opener = self;
    }



    if (window.focus) {
        hw.focus();
    }

    return false;
}