function confirmDelete()
 {
  if (confirm("Are you sure you want to delete this record?")) {
top.location.href="folders.asp?action=delete&record=1";
  }
}

function sendMessage(message)
{
	alert(message) 
}


function resetDate(whichField)
{
year2 = document.Main[whichField + "_year"].value;
month2 = document.Main[whichField + "_month"].value;
day2 = document.Main[whichField + "_day"].value;  
var DayArray = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
var MonthArray = new Array("01","02","03","04","05","06","07","08","09","10","11","12");  
var inpDate = day2 + month2 + year2;    
var filter=/^[0-9]{2}[0-9]{2}[0-9]{4}$/;  

//Check ddmmyyyy date supplied
if (! filter.test(inpDate))
  {
 	document.Main[whichField].value = '';
  }
/* Check Valid Month */    
filter=/01|02|03|04|05|06|07|08|09|10|11|12/ ;  
if (! filter.test(month2))   
  { 
  document.Main[whichField].value = '';  
  }
/* Check For Leap Year */
var N = Number(year2);   
if ( ( N%4==0 && N%100 !=0 ) || ( N%400==0 ) )
  	{   
   DayArray[1]=29; 
  	}
/* Check for valid days for month */
for(var ctr=0; ctr<=11; ctr++)
  	{   
   if (MonthArray[ctr]==month2)
   	{  
 if (day2<= DayArray[ctr] && day2 >0 )
   { 
   document.Main[whichField].value = month2 + "/" + day2 + "/" + year2;
   } 
 else
   { 
  document.Main[whichField].value = '';
   }
   	}
   }
}

function resetHour(whichField)
{
	hour2 = document.Main[whichField + "_hour"].value;
	minute2 = document.Main[whichField + "_minute"].value;
   document.Main[whichField].value = hour2 + ":" + minute2 + ":" + "00";
   
}

function confirmpassword(oForm) {
	string1 = oForm.Password.value;
	string2 = oForm.ConfirmPassword.value;
	if (string1 == string2) {
		return true;
	} else {
		alert("Try your passwords again.");
		oForm.Password.value='';
		oForm.ConfirmPassword.value='';
		return false;
	}
}

function jump(oSelect) {
	var url = oSelect.item(oSelect.selectedIndex).value;
	window.location.href= url;
	return false;
}


function validateForm(oForm) {
	var ok = true;
	for (var i = 0; i < oForm.length; i++) {
		var reqFlag = oForm.elements[i].id;
		var reqValue = oForm.elements[i].value;
       if ((reqFlag.indexOf("True") > 0) && (reqValue.length==0))  {
	   	ok = false;
		}
   }
   if (!ok) { 
   	alert("Required information is missing."); 
	}
	return ok;
}

function launch(url,parameters) {
  self.name = "opener";
  remote = window.open(url, "remote", parameters);
}

function launchChat(theme,guid,avitar) {
  self.name = "opener";
  if (theme=="") {
  	theme = "sky";
	}
  url = 'chatroom.asp?theme=' + theme + '&GUID=' + guid + '&avitar=' + avitar;
  remote = window.open(url, "remote", "resizable,width=600,height=440,left=50,top=50");
  
}

function printIt() {
	document.all.printPage.body.value = document.all.printarea.innerHTML;
	document.all.printPage.submit();
}

function contactVerify()
{
	var retFlag = true;
	
	if
	( 
	   	document.getElementById("F_1").value == "" ||
	   	document.getElementById("F_2").value == "" ||
	   	document.getElementById("F_3").value == "" ||
	   	document.getElementById("F_5").value == "" ||
	   	document.getElementById("F_7").value == "" 
	)
		retFlag = false;

	if( !retFlag )
	{
		alert("Fill out all required information");
	}
	return retFlag;


}


