function showNews(newsid, pageType,linkid) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	if(pageType == "home") {
		pageUrl = "php/";
	}
	else {
		pageUrl = "";
	}

	window.open(pageUrl + "showNewsFrame.php?newsid=" + newsid+"&linkid="+linkid, "news", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function showTournamentNews(newsid, pageType) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	if(pageType == "home") {
		pageUrl = "php/";
	}
	else {
		pageUrl = "";
	}

	window.open(pageUrl + "showTournamentNewsFrame.php?newsid=" + newsid, "news", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function showRules(newsid, pageType) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	window.open("showRulesFrame.php?newsid=" + newsid + "&pagetype=" + pageType, "news", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	
	return;
}

function checkFeedBack() {
	document.forms[0].visitorName.value = trimSpaces(document.forms[0].visitorName.value);
	if(document.forms[0].visitorName.value.length <= 0) {
		alert("Please enter your name");
		document.forms[0].visitorName.focus();
		return false;
	}

	document.forms[0].emailAddress.value = trimSpaces(document.forms[0].emailAddress.value);
	if(document.forms[0].emailAddress.value.length <= 0) {
		alert("Please enter your email address");
		document.forms[0].emailAddress.focus();
		return false;
	}
	if(!checkEmail(document.forms[0].emailAddress.value)) {
		document.forms[0].emailAddress.focus();
		document.forms[0].emailAddress.select();
		return false;
	}
	document.forms[0].visitorComments.value = trimSpaces(document.forms[0].visitorComments.value);
	if(document.forms[0].visitorComments.value.length <= 0) {
		alert("Please enter your comments");
		document.forms[0].visitorComments.focus();
		return false;
	}
	document.forms[0].frmAction.value = "update";
}

function closeWindow() {
	parent.window.opener.window.focus();
	parent.window.close();
}

function printWindow() {
	parent.mainFrame.focus();
	window.print(parent.mainFrame);
}

function showPicture(galleryid, photoType,category) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showPictureFrame.php?galleryid=" + galleryid + "&photoType=" + photoType + "&categoryid=" + category, "vipallsports", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function showTeam(teamid) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showTeamFrame.php?teamid=" + teamid, "ncyaa", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function showEvent(galleryid, photoType) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 600;
	winHeight = 500;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showEventFrame.php?galleryid=" + galleryid + "&photoType=" + photoType, "vipallsports", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function checkTeams(){
	clubname = trimSpaces(document.forms[0].clubname.value);
	municipality = trimSpaces(document.forms[0].municipality.value);
	agebar = trimSpaces(document.forms[0].agebar.value);
	manfirstname = trimSpaces(document.forms[0].manfirstname.value);
	manlastname = trimSpaces(document.forms[0].manlastname.value);
	manaddress1 = trimSpaces(document.forms[0].manaddress1.value);
	mancity = trimSpaces(document.forms[0].mancity.value);
	manstate = trimSpaces(document.forms[0].manstate.value);
	manzip = trimSpaces(document.forms[0].manzip.value);
	manhomephone = trimSpaces(document.forms[0].manhomephone.value);
	manemail = trimSpaces(document.forms[0].manemail.value);
	assfirstname = trimSpaces(document.forms[0].assfirstname.value);
	asslastname = trimSpaces(document.forms[0].asslastname.value);
	assaddress1 = trimSpaces(document.forms[0].assaddress1.value);
	asscity = trimSpaces(document.forms[0].asscity.value);
	assstate = trimSpaces(document.forms[0].assstate.value);
	asszip = trimSpaces(document.forms[0].asszip.value);
	asshomephone = trimSpaces(document.forms[0].asshomephone.value);
	assemail = trimSpaces(document.forms[0].assemail.value);
	
	if(clubname.length <= 0){
		alert("Please enter the club name.");
		document.forms[0].clubname.focus();
		return false;
	}
	if(municipality.length <= 0){
		alert("Please enter the municipality.");
		document.forms[0].municipality.focus();
		return false;
	}
	if(agebar.length <= 0){
		alert("Please select the age bar.");
		document.forms[0].agebar.focus();
		return false;
	}
	if(manfirstname.length <= 0){
		alert("Please enter the firstname under manager information.");
		document.forms[0].manfirstname.focus();
		return false;
	}
	if(manlastname.length <= 0){
		alert("Please enter the lastname under manager information.");
		document.forms[0].manlastname.focus();
		return false;
	}
	if(manaddress1.length <= 0){
		alert("Please enter the address under manager information.");
		document.forms[0].manaddress1.focus();
		return false;
	}
	if(mancity.length <= 0){
		alert("Please enter the city under manager information.");
		document.forms[0].mancity.focus();
		return false;
	}
	if(manstate.length <= 0){
		alert("Please enter the state under manager information.");
		document.forms[0].manstate.focus();
		return false;
	}
	if(manzip.length <= 0){
		alert("Please enter the zip code under manager information.");
		document.forms[0].manzip.focus();
		return false;
	}
	if(manhomephone.length <= 0){
		alert("Please enter the home phone under manager information.");
		document.forms[0].manhomephone.focus();
		return false;
	}
	if(manhomephone.length <= 0){
		alert("Please enter the home phone under manager information.");
		document.forms[0].manhomephone.focus();
		return false;
	}
	if(!checkEmail(manemail)) {
		document.forms[0].manemail.focus();
		return false;
	}
	
	if(assfirstname.length <= 0){
		alert("Please enter the firstname under assistant manager/coach information.");
		document.forms[0].assfirstname.focus();
		return false;
	}
	if(asslastname.length <= 0){
		alert("Please enter the lastname under assistant manager/coach information.");
		document.forms[0].asslastname.focus();
		return false;
	}
	if(assaddress1.length <= 0){
		alert("Please enter the address under assistant manager/coach information.");
		document.forms[0].assaddress1.focus();
		return false;
	}
	if(asscity.length <= 0){
		alert("Please enter the city under assistant manager/coach information.");
		document.forms[0].asscity.focus();
		return false;
	}
	if(assstate.length <= 0){
		alert("Please enter the state under assistant manager/coach information.");
		document.forms[0].assstate.focus();
		return false;
	}
	if(asszip.length <= 0){
		alert("Please enter the zip code under assistant manager/coach information.");
		document.forms[0].asszip.focus();
		return false;
	}
	if(asshomephone.length <= 0){
		alert("Please enter the home phone under assistant manager/coach information.");
		document.forms[0].asshomephone.focus();
		return false;
	}
	if(asshomephone.length <= 0){
		alert("Please enter the home phone under assistant manager/coach information.");
		document.forms[0].asshomephone.focus();
		return false;
	}
	if(!checkEmail(assemail)) {
		document.forms[0].assemail.focus();
		return false;
	}
	document.forms[0].frmAction.value = "update";
}

function checkContact(){
	contactname = trimSpaces(document.forms[0].contactname.value);
	contactemail = trimSpaces(document.forms[0].contactemail.value);
	contactphone = trimSpaces(document.forms[0].contactphone.value);
	suggestions = trimSpaces(document.forms[0].suggestions.value);

	if(contactname.length <= 0){
		alert("Please enter your name.");
		document.forms[0].contactname.focus();
		return false;
	}
	if(!checkEmail(contactemail)) {
		document.forms[0].contactemail.focus();
		return false;
	}
	if(contactphone.length <= 0){
		alert("Please enter your telephone #.");
		document.forms[0].contactphone.focus();
		return false;
	}
	if(suggestions.length <= 0){
		alert("Please enter your queries/suggestions.");
		document.forms[0].suggestions.focus();
		return false;
	}
	
	document.forms[0].frmAction.value = "yes";

}

function chkLogin()
{
	user_name = trimSpaces(document.forms[0].user_name.value);
	password = trimSpaces(document.forms[0].password.value);
	
	if (user_name == "")
	{
		alert("Please enter user name");
		document.forms[0].user_name.focus();
		return false;
	}
	if (password == "")
	{
		alert("Please enter password");
		document.forms[0].password.focus();
		return false;
	}
	
	document.forms[0].frmAction.value = "Login";
	return true;
}

function checkModifyTeams(){
	
	if(document.forms[0].status.value == "M" )
	{
		manfirstname = trimSpaces(document.forms[0].manfirstname.value);
		manlastname = trimSpaces(document.forms[0].manlastname.value);
		manaddress1 = trimSpaces(document.forms[0].manaddress1.value);
		mancity = trimSpaces(document.forms[0].mancity.value);
		manstate = trimSpaces(document.forms[0].manstate.value);
		manzip = trimSpaces(document.forms[0].manzip.value);
		manhomephone = trimSpaces(document.forms[0].manhomephone.value);
		manemail = trimSpaces(document.forms[0].manemail.value);
	
		if(manfirstname.length <= 0){
			alert("Please enter the firstname under manager information.");
			document.forms[0].manfirstname.focus();
			return false;
		}
		if(manlastname.length <= 0){
			alert("Please enter the lastname under manager information.");
			document.forms[0].manlastname.focus();
			return false;
		}
		if(manaddress1.length <= 0){
			alert("Please enter the address under manager information.");
			document.forms[0].manaddress1.focus();
			return false;
		}
		if(mancity.length <= 0){
			alert("Please enter the city under manager information.");
			document.forms[0].mancity.focus();
			return false;
		}
		if(manstate.length <= 0){
			alert("Please enter the state under manager information.");
			document.forms[0].manstate.focus();
			return false;
		}
		if(manzip.length <= 0){
			alert("Please enter the zip code under manager information.");
			document.forms[0].manzip.focus();
			return false;
		}
		if(manhomephone.length <= 0){
			alert("Please enter the home phone under manager information.");
			document.forms[0].manhomephone.focus();
			return false;
		}
		if(manhomephone.length <= 0){
			alert("Please enter the home phone under manager information.");
			document.forms[0].manhomephone.focus();
			return false;
		}
		if(!checkEmail(manemail)) {
			document.forms[0].manemail.focus();
			return false;
		}
    }
	assfirstname = trimSpaces(document.forms[0].assfirstname.value);
	asslastname = trimSpaces(document.forms[0].asslastname.value);
	assaddress1 = trimSpaces(document.forms[0].assaddress1.value);
	asscity = trimSpaces(document.forms[0].asscity.value);
	assstate = trimSpaces(document.forms[0].assstate.value);
	asszip = trimSpaces(document.forms[0].asszip.value);
	asshomephone = trimSpaces(document.forms[0].asshomephone.value);
	assemail = trimSpaces(document.forms[0].assemail.value);
	
	if(assfirstname.length <= 0){
		alert("Please enter the firstname under assistant manager/coach information.");
		document.forms[0].assfirstname.focus();
		return false;
	}
	if(asslastname.length <= 0){
		alert("Please enter the lastname under assistant manager/coach information.");
		document.forms[0].asslastname.focus();
		return false;
	}
	if(assaddress1.length <= 0){
		alert("Please enter the address under assistant manager/coach information.");
		document.forms[0].assaddress1.focus();
		return false;
	}
	if(asscity.length <= 0){
		alert("Please enter the city under assistant manager/coach information.");
		document.forms[0].asscity.focus();
		return false;
	}
	if(assstate.length <= 0){
		alert("Please enter the state under assistant manager/coach information.");
		document.forms[0].assstate.focus();
		return false;
	}
	if(asszip.length <= 0){
		alert("Please enter the zip code under assistant manager/coach information.");
		document.forms[0].asszip.focus();
		return false;
	}
	if(asshomephone.length <= 0){
		alert("Please enter the home phone under assistant manager/coach information.");
		document.forms[0].asshomephone.focus();
		return false;
	}
	if(asshomephone.length <= 0){
		alert("Please enter the home phone under assistant manager/coach information.");
		document.forms[0].asshomephone.focus();
		return false;
	}
	if(!checkEmail(assemail)) {
		document.forms[0].assemail.focus();
		return false;
	}
	document.forms[0].frmAction.value = "update";
}

function checkPassword() {
	document.forms[0].password.value = trimSpaces(document.forms[0].password.value);
	if(document.forms[0].password.value.length <= 0) {
		alert("Please enter the current password");
		document.forms[0].password.focus();
		return false;
	}
	document.forms[0].newPassword.value = trimSpaces(document.forms[0].newPassword.value);
	if(document.forms[0].newPassword.value.length <= 0) {
		alert("Please enter the new password");
		document.forms[0].newPassword.focus();
		return false;
	}
	document.forms[0].retypePassword.value = trimSpaces(document.forms[0].retypePassword.value);
	if(document.forms[0].newPassword.value != document.forms[0].retypePassword.value) {
		alert("Passwords does not match");
		document.forms[0].retypePassword.focus();
		return false;
	}
	
	document.forms[0].frmAction.value = "Change";
}

function showCalendar(frmElement, hiddenElement) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 400;
	winHeight = 300;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showCalendar1.php?frmElement=" + frmElement + "&hiddenElement=" + hiddenElement, "calendar", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=0");
	return;
}

