function openHelpWindow(topic) {
	popupWin = window.open("help.asp?topic=" + topic, "help_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=550,width=500,left=200,top=100,screenX=200,screenY=100");
}

function openGeoBoardsWindow(forumID) {
	popupWin = window.open("http://geoboards.coopertestinglabs.com/forumdisplay.php?forumid=" + forumID, "GeoBoards", "toolbar=yes,location=yes,directories=yes,status=no,menubar=no,scrollbars=yes,resizable=yes,height=550,width=750,left=200,top=100,screenX=200,screenY=100");
}

function openURLWindow(folderID) {
	windowString = "url_window.asp?mode=results&folder_id=" + folderID
	popupWin = window.open(windowString, "url_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height=150,width=500,left=200,top=100,screenX=200,screenY=100");
}

function openFolderPropertiesWindow(folderID) {
	windowString = "modify_folder.asp?folder_id=" + folderID
	popupWin = window.open(windowString, "folder_properties_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=200,width=350,left=200,top=100,screenX=200,screenY=100");
}

function openFilePropertiesWindow(folderID, fileID) {
	windowString = "modify_file.asp?folder_id=" + folderID + "&file_id=" + fileID
	popupWin = window.open(windowString, "file_properties_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=200,width=350,left=200,top=100,screenX=200,screenY=100");
}

function openEmailWindow(folderID) {
	windowString = "email_notify1.asp?folder_id=" + folderID
	popupWin = window.open(windowString, "email_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=500,width=450,left=200,top=100,screenX=200,screenY=100");
}

function openUserWindow() {
	windowString = "user_properties.asp"
	popupWin = window.open(windowString, "user_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=400,width=800,left=100,top=100,screenX=200,screenY=100");
}

function openmaillinglablepage()
      
	  {
        page="selectcontactsprint.asp"
	    popupWin = window.open(page, "user_window", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,height=500,width=800,left=100,top=100,screenX=200,screenY=100");
	  }

function openmaillinglablePreviewpage()
      
	  {
        page="PrintPreview.asp"
	    popupWin = window.open(page, "user_window", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,height=100,width=100,left=200,top=100,screenX=200,screenY=100");
	  }

function openHelpWindow(helpFile) {
	windowString = "help/" + helpFile + ".asp"
	popupWin = window.open(windowString, "help_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=500,width=500,left=200,top=100,screenX=200,screenY=100");
}

function refreshFiles() {
	window.location.reload();
}

function jumpToLetter(folderID, alphaChar) {
	window.location = "explore.asp?folder_id=" + folderID + "#" + alphaChar;
	return false;
}



function jumpToLetterinfolder(folderID, alphaChar) {
	window.location = "explore.asp?folder_id=" + folderID + "&action=open#" + alphaChar;
	return false;
}

function checkjunkchar(focusfld, str, fieldname){
	var invalidchar=" \"([{}])!#$%^&*';:,/\\?|+`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{	alert("Special characters/spaces are \nnot allowed in "+ fieldname +"." );focusfld.focus(); return false} 
	}		 		
return true; }


function checkjunkcharnonumericallowspace(focusfld, str, fieldname){
	var invalidchar="\"([{}])0123456789!#$%^&*';:,/\\?|+`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{	alert("Special Characters and Numbers are \nnot allowed in "+ fieldname +"." );focusfld.focus(); return false} 
	}		 		
return true; }

function checkjunkcharallowspace(focusfld, str, fieldname){
	var invalidchar="\"([{}])!#$%^&*';:,/\\?|+`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{	alert("Special Characters are \nnot allowed in "+ fieldname +"." );focusfld.focus(); return false} 
	}		 		
return true; }




function checkjunkcharallowspaceandnumeric(str){
	var invalidchar="\"([{}])!#$%^&*';:,/\\?|+`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{return false} 
	}		 		
return true; }

function checkjunkcharnotallowspaceandnumeric(str){
	var invalidchar="\"([{}]) !#$%^&*';:,/\\?|+`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{return false} 
	}		 		
return true; }

function checkjunkcharallowspacenotnumeric(focusfld, str, fieldname){
	var invalidchar="\"0123456789([{}])!#$%^&*';:,/\\?|+`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{	alert("Special Characters and Numbers are \nnot allowed in "+ fieldname +"." );focusfld.focus(); return false} 
	}		 		
return true; }




function check_junkchar_nonumeric_allowspace(str){
	var invalidchar="\"0123456789([{}])!#$%^&*';:,/\\?|+`~<>=~@."
	for (i=0; i<(invalidchar.length-1); i++){
		temp=invalidchar.substring(i,i+1);		      
		if (str.indexOf(temp)!=-1)
		{return false} 
	}		 		
return true; }




function OnlyNumeric(focusfld, str, fieldname)
{
 if (IsNumeric(str)==false)
  {	alert("Only Numbers are allowed in "+ fieldname +"." );focusfld.focus(); return false}
  else
  return true; 
}

function OnlyChar(focusfld, str, fieldname)
{
 if (IsChar(str)==false)
  {	alert("Only Characters(valid) are allowed in "+ fieldname +"." );focusfld.focus(); return false}
  else
  return true; 
}


function IsChar(sText)
{
   var ValidChars = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   var Char;
   var IsCh=true;
 
   for (i = 0; i < sText.length && IsCh == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsCh = false;
         }
      }
   return IsCh;
   
   }

function IsNumeric(sText)
{
   var ValidChars = "0123456789-+";
   var Char;
   var IsNumber=true;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

function echeck(focusfld, str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)

		if (str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please Enter A Valid E-mail Address");
		   focusfld.focus();
		   return false
		}

		if (str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Please Enter A Valid E-mail Address");
			focusfld.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("Please Enter A Valid E-mail Address");
			focusfld.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Please Enter A Valid E-mail Address");
			focusfld.focus();
		    return false
		 }
         if (str!='')
	      {
		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("Please Enter A Valid E-mail Address");
			focusfld.focus();
		    return false
		 }
		  }
		
		 if (str.indexOf(" ")!=-1){
		   alert("Please Enter A Valid E-mail Address");
			focusfld.focus();
		    return false
		 }

 		 return true					
	}


function validateblank(focusfld, str, message)
{
   var strval=Trim(str)
 
   if (strval=="")
     {

	alert("Please enter "+message+".")
	focusfld.focus();
	return false;
      }
     return true;
   
   }


function Trim(TRIM_VALUE)
{
if(TRIM_VALUE.length < 1){
return"";
}
//TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function



function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function