function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

function interoffice()
{
		new_window = window.open('inter_office_fullreport.asp', 'interofficereferral', 'top=0,left=0,width='+screen.availWidth+',height='+screen.availHeight+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,location=no,copyhistory=no');
}

function firmvalidate()
{
	if(form.firmIDs.value==0)
		 {
			alert("Please select a firm before proceed!");
			return false;
		 }
}

function uploadFileCheck()
{
	if(form1.file.value=="")
		 {
			alert("Please choose a file to upload!");
			return false;
		 }
}

function validateSEPICdelete()
{
	if(form.deleteID.value=="")
		 {
			alert("Please select a company name!");
			return false;
		 }
	else
		 {
			alert("Your record has been deleted successfully!");
		 }
}

function validateSEPIC()
{
	if(form.completedby.value=="")
		 {
			alert("Please enter completed by who?");
			return false;
		 }
	else if(form.datelastreview.value=="")
		 {
			alert("Please enter date of last review !");
			return false;
		 }
	else if(form.noofrecords.value=="")
		 {
			alert("Please enter No. of Records you intend to enter !");
			return false;
		 }
}

function membervalidate()
{
var userid;
var password;

	if(form.username.value=="")
		 {
			alert("Please enter your User ID!");
			return false;
		 }
	else if(form.password.value=="")
		 {
			alert("Please enter your Password !");
			return false;
		 }
}

function surveyvalidate()
{
	if(form.netfee1.value=="")
		 {
			alert("Please enter your net fee income for your fiscal year ended 2006 (or the most recent date available) in dollars!");
			return false;
		 }
	else if(!isInteger(form.netfee1.value))
		 {
			alert("Please enter your Password !");
			return false;
		 }
}

function memberloginpage()
{
	new_window = window.open('memberlogin.asp', 'memberloginpagess', 'fullscreen=yes,left=0,top=0,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function memberloginpage2()
{
	new_window = window.open('administrator/memberlogin.asp', 'memberloginpages2', 'fullscreen=yes,height=600,left=0,top=0,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country1()
{
	new_window = window.open('country/australia.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country2()
{
	new_window = window.open('country/malaysia.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country3()
{
	new_window = window.open('country/singapore.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country4()
{
	new_window = window.open('country/cambodia.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country5()
{
	new_window = window.open('country/myanmar.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country6()
{
	new_window = window.open('country/hongkong.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country7()
{
	new_window = window.open('country/pakistan.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country8()
{
	new_window = window.open('country/india.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}

function country9()
{
	new_window = window.open('country/philippines.htm', 'pass', 'width=602,height=545,left=30,top=40,scrollbars=yes,toolbar=no,directories=no,status=no,menubar=no');
}