function insertDate(hiddenElement, focusElement, displayElement, selectedDate, selectedDateDisplay) {
	hiddenObject = eval("window.opener.document.forms[0]." + hiddenElement);
	focusObject = eval("window.opener.document.forms[0]." + focusElement);

	displayObject = eval("window.opener.document.forms[0]." + displayElement);
	hiddenObject.value = selectedDate;
	displayObject.value = selectedDateDisplay;
	opener.window.focus();
	focusObject.focus();
	window.close();
	return;
}

function chkTeamRoster()
{
	flag=0;
	if(document.forms[0].elements["delPlayers[]"])
	{
		if(document.forms[0].elements["delPlayers[]"].length > 1)
		{
			for (i=0;i<document.forms[0].elements["delPlayers[]"].length;i++)
			{
				if(document.forms[0].elements["delPlayers[]"].checked)
				{
					flag=1;
					break;
				}
			}
		}
		else
		{
			if(document.forms[0].elements["delPlayers[]"].checked)
			{
				flag=1;
			}
		}
	}
	if(flag == 1)
	{
		if(!confirm("Are you sure to delete selected player(s)?"))
		{
			return false;
		}
	}
	document.forms[0].frmAction.value = "Update";
	document.forms[0].submit();
}

function chkAddTeamRoster()
{
	first_name = trimSpaces(document.forms[0].first_name.value);
	last_name = trimSpaces(document.forms[0].last_name.value);
	month_date = trimSpaces(document.forms[0].month_date.value);
	day_date = trimSpaces(document.forms[0].day_date.value);
	year_date = trimSpaces(document.forms[0].year_date.value);
	uniform_no = trimSpaces(document.forms[0].uniform_no.value);
	address1 = trimSpaces(document.forms[0].address1.value);
	city = trimSpaces(document.forms[0].city.value);
	state = trimSpaces(document.forms[0].state.value);
	home_phone = trimSpaces(document.forms[0].home_phone.value);
	zip = trimSpaces(document.forms[0].zip.value);
	email = trimSpaces(document.forms[0].email.value);
		
	if( first_name == "" )
	{
		alert("Please enter first name");
		document.forms[0].first_name.focus();
		return false;
	}
	if(last_name == "" )
	{
		alert("Please enter last name");
		document.forms[0].last_name.focus();
		return false;
	}
	if(month_date == "" || month_date > 12)
	{
		alert("Please fill the date of birth properly");
		document.forms[0].month_date.focus();
		return false;
	}
	if(day_date == "" || day_date > 31)
	{
		alert("Please fill the date of birth properly");
		document.forms[0].day_date.focus();
		return false;
	}
	if(year_date == "" || year_date < 1000)
	{
		alert("Please fill the date of birth properly");
		document.forms[0].year_date.focus();
		return false;
	}
	if(home_phone == "" )
	{
		alert("Please enter home phone");
		document.forms[0].home_phone.focus();
		return false;
	}
	if(uniform_no == "" )
	{
		alert("Please enter uniform number");
		document.forms[0].uniform_no.focus();
		return false;
	}
	if(address1 == "" )
	{
		alert("Please enter address1");
		document.forms[0].address1.focus();
		return false;
	}
	if(city == "" )
	{
		alert("Please enter city");
		document.forms[0].city.focus();
		return false;
	}
	if(state == "" )
	{
		alert("Please enter state");
		document.forms[0].state.focus();
		return false;
	}
	if(zip == "" )
	{
		alert("Please enter zip");
		document.forms[0].zip.focus();
		return false;
	}
	if(email == "" )
	{
		alert("Please enter email ID");
		document.forms[0].email.focus();
		return false;
	}
	if (!checkEmail(email))
	{
		document.forms[0].email.select();
		return false;
	}

	document.forms[0].frmAction.value = "update";

}

