function ConfirmDelete() {
	return confirm('Are you sure you want to delete this records !')
}

function PopupWindow(sURL, sWinName, iWidth, iHeight, bIsScrollbars, bIsResizable, bIsFullScreen) {

	iWidth = Math.round(iWidth);
	iHeight = Math.round(iHeight);				
		
	iLeft = Math.round((window.screen.width - iWidth) / 2);
	iTop = Math.round((window.screen.height - iHeight) / 2);
	
	bIsScrollbars = bIsScrollbars?'yes':'no';
	bIsResizable = bIsResizable?'yes':'no';
	bIsFullScreen = bIsFullScreen?'yes':'no';
	
	sExt = 'toolbar=no,menubar=no,directories=no,';
	sExt += 'scrollbars=' + bIsScrollbars + ',resizable=' + bIsResizable + ',fullscreen=' + bIsFullScreen + ',' ;
	sExt += 'width=' + iWidth + ',height=' + iHeight + ',top=' + iTop + ',left=' + iLeft;
	//alert(sExt)
	window.open(sURL, sWinName, sExt);
}

function ResizePage() {
	var oPageContent = document.getElementById('PageContent');
	var oPageTitle = document.getElementById('PageTitle');
	var oPageFooter = document.getElementById('PageFooter');
	var oGapTitle = document.getElementById('GapTitle');
	var oGapFooter = document.getElementById('GapFooter');
	var oGapLeft = document.getElementById('GapLeft');
	var oGapRight = document.getElementById('GapRight');
	var oMenuLeft = document.getElementById('MenuLeft');
	var oMenuRight = document.getElementById('MenuRight');
	var oGapScroll = document.getElementById('GapScroll');
	var iWidth = parseInt(oMenuLeft.width) + parseInt(oMenuRight.width) + oGapLeft.offsetWidth + oGapRight.offsetWidth + oGapScroll.offsetWidth + 16;
	var iHeight = oPageTitle.offsetHeight + oPageFooter.offsetHeight + oGapTitle.offsetHeight + oGapFooter.offsetHeight + 5;
	if (document.body.offsetWidth > iWidth)
		oPageContent.style.width = document.body.offsetWidth - iWidth;
	if (document.body.offsetHeight > iHeight)
		oPageContent.style.height = document.body.offsetHeight - iHeight;
}

function CheckUserID(sUserID) {
	var bReturn = !(sUserID.length < 3 || sUserID.length > 20);
	var sValidChar = 'abcdefghijklmnopqrstuvwxyz0123456789';
	sUserID = sUserID.toLowerCase();
	var aUserID = sUserID.split('');
	for(var i=0; i< aUserID.length; i++)
		bReturn = bReturn && !(sValidChar.search(aUserID[i]) < 0)
	return bReturn;
}
	
function CheckEmail(sEmail) {
	var bReturn = true;
	var sValidChar = 'abcdefghijklmnopqrstuvwxyz0123456789@.-';
	sEmail = sEmail.toLowerCase();
	if ( !(sEmail.search('@') < 0) && !(sEmail.search('.') < 0)) {
		var aEmail = sEmail.split('');
		for(var i=0; i< aEmail.length; i++)
			bReturn = bReturn && !(sValidChar.search(aEmail[i]) < 0)
	}
	else
		bReturn = false;
	return bReturn
}
	
function CheckPwd (sPwd, sConfPwd) {
	var bReturn = (sPwd.length > 3);
	var sValidChar = 'abcdefghijklmnopqrstuvwxyz0123456789';
	if (bReturn && sPwd == sConfPwd) {
		sPwd = sPwd.toLowerCase();
		var aPwd = sPwd.split('');
		for(var i=0; i< aPwd.length; i++) {
			bReturn = bReturn && !(sValidChar.search(aPwd[i]) < 0)
		}
	}
	else
		bReturn = false;
	return bReturn;
}