
// variables -------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------

var isIE4 = document.all;
var isIE5 = document.all && document.getElementById;
var isNS4 = document.layers;
var isNS6 = document.getElementById && !document.all; 
var isIENew = isIE5;
var isNSNew = isNS6;
var isIE = navigator.appName.indexOf("Microsoft") != -1;

window.defaultStatus = "SZK";

function strltrim() { return this.replace(/^\s+/,''); }
function strrtrim() { return this.replace(/\s+$/,''); }
function strtrim() { return this.replace(/^\s+/,'').replace(/\s+$/,''); }
String.prototype.ltrim = strltrim;
String.prototype.rtrim = strrtrim;
String.prototype.trim = strtrim;


// window functions -----------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------

function _calcWndIdent() {
	d = new Date();
	return "wnd" + d.getHours() + d.getMinutes() + d.getSeconds() + d.getMilliseconds();
}

function _centerWindow(wHandle, w, h) {
	posX = (screen.availWidth - w) / 2;
	posY = (screen.availHeight - h) / 2;
	wHandle.moveTo(posX, posY);
}

function openWnd(url, w, h, wndName, bNoScroll, x, y) {
	if(!w) w = 640;
	if(!h) h = 480;
	if(!wndName) wndName = _calcWndIdent();
	if(!x) x = (screen.availWidth - w) / 2;
	if(!y) x = (screen.availHeight - h) / 2;
	wnd = window.open(url,wndName,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + (bNoScroll ? "no" : "yes") + ",resizable=yes,width="+w+",height="+h + 
								  (x || y ? ',left='+x+',top='+y+',screenX='+x+',screenY='+y : ''));
	//if(wnd && !(x || y)) _centerWindow(wnd, w, h);
	return wnd;
}

function openFullWnd(url) {
	wndName = _calcWndIdent();
	wnd = window.open(url,wndName,"toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
	return wnd;
}


function showImages(pId, imId) {
	openWnd("szk/view_image.php?pid=" + pId + "&iid=" + imId, 950, 660, "szk_projImages_" + pId, true);	
}


function openFileMan() {
	openWnd("szk/fileman.php", 300, screen.availHeight - 100, "szk_fileMan", false, 10, 10);		
}

function openProposal() {
	openWnd("szk/proposal.html", 850, screen.availHeight - 100, "szk_proposal", false);	
}




// other functions -------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------





