<!--

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//*****************************************************************************************************************
//				              HELPER FUNCTIONS
//*****************************************************************************************************************
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//-----------------------------------------------------------------------------------------------------------------
  function mOvr(src,clrOver)
//-----------------------------------------------------------------------------------------------------------------
  {
   if (document.all||document.getElementById) src.style.backgroundColor = clrOver;
  }
//-----------------------------------------------------------------------------------------------------------------
  function mOut(src,clrIn)
//-----------------------------------------------------------------------------------------------------------------
  {
   if (document.all||document.getElementById) src.style.backgroundColor = clrIn;
  }

//-----------------------------------------------------------------------------------------------------------------
  function checkEmail(which)
//-----------------------------------------------------------------------------------------------------------------
{
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

  if (which.value=='')
  {alert('Please input your E-MAIL!');return false;}
  else
  { if (filter.test(which.value)==false)
	{alert('E-MAIL is NOT valid'); return false;}
	return true;
  }
}
//-----------------------------------------------------------------------------------------------------------------
	 function viewImage(winUrl,winName,imgWidth,imgHeight)
//-----------------------------------------------------------------------------------------------------------------
{
 	var showWin;
    var winWidth  = imgWidth  + 50 ;
    var winHeight = imgHeight + 50;
	showWin = window.open("","viewImage","scrolbar=0,width="+ winWidth + ",height=" + winHeight + ",toolbar=0,resizable=0,left=0,dependent=yes");
	showWin.focus();
	showWin.document.write("<TITLE>" + winName+ "</TITLE>");
	showWin.document.write("<link href='skbn.css' type='text/css' rel='stylesheet'>");
	showWin.document.write("<body><center><table border='0' cellspacing='1' cellpadding='1'>");
	showWin.document.write("<tr><td valign='top'><img src='");
	showWin.document.write(winUrl + "'");
	showWin.document.write("></td></tr>");
	showWin.document.write("<tr><td valign='top' align='center'><a href='javascript:"+ "top.close();'" + ">Close window</a>");
	showWin.document.write("</td></tr>");
	showWin.document.write("</table></center></body>");
	showWin.document.close();

}

//-----------------------------------------------------------------------------------------------------------------
	 function showPopWin(winUrl,winName)
//-----------------------------------------------------------------------------------------------------------------
	{
	  var popWin = window.open(winUrl,winName,"scrollbar=0,toolbar=0,resizable=yes,left=0,top=0,width=600,height=700,dependent=yes");
	  popWin.focus();
	  popWin.document.close();

	 }
//-----------------------------------------------------------------------------------------------------------------
	function showAnswer(nAnswer,bHide)
//-----------------------------------------------------------------------------------------------------------------
	{
	   var objSpan1  = eval('document.getElementById("' + 'idAnswer'      + nAnswer + '")');
	   var objSpan2  = eval('document.getElementById("' + 'idShortAnswer' + nAnswer + '")');                                       //var objArrow = eval('document.getElementById("' + 'imgStep' + nSection + '")');

	   if (bHide)
	   {
	       objSpan1.style.display  = 'block';
	       objSpan2.style.display  = 'none';
	   }
	   else
	   {
	       objSpan2.style.display  = 'block';
	       objSpan1.style.display  = 'none';
	   }
   }
//-----------------------------------------------------------------------------------------------------------------
   function ProcessUpload(frmObj,idUploadSpan,idMsgSpan)
//-----------------------------------------------------------------------------------------------------------------
  {
	var ErrMess='';
	var nl='\n';
	var sp='     ';
	var fn = frmObj.userfile.value.toLowerCase();

	if(fn=='')
		{ErrMess+=nl+sp+'- please select a file';}

	if(ErrMess!='')
		{ErrMess='You can not perform this action now for the following reasons:'+ErrMess;
		 alert(ErrMess);}
	else
		{
		document.getElementById(idUploadSpan).style.display='none';
		document.getElementById(idMsgSpan).style.display='block';
		frmObj.submit();
		}

  }

//-----------------------------------------------------------------------------------------------------------------
   function IsInt(textObject)
//-----------------------------------------------------------------------------------------------------------------
  {
    var filter   =/(^\d+$)|(^\d+\\d+$)/;
    var newValue = textObject.value;

    if (filter.test(newValue))
	testresult = true
	else{
	testresult = false
	}

    return testresult;
  }
//-----------------------------------------------------------------------------------------------------------------
   function IsNumeric(textObject)
//-----------------------------------------------------------------------------------------------------------------
  {
    var filter   =/(^\d+$)|(^\d+\.\d+$)/;
    var newValue = textObject.value;

    if (filter.test(newValue))
	testresult = true
	else{
	testresult = false
	}

    return testresult;
  }

//-----------------------------------------------------------------------------------------------------------------
	String.prototype.trim = function()
	{
	    return this.replace(/(^\s*)|(\s*$)/g, "");
	}

//-----------------------------------------------------------------------------------------------------------------
  function countit(what,limit)
//-----------------------------------------------------------------------------------------------------------------

 {
	formcontent = what.value;
	formname    = what.name;
	if (formcontent.length <=limit)
	{
		return true;
	}
	alert('"' + formname.substring(8,9).toUpperCase() + formname.substring(9, formname.length) + ' exceed limitation!')
	return false;
 }
//-----------------------------------------------------------------------------------------------------------------
   function autotab(original,destination)
//-----------------------------------------------------------------------------------------------------------------
 {
	if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
	destination.focus()
 }

//-----------------------------------------------------------------------------------------------------------------
   function StrToInt(s)
//-----------------------------------------------------------------------------------------------------------------
 {
	var retval = 0;
	if(isNaN(parseInt(s))) {retval=0}
	else {

		if ((s.toString().charAt(0)=="0") && (s.length>1)){s = s.toString().substring(1,s.length);}
		retval=parseInt(s)
	}
	return(retval);
 }

//-----------------------------------------------------------------------------------------------------------------
   function clearText(thefield)
//-----------------------------------------------------------------------------------------------------------------


	{
		if (thefield.defaultValue==thefield.value)
		thefield.value = ""
	}
 -->