mac = (navigator.appVersion.indexOf("Mac")>-1) ? true : false; // Mac
ie = (document.all) ? true : false; // IE
safari = (navigator.appVersion.indexOf("Safari")>-1) ? true : false; // Safari
gecko = (navigator.userAgent.indexOf("Gecko/") > -1)? true : false; // Gecko

function openWin(wUrl,wName,wWidth,wHeight,wScroll,wResize,wStatus,wCenter){
	wOption1 = "toolbar=no,location=no,directories=no,status=" + wStatus + ",menubar=no,scrollbars=" + wScroll + ",resizable=" + wResize + ",width=" + wWidth + ",height=" + ((safari && (wStatus == "yes" || wStatus == 1))?(wHeight+16):wHeight);
	if (wCenter == "yes" || wCenter == 1) {
		scWidthCenter = screen.availWidth / 2;
		scHeightCenter = screen.availHeight / 2;
		wOption2 = ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2));
	}
	else {
		wOption2 = "";
	}
	w = window.open(wUrl,wName,wOption1+wOption2);
	w.focus();
}