function insertDatee(hiddenElement, focusElement, displayElement, selectedDate, selectedDateDisplay) {
	hiddenObject = eval("window.opener.document.forms[0]." + hiddenElement);
	focusObject = eval("window.opener.document.forms[0]." + focusElement);
	displayObject = eval("window.opener.document.forms[0]." + displayElement);
	hiddenObject.value = hiddenObject.value+ selectedDate+",";
	displayObject.value = displayObject.value+ selectedDateDisplay+"#";
	opener.window.focus();
	focusObject.focus();
	window.close();
	return;
}

function showCalendarr(frmElement, hiddenElement) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 400;
	winHeight = 300;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showCalendarr.php?frmElement=" + frmElement + "&hiddenElement=" + hiddenElement, "calendar", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=0");
	return;
}

function checkTournament()
{
	team_name = trimSpaces(document.tournamentFrm.team_name.value);
	agedivision = trimSpaces(document.tournamentFrm.agedivision.value);	
	coach_name = trimSpaces(document.tournamentFrm.coach_name.value);
	coach_phone = trimSpaces(document.tournamentFrm.coach_phone.value);
	coach_cell = trimSpaces(document.tournamentFrm.coach_cell.value);
	coach_email = trimSpaces(document.tournamentFrm.coach_email.value);

	if(team_name == "")
	{
		alert("Please enter the team name");
		document.tournamentFrm.team_name.focus();
		return false;		
	}	
	if(agedivision == "")
	{
		alert("Please enter the tournament agedivision");
		document.tournamentFrm.agedivision.focus();
		return false;		
	}
	if(coach_name == "")
	{
		alert("Please enter Coach Name");
		document.tournamentFrm.coach_name.focus();
		return false;		
	}
	if(coach_phone == "")
	{
		alert("Please enter phone number of coach");
		document.tournamentFrm.coach_phone.focus();
		return false;		
	}
	if(coach_cell == "")
	{
		alert("Please enter Cell # of Coach");
		document.tournamentFrm.coach_cell.focus();
		return false;		
	}	
	if(coach_email == "")
	{
		alert("Please enter email of Coach");
		document.tournamentFrm.coach_email.focus();
		return false;		
	}
   if(!checkEmail(coach_email))
	{
		document.tournamentFrm.coach_email.select();
		return false;
	}

	document.tournamentFrm.frmAction.value = "Add";

}

