function page(page1)
{
	frmmembers.PageNo.value = page1;
	frmmembers.submit();
}
function member(register)
{
  
	if(register.username.value=='')
	{
		alert("Please Enter User Name");
		register.username.focus();
		return false;
	}
	
	if(register.password.value=='')
	{
		alert("Please Enter Password");
		register.password.focus();
		return false;
	}
	if(register.contactperson.value=='')
	{
		alert("Please Enter Your Name");
		register.contactperson.focus();
		return false;
	}

	if(register.companyname.value=='')
	{
		alert("Please Enter Your Company Name");
		register.companyname.focus();
		return false;
	}
	if(register.address.value=='')
	{
		alert("Please Enter Company Address");
		register.address.focus();
		return false;
	}
	if(register.state.value=='')
	{
		alert("Please Enter State");
		register.state.focus();
		return false;
	}
	if(register.country.value=='')
	{
		alert("Please Select Country");
		register.country.focus();
		return false;
	}
	if(register.phone.value=='')
	{
		alert("Please Enter Phone Number");
		register.phone.focus();
		return false;
	}
	if(register.phone.value!='')
	{
		var phone=register.phone.value;
		phoneRE=/^[0-9]*[0-9 -]*[0-9]$/;
		if(!phone.match(phoneRE))
		{
			alert("Invalid Phone Number.");
			register.phone.focus();
			return false;
		}
	}
	if(register.email.value=='')
	{
		alert("Please Enter the Email Address");
		register.email.focus();
		return false;
	}
	if(register.email.value!='')
	{
		var email=register.email.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\nEx:abc@abc.com");
			register.email.focus();
			return false;
		}
	}

	if(register.recommenderemail.value!='')
	{
		var email=register.recommenderemail.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\nEx:abc@abc.com");
			register.recommenderemail.focus();
			return false;
		}
	}
	
	if(register.website.value!="")
	{
		var website=register.website.value;
		webRE=/^[wW]{3}\.[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!website.match(webRE))
		{
			alert("Please Enter the website address correctly.\nEx:www.multinationalforwarders.com");
			register.website.focus();
			return false;
		}
		
	}
	if(register.nob.value=="")
	{
		alert("Please Enter the Nature of Business");
		register.nob.focus();
		return false;
	}
		
	if(register.cprofile.value=="")
	{
		alert("Please Enter your Company Profile");
		register.cprofile.focus();
		return false;
	}
	if(register.iata[0].checked)
	{
		if(register.iataname.value=="")
		{
			alert("Please Enter Iata Name");
			register.iataname.focus();
			return false;
		}
	}
	
	
	/*if(register.terms.checked!= true)
	{
		alert("Please Accept the Terms and Conditions.");
		register.terms.focus();
		return false;
	}*/
	
	
	return true;
	
	
}
<!-- Dynamic Version by: Nannette Thacker -->
<!-- http://www.shiningstar.net -->
<!-- Original by :  Ronnie T. Moore -->
<!-- Web Site:  The JavaScript Source -->
<!-- Use one function for multiple text areas on a page -->
<!-- Limit the number of characters per textarea -->
<!-- Begin
function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}
//  End -->
function checkiata()
{
	
	if(document.frmmember.iata[0].checked)
	{
		
		document.frmmember.iataname.readOnly=false;
	}
	if(document.frmmember.iata[1].checked)
	{
		document.frmmember.iataname.value="";
		document.frmmember.iataname.readOnly=true;
	}
}

function inquiry(contactus)
{
	
	
	if(contactus.name.value=='')
	{
		alert("Please Enter Name");
		contactus.name.focus();
		return false;
	}

	
	if(contactus.email.value=='')
	{
		alert("Please Enter Email Address");
		contactus.email.focus();
		return false;
	}
	if(contactus.email.value!='')
	{
		var email=contactus.email.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\nEx:abc@abc.com");
			contactus.email.focus();
			return false;
		}
	}
	if(contactus.country.value=='')
	{
		alert("Please Select Country");
		contactus.country.focus();
		return false;
	}
	
	
	
	
	if(contactus.phone.value!='')
	{
		var phone=contactus.phone.value;
		phoneRE=/^[0-9]*[0-9 -]*[0-9]$/;
		if(!phone.match(phoneRE))
		{
			alert("Invalid Phone Number.");
			contactus.phone.focus();
			return false;
		}
	}

	if(contactus.description.value=='')
	{
		alert("Please Enter Description");
		contactus.description.focus();
		return false;
	}
	


}

	function scountry(list)
	{
				if(list.country.value=='')
		{
			alert("Please select the country");
			return false;
		}
		return true;
		
	}
