function subwin() {
        if(s_window.opener==null)s_window.opener=window;
s_window.focus();
}


function openPhoto(url) {
	openBrWindow(url,"photo",364,473,"center","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}


//dw  ->  Difference of width
//dh  ->  Difference of height
//rdw ->  Difference of width when there is resize

var Mac = navigator.userAgent.indexOf('Mac') != -1;
var Win = navigator.userAgent.indexOf('Win') != -1;
var bwr_ns = navigator.appName.indexOf("Netscape")  != -1;
var bwr_ie = navigator.appName.indexOf("Microsoft") != -1;
var bwr_ge = navigator.userAgent.indexOf("Gecko") != -1;
var bwr_sa = navigator.appVersion.indexOf("Safari") != -1;
	
	// Macintosh////////////////////////////////////////////////////////////
if (Mac) {
	if (bwr_ns) {
		dw=dh=0;
		rdw=15;
	}
	if (bwr_ie) {
		dw=dh=-15;
		rdw=-1;
	}
	if (bwr_ge) {
		dw=dh=0;
		rdw=15;
	}
	if (bwr_sa) {	
		dw=0;
		dh=1;
		rdw=15;
	}
}
	// Windows////////////////////////////////////////////////////////////
else if (Win) {
	if (bwr_ns) {
		dw=dh=0;
		rdw=15;
	}
	if (bwr_ie) {
		dw=dh=0;
		rdw=17;
	}
	if (bwr_ge) {
		dw=dh=0;
		rdw=19;
	}
}else{
	dw=dh=0;
	rdw=0;
}


function openBrWindow(theURL,winName,w,h,p,features) {
	if(p=="center"){
		x = ((screen.availWidth) / 2) - (w / 2);
		y = ((screen.availHeight) / 2) - (h / 2);
	}else if(p=="right"){
		x = screen.availWidth - w;
		y = 0;	
	}else{
		x = 0;
		y = 0;		
	}
	
	if(features==""){
		features="width="+(w+dw)+",height="+(h+dh)+",left="+x+",top="+y;
	}else{
		features="width="+(w+rdw)+",height="+h+",left="+x+",top="+y+","+features;
	}
	sub_win=window.open(theURL,winName,features);
	if(sub_win.opener==null){
		sub_win.opener=window;
	}
	sub_win.focus();
}