/*
	function to comapare two dates
	returns:
	0 - date1 less than date2
	1 - date1 greater than date2
	2 - date1 =  date2
	-1 - not valid dates
	written by: K V Paul.
*/
function compareDates(date1,date2)
{
	// assumes that dates are in the format yyyy-mm-dd
	
	varDate = date1.split("-");
	year = trimSpaces(varDate[0]); 
	month = parseInt(trimSpaces(varDate[1])); 
	day = parseInt(trimSpaces(varDate[2])); 
	d1 = new Date(year,month-1,day).getTime();

	varDate = date2.split("-");
	year = trimSpaces(varDate[0]); 
	month = trimSpaces(varDate[1]); 
	day = trimSpaces(varDate[2]);
	d2 = new Date(year,month-1,day).getTime();
	 
	if (d1==0 || d2==0)
	{
		return -1;
	}
	else if (d1 > d2) 
	{
		return 1;
	}
	else if (d1 == d2) 
	{
		return 2;
	}
	return 0;
}

function showCalendar2(frmElement, hiddenElement) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 400;
	winHeight = 300;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showCalendar2.php?frmElement=" + frmElement + "&hiddenElement=" + hiddenElement, "calendar", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=0,resizable=0");
	return;
}

function showTeamSchedule(param) 
{
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 650;
	winHeight = 450;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showTeamSchedule.php?" + param, "teamSchedule", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}

function showField(param) 
{
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth = 650;
	winHeight = 450;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;

	window.open("showFieldDirections.php?" + param, "Field", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}

//function to open in custom window
function openWindow(url,window_name,winWidth,winHeight) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	

	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;	
	window.open(url,window_name,"width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
}
function chkemailpass()
{ 
   	email = trimSpaces(document.frm.email.value);
	if(!checkEmail(email))
	{
		document.frm.email.select();
		return false;
	}
	document.frm.frmAction.value='add';
	
}