function affiliatemember(member)
{
	
	if(member.website.value=="")
	{
		alert("Please Enter the website address");
		member.website.focus();
		return false;
	}
	else
	{
		var website=member.website.value;
		webRE=/^[wW]{3}\.[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!website.match(webRE))
		{
			alert("Please Enter the website address correctly.\nEx:www.test.com");
			member.website.focus();
			return false;
		}
		
	}
	if(member.description.value=="")
	{
		alert("Please Enter the website address");
		member.description.focus();
		return false;
	}
}

function inquiry(business)
{
	
	
	if(business.name.value=='')
	{
		alert("Please Enter Name");
		business.name.focus();
		return false;
	}

	if(business.email.value=='')
	{
		alert("Please Enter the Email");
		business.email.focus();
		return false;
	}
	if(business.email.value!='')
	{
		var email=business.email.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\nEx:abc@abc.com");
			business.email.focus();
			return false;
		}
	}
	if(business.subject.value=='')
	{
		alert("Please Enter the Subject");
		business.subject.focus();
		return false;
	}
	if(business.description.value=='')
	{
		alert("Please Enter the Inquiry Description");
		business.description.focus();
		return false;
	}
	
}
		function news(main)
	{
		if(main.title.value=='')
		{
			alert("Title can not left blank");
			main.title.focus();
			return false;
		}
		if(main.description.value=='')
		{
			alert("Description can not left blank");
			main.description.focus();
			return false;
		}
		return true;
	}

	function pass(pchange)
{
	if(pchange.oldpass.value=='')
	{
		alert("Enter Old Password");
		pchange.oldpass.focus();
		return false;
	}
	if(pchange.newpass.value=='')
	{
		alert("Enter New Password");
		pchange.newpass.focus();
		return false;
	}
	if(pchange.confirmpass.value=='')
	{
		alert("Please Confirm the Password");
		pchange.confirmpass.focus();
		return false;
	}
	if(pchange.confirmpass.value!=pchange.newpass.value)
	{
		alert("New Password amd Confirm password are not matched.");
		pchange.confirmpass.focus();
		return false;
	}
	return true;
	
	
}
function confirmation(newsletterid,attachment) {
	var answer = confirm("Do you want to delete this record?")
	if (answer){
		window.location = "viewnewsletters.php?newsletterid=" + newsletterid + "&attachment=" + attachment;
	}
	
}

	function news(main)
	{
		if(main.subject.value=='')
		{
			alert("Subject can not left blank");
			main.subject.focus();
			return false;
		}
		
	}

function chkallEmails()
{
	chk=document.frm.ChkAll;		
	if(document.frm.cnt.value > 0)
	{
 		if(document.frm.cnt.value > 1)
	  	{  	
			for(i=0;i<document.frm["chkid[]"].length;i++)
	    	{
			  document.frm["chkid[]"][i].checked=chk.checked;
			}	
	  	}  
		else
		{
			document.frm["chkid[]"].checked=chk.checked;
	  	}
	}
}
function delchkd()
{
	var v = 0;		

		if (document.frm.cnt.value>1)
		{

			for(i=0;i<document.frm["chkid[]"].length;i++)
			{
					
					if(document.frm["chkid[]"][i].checked)	
					{
						v += 1;		
						break;
					}	
				}
		}
		else
		{
				
				if(document.frm["chkid[]"].checked)	
				{
						v += 1;		
				}
				
		}		

	
	if (v==0) 
	{
			alert("Please check at least one Email Address");
			return false;
	} 		
		

}

