// JavaScript Document
function showFile(fileStr,winWidth,winHeight,tenderType,tenderId,fileName) 
{
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;	
	sTop = (sHeight - winHeight) / 2;
	sLeft = (sWidth - winWidth) / 2;	
	window.open(fileStr, "File", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=1");
	//for logging
	if(tenderType=='C')
	{
		document.tenderDetails.frmAction.value="yes";
		document.tenderDetails.fileName.value=fileName;
		document.tenderDetails.submit();
	}
	return;
}


function checkLogin() 
{
	username = trimSpaces(document.loginFrm.username.value);
	if(username.length <= 0){
		alert("Please enter your username.");
		document.loginFrm.username.focus();
		return;
	}
	if(!checkAllowedChars(username, "NA_")){
		alert("Only alphabets[a-z], numerals[0-9] and hyphen is allowed.");
		document.loginFrm.username.focus();
		return;
	}
	
	password = trimSpaces(document.loginFrm.password.value);
	if(password.length <= 0){
		alert("Please enter your password.");
		document.loginFrm.password.focus();
		return;
	}
	
	document.loginFrm.submit();
}// checkLogin()


function checkProductIndex(formName)
{
	objForm = eval("document." + formName);
	prodCtgId = objForm.prodCtgId.value;
	if(prodCtgId.length <= 0)
	{
		return false;
	}
	
	objForm.submit();
}// checkProductIndex()
