// JavaScript Document 20061019 revised 20081004

if (window.opener)
 document.write('<strong><a href="#" onclick="self.close();">' +
   'Close this window</a></strong>');


// pop-up function
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
			newWin.close();
	}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}

function validateNotEmpty( strValue ) 
{
   var strTemp = strValue;
   strTemp = trimAll(strTemp);
   if(strTemp.length > 0)
   {
     return true;
   }  
   return false;
}

function trimAll( strValue ) 
{
 var objRegExp = /^(\s*)$/;

    if(objRegExp.test(strValue)) 
	{
       strValue = strValue.replace(objRegExp, '');
       if( strValue.length == 0)
       {
          return strValue;
       }
    }
    
	objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
	if(objRegExp.test(strValue)) 
	{
		strValue = strValue.replace(objRegExp, '$2');
	}
	return strValue;
}


function  validateString( strValue ) 
{
	var objRegExp  =  /[^0-9]$/; 
 
	if (objRegExp.test( strValue )==true)
	{ 
  		return objRegExp.test( strValue );
	}
	else
	{
		return false;
	}
}

function validateTopic (rdlist) 
{
	for (i=0;i<=4;i=i+1)
	{
		if (rdlist[i].value=='pconslt')
		{
			retStr = rdlist[i].value;
		}
		return false;
	}
}

function validateEmail(strValue)
{
	var objRegExp = /^(\w+)(@)(\w+)(\.)(\w+)$/;
	
	if (objRegExp.test(strValue)==true)
	{
		return objRegExp.test(strValue);
	}
	else
	{
		return false;
	}
}