	var SC_PATHLIB, SC_PATHSCRIPT, SC_PATHIMAGE;
	var MonthCount = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	var FlagChange = false, IsIE = true, BrowserName = 'MSIE', BrowserVersion = '';

	GetBrowser();
	
function ChangeControl() 		{ FlagChange = true; }
function GetWindowWidth(pWin) 	{ if (IsIE) return pWin.document.body.clientWidth; else return pWin.outerWidth; }
function GetWindowHeight(pWin) 	{ if (IsIE) return pWin.document.body.clientHeight; else return pWin.outerHeight; }
function GetScreenWidth() 		{ return screen.availWidth - 10; }
function GetScreenHeight() 		{ return screen.availHeight - 35; }

function Spacer(w, h) {
	return('<img src="' + SC_PATHIMAGE + '/spacer.gif" width="' + w + '" height="' + h + '" border="0">');
}
function SetPath(spath) {
	SC_PATHLIB = spath;
	SC_PATHSCRIPT = SC_PATHLIB + '/Scripts';
	SC_PATHIMAGE = SC_PATHLIB + '/Images';
}
function FindObj(item) {
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}
function KeyControl(kcontrol) {
	var ltrk = 'ÖÇŞİĞÜöçşğüı', leng = 'OCSIGUocsgui', ecode = this.event.keyCode, c = (kcontrol.substr(0, 1)).toLowerCase();
	if (ecode == 13) this.event.srcElement.onchange();
	if (c == 'n') { if ((ecode < 43 || ecode > 57) && ecode != 47) this.event.keyCode = 0; }
	if (c == 'f') { if (ecode < 43 || ecode > 46) this.event.keyCode = 0; }
	if (c == 'd') { if (ecode < 46 || ecode > 57) this.event.keyCode = 0; }
	if (c == 't') { if (ecode < 48 || ecode > 58) this.event.keyCode = 0; }
	if (c == 'p') { if (ecode < 48 || ecode > 122) this.event.keyCode = 0; }
	if (c == 'e') { for (var i = 0; i < 12; i++) if (ltrk.charCodeAt(i) == this.event.keyCode) this.event.keyCode = leng.charCodeAt(i); }
}
function ParentLeft(idname) {
	var result = 0, ownObj = idname.offsetParent;
	while (ownObj != null) { result += ownObj.offsetLeft; ownObj = ownObj.offsetParent; }
	return(result);
}
function ParentTop(idname) {
	var result = 0, ownObj = idname.offsetParent;
	while (ownObj != null) { result += ownObj.offsetTop; ownObj = ownObj.offsetParent; }
	return(result);
}
function IfNull(vName) 		{
	if (!vName) return(true);
	if (vName == null) return(true);
	if (typeof(vName) == 'number') if (isNaN(vName)) return(true);
	if (typeof(vName) == 'undefined') return(true);
	if (typeof(vName) == 'string') if (vName == '') return(true);
	return(false);
}
function GetBrowser() {
	if (navigator.userAgent.indexOf("Opera") != -1) 	BrowserName = 'Opera'; 
	if (navigator.userAgent.indexOf("Firefox") != -1) 	BrowserName = 'Firefox'; 
	if (navigator.userAgent.indexOf("Safari") != -1) 	BrowserName = 'Safari'; 
	if (navigator.userAgent.indexOf("Camino") != -1) 	BrowserName = 'Camino'; 
	if (navigator.userAgent.indexOf("Netscape") != -1) 	BrowserName = 'Netscape'; 
	if (navigator.userAgent.indexOf("MSIE") != -1) 		BrowserName = 'MSIE'; 
	var w = navigator.userAgent.indexOf(BrowserName); 	BrowserVersion = navigator.userAgent.substr(w+BrowserName.length+1, 3);
	if (BrowserName != 'MSIE') IsIE = false;
}
function CurrencyFormat(fld, milSep, decSep, e) {
	var sep = 0, key = '', i = j = 0, len = len2 = 0, strCheck = '0123456789', aux = aux2 = '';
	var whichCode = (window.Event) ? e.which : e.keyCode;

	if (whichCode == 13) return true;  // Enter
	if (whichCode == 8) return true;  // Delete (Bug fixed)

	key = String.fromCharCode(whichCode);  // Get key value from key code

	if (strCheck.indexOf(key) == -1) return false;  // Not a valid key
	len = fld.value.length;

	for(i = 0; i < len; i++) if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
	aux = '';

	for(; i < len; i++) if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
	aux += key; len = aux.length;

	if (len == 0) fld.value = '';
	if (len == 1) fld.value = '0'+ decSep + '0' + aux;
	if (len == 2) fld.value = '0'+ decSep + aux;
	if (len > 2) {
		aux2 = '';
		for (j = 0, i = len - 3; i >= 0; i--) {
			if (j == 3) { aux2 += milSep; j = 0; }
			aux2 += aux.charAt(i);
			j++;
		}
		fld.value = '';
		len2 = aux2.length;
		for (i = len2 - 1; i >= 0; i--)
			fld.value += aux2.charAt(i);
		fld.value += decSep + aux.substr(len - 2, len);
	}
	return false;
}
function WindowOpen(wLocation, wName, wParam, wCenter, wMax) {
	if (wParam == "") {
		wParam = "toolbar=no, location=no, directories= no, status= yes, menubar=no, resizable=yes, scrollbars=yes";
		if (wMax && wMax == true) 
			wParam += ", width=" + GetScreenWidth() + ", height=" + GetScreenHeight(this) + ", left=0, top=0";
		else wParam += ", width=940, height=690";
	} else {
		if (wParam.indexOf("scrollbars=") == -1) wParam += ", scrollbars=yes"
		if (wParam.indexOf("toolbar=") == -1) wParam += ", toolbar=no"
		if (wParam.indexOf("directories=") == -1) wParam += ", directories=no"
		if (wParam.indexOf("status=") == -1) wParam += ", status=no"
		if (wParam.indexOf("resizable=") == -1) wParam += ", resizable=yes"
		if (wParam.indexOf("center=") == -1) wParam += ", center=yes"
		if (wParam.indexOf("menubar=") == -1) wParam += ", menubar=no"
		if (wParam.indexOf("width=") == -1) wParam += ", width=940"
		if (wParam.indexOf("height=") == -1) wParam += ", height=690"
	}
	//alert(wParam);
	if (wMax == false) {
	if (wCenter || wCenter == true) {
	
		var w1, w2, wwidth, wheight, wleft, wtop
		w1 = wParam.indexOf('width=');
		if (w1 > -1) {
			w2 = wParam.indexOf(',', w1);
			if (w2 <= 0) w2 = wParam.length;
			wwidth = wParam.substring(w1 + 6, w2)
		}
		w1 = wParam.indexOf('height=');
		if (w1 > -1) {
			w2 = wParam.indexOf(',', w1);
			if (w2 <= 0) w2 = wParam.length;
			wheight = wParam.substring(w1 + 7, w2)
		}
		wleft = parseInt((GetScreenWidth() - parseInt(wwidth)) / 2);
		wtop = parseInt((GetScreenHeight() - parseInt(wheight)) / 2);		
		wParam += ", left=" + wleft + ', top=' + wtop;		
	}
	}

	var pWindow = window.open(wLocation, wName, wParam);
	if (pWindow) pWindow.focus();
	return(pWindow);
}
function UseDefaultSize(pWindow) {
	var	lWidth = GetWindowWidth(pWindow);
	var lHeight = GetWindowHeight(pWindow);
	var strFeature, lLeft, lTop;

	if (IsIE) {
		lTop = '0'; lLeft = '0';
		strFeature = "left=" + lLeft + ",top=" + lTop + ",width=" + lWidth + ",height=" + lHeight + ",resizable,scrollbars,status=yes";
	} else {
		lTop = '0'; lLeft = '0';
		strFeature = "screenX=" + lLeft + ",screenY=" + lTop + ",outerWidth=" + lWidth + ",outerHeight=" + lHeight + ",resizable,scrollbars,status=yes";
	}
	return strFeature;
}
function DateControl(dv) {
	var dateNow = new Date(), rDay = dateNow.getDate(), rMonth = dateNow.getMonth + 1, rYear = dateNow.getYear(), re;
	var rd = DateFormat.indexOf('d'), rm = DateFormat.indexOf('m'), ry = DateFormat.indexOf('y');
	if (dv) var dateValue = FindObj(dv).value; else var dateValue = this.event.srcElement.value; 
	re = /\./gi; dateValue = dateValue.replace(re, ''); re = /\//gi; dateValue = dateValue.replace(re, '');
	rd = rd * 2; rm = rm * 2; ry = ry * 2;

	if ((dateValue.length == 4) || (dateValue.length == 6) || (dateValue.length == 8))	{ rDay = parseFloat(dateValue.substr(rd, 2)); rMonth = parseFloat(dateValue.substr(rm, 2)); rYear = dateNow.getYear(); }
	if (dateValue.length == 2) 	{ rDay = parseFloat(dateValue.substr(rd, 2)); rMonth = dateNow.getMonth() + 1; rYear = dateNow.getYear(); }
	if (dateValue.length == 6) 	{ rYear = parseFloat(String(dateNow.getYear()).substr(0, 2) + dateValue.substr(ry, 2)); }
	if (dateValue.length == 8) 	{ rYear = parseFloat(dateValue.substr(ry, 4)); }
	if ((rDay > 31) || (rDay < 1) || isNaN(rDay)) rDay = dateNow.getDate();
	if ((rMonth > 12) || (rMonth < 1) || isNaN(rMonth)) rMonth = dateNow.getMonth() + 1;
	if ((rYear < 1900) || isNaN(rYear)) { rYear = dateNow.getYear(); if (rYear < 1000) rYear = 1900 + rYear; }

	var tmp = DateFormat;
	re = /d/gi; tmp = tmp.replace(re, Zero(rDay.toString(), 2) + DateSep);
	re = /m/gi; tmp = tmp.replace(re, Zero(rMonth.toString(), 2) + DateSep);
	re = /y/gi; tmp = tmp.replace(re, rYear.toString() + DateSep);
	if (dv) FindObj(dv).value = tmp.substr(0, tmp.length-1); else this.event.srcElement.value = tmp.substr(0, tmp.length-1);
}
function TimeControl() {
	var timeNow = new Date(), re, rHour = timeNow.getHours(), rMinute = timeNow.getMinutes(), rSecond = timeNow.getSeconds();
	var timeValue = this.event.srcElement.value; re = /\:/gi; timeValue = timeValue.replace(re, '');
	if (timeValue.length == 2) { rHour = parseFloat(timeValue.substr(0, 2)); rMinute = timeNow.getMinutes(); rSecond = timeNow.getSeconds(); }
	if (timeValue.length == 4) { rHour = parseFloat(timeValue.substr(0, 2)); rMinute = parseFloat(timeValue.substr(2, 2)); rSecond = timeNow.getSeconds(); }
	if (timeValue.length == 6) { rHour = parseFloat(timeValue.substr(0, 2)); rMinute = parseFloat(timeValue.substr(2, 2)); rSecond = parseFloat(timeValue.substr(4, 2)); }
	
	if ((rHour > 23) || isNaN(rHour)) rHour = timeNow.getHours();	
	if ((rMinute > 59) || isNaN(rMinute)) rMinute = timeNow.getMinutes();	
	if ((rSecond > 59) || isNaN(rSecond)) rSecond = timeNow.getSeconds();
	this.event.srcElement.value = Zero(rHour.toString(), 2) + ':' + Zero(rMinute.toString(), 2) + ':' + Zero(rSecond.toString(), 2);
}