function ValidateBanner(theBanner)
{
	
	if(theBanner.member_id.value=="")
	{
		alert("Plese Select The Company");
		theBanner.member_id.focus();
		return false;
	}
	if(theBanner.website.value=="")
	{
		alert("Plese Enter Website");
		theBanner.website.focus();
		return false;
	}/*
	else
	{
		var website=theBanner.website.value;
		webRE=/^[wW]{3}\.[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!website.match(webRE))
		{
			alert("Please check the website address\nEx:www.iwebexim.com");
			theBanner.website.focus();
			return false;
		}
	}*/
	if(theBanner.banner.value=="")
	{
	   alert("Please Upload the Banner");
	   theBanner.banner.focus();
	   return false;
	}
	else
	{
		var str=theBanner.banner.value;
		var fname = str.lastIndexOf(".");
		var fname = str.substr(fname+1);
		var fname = fname.toLowerCase();
		//alert(fname);
		if (fname == 'jpg' || fname == 'jpeg' || fname == 'gif')
		{
			
		}
		else
		{
			alert("Only .jpg or .gif files will be accepted");
			theBanner.banner.focus();
			return false;
		}
		
	
	}
	return true;
	
	}



// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 68;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src="'+imageURL+'" style="display:block"></body></html>');
close();		
}}

function logn(login)
{
	if(login.username.value=='')
	{
		alert("User Name can not be left blank");
		login.username.focus();
		return false;
	}
	if(login.password.value=='')
	{
		alert("Password can not be left blank");
		login.password.focus();
		return false;
	}
	return true;
}
function department_email(dept)
{
	if(dept.department.value=='')
	{
		alert("Please enter the department");
		dept.department.focus();
		return false;
	}
	if(dept.contactperson.value=='')
	{
		alert("Please enter the contact person name");
		dept.contactperson.focus();
		return false;
	}
	if(dept.email.value=='')
	{
		alert("Please enter the email address");
		dept.email.focus();
		return false;
	}
	if(dept.email.value!='')
	{
		var email=dept.email.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\neg:abc@abc.com");
			dept.email.focus();
			return false;
		}
	}
	
	return true;
}
var dtCh= "-";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : dd-mm-yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

	function blnum(bln)
	{
		if(bln.blnumber.value=='')
		{
			alert("Please Enter BL Number");
			bln.blnumber.focus();
			return false;
		}
		if(bln.containernumber.value=='')
		{
			alert("Please Enter Container Number");
			bln.containernumber.focus();
			return false;
		}
		if(bln.vessalname.value=='')
		{
			alert("Please Enter Vessal Name");
			bln.vessalname.focus();
			return false;
		}
		if(bln.sailedport.value=='')
		{
			alert("Please Enter Sailed Port");
			bln.sailedport.focus();
			return false;
		}

		if(bln.saileddate.value=='')
		{
			alert("Please Enter started date");
			bln.saileddate.focus();
			return false;
		}
		else
		{
			var dt=bln.saileddate
			if (isDate(dt.value)==false){
				dt.focus()
				return false
			}
		}
		
		if(bln.arrivalport.value=='')
		{
			alert("Please Enter Arrival Port");
			bln.arrivalport.focus();
			return false;
		}

		if(bln.arrivalddate.value=='')
		{
			alert("Please Enter arrival date");
			bln.arrivalddate.focus();
			return false;
		}
		else
		{
			var dt=bln.saileddate
			if (isDate(dt.value)==false){
				dt.focus()
				return false
			}
		}

		if(bln.destinationport.value=='')
		{
			alert("Please Enter Destination Port");
			bln.destinationport.focus();
			return false;
		}
		if(bln.destinationdate.value=='')
		{
			alert("Please Enter Date of Destination");
			bln.destinationdate.focus();
			return false;
		}
		else
		{
			var dt=bln.saileddate
			if (isDate(dt.value)==false){
				dt.focus()
				return false
			}
		}

		if(bln.comments.value=='')
		{
			alert("Please EnterComments");
			bln.comments.focus();
			return false;
		}
		return true;
	}
function contact(bln)
{
	if(bln.agent.value=='')
	{
		alert("Please Select Member Name");
		bln.agent.focus();
		return false;
	}
	if(bln.bno.value=='')
	{
		alert("Please Enter BL Number");
		bln.bno.focus();
		return false;
	}
	if(bln.name.value=='')
	{
		alert("Please Enter Name");
		bln.name.focus();
		return false;
	}
	if(bln.email.value=='')
	{
		alert("Please Enter Email Address");
		bln.email.focus();
		return false;
	}
	if(bln.email.value!='')
	{
		var email=bln.email.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\neg:abc@abc.com");
			bln.email.focus();
			return false;
		}
	}
	if(bln.comments.value=='')
	{
		alert("Please Enter Your Comments");
		bln.comments.focus();
		return false;
	}
	return true;
}
function track(bln)
	{
		
		if(bln.blnumber.value=='')
		{
			alert("Please Enter BL Number");
			bln.blnumber.focus();
			return false;
		}
		return true;
	}
function agent(register)
{
	if(register.username.value=='')
	{
		alert("Please Enter User Name");
		register.username.focus();
		return false;
	}

	if(register.password.value=='')
	{
		alert("Please Enter Password");
		register.password.focus();
		return false;
	}

	if(register.agentname.value=='')
	{
		alert("Please Enter Agent Name");
		register.agentname.focus();
		return false;
	}

	if(register.companyname.value=='')
	{
		alert("Please Enter Your Company Name");
		register.companyname.focus();
		return false;
	}
	
	if(register.email.value=='')
	{
		alert("Please Enter the Email Address");
		register.email.focus();
		return false;
	}
	if(register.email.value!='')
	{
		var email=register.email.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\nEx:abc@abc.com");
			register.email.focus();
			return false;
		}
	}
	
	
	
	return true;
	
	
}

function existagent(register)
{
	if(register.username.value=='')
	{
		alert("Please Enter User Name");
		register.username.focus();
		return false;
	}

	if(register.password.value=='')
	{
		alert("Please Enter Password");
		register.password.focus();
		return false;
	}
	return true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function message(member)
{
	
	
	
	if(member.subject.value=='')
	{
		alert("Please Enter the Subject");
		member.subject.focus();
		return false;
	}
	if(member.description.value=='')
	{
		alert("Please Enter the Inquiry Description");
		member.description.focus();
		return false;
	}
	
}


function recommend(member)
{
	
	
	if(member.name.value=='')
	{
		alert("Please Enter From Name");
		member.name.focus();
		return false;
	}

	
	if(member.email.value=='')
	{
		alert("Please Enter From Email Address");
		member.email.focus();
		return false;
	}
	else if(member.email.value!='')
	{
		var email=member.email.value;
		emailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!email.match(emailRE))
		{
			alert("Invalid Email Address.\nEx:abc@abc.com");
			member.email.focus();
			return false;
		}
	}
	if(member.toemail.value=='')
	{
		alert("Please Enter To Email Address");
		member.toemail.focus();
		return false;
	}
	else if(member.toemail.value!='')
	{
		var toemail=member.toemail.value;
		toemailRE=/^[a-zA-Z0-9]*[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!toemail.match(toemailRE))
		{
			alert("Invalid toemail Address.\nEx:abc@abc.com");
			member.toemail.focus();
			return false;
		}
	}
	if(member.subject.value=='')
	{
		alert("Please Enter Subject");
		member.subject.focus();
		return false;
	}
	
	if(contactus.description.value=='')
	{
		alert("Please Enter Description");
		contactus.description.focus();
		return false;
	}
	


}



function ValidateEditBanner(theBanner)
{
	
	if(theBanner.member_id.value=="")
	{
		alert("Plese Select The Company");
		theBanner.member_id.focus();
		return false;
	}
	if(theBanner.website.value=="")
	{
		alert("Plese Enter Website");
		theBanner.website.focus();
		return false;
	}
	/*else
	{
		var website=theBanner.website.value;
		webRE=/^[wW]{3}\.[a-zA-Z0-9._-]+\.[a-zA-Z]{2,4}$/;
		if(!website.match(webRE))
		{
			alert("Please check the website address\nEx:www.iwebexim.com");
			theBanner.website.focus();
			return false;
		}
	}*/
	if(theBanner.exist.value=="" && theBanner.banner.value=="")
	{
	   alert("Please Upload the Banner");
	   theBanner.banner.focus();
	   return false;
	}
	else if(theBanner.banner.value!="")
	{
		var str=theBanner.banner.value;
		var fname = str.lastIndexOf(".");
		var fname = str.substr(fname+1);
		var fname = fname.toLowerCase();
		//alert(fname);
		if (fname == 'jpg' || fname == 'gif')
		{
			
		}
		else
		{
			alert("Only .jpg or .gif files will be accepted");
			theBanner.banner.focus();
			return false;
		}
		
	
	}
	return true;
	
	}
		
