
//Email Validation Script

function forgot_validate()
{
		var email	= document.forgotfrm.txtEmail.value;
		if (email == "") 
		{
			alert ("Please enter the email address");
			document.forgotfrm.txtEmail.focus();
			return false;
		}
		
		if (!validateEmail(email,1,1)) 
		{
		document.forgotfrm.txtEmail.focus();
		return false;
		}
		if (document.forgotfrm.txtMember.value == "") 
		{
			alert ("Please select the action");
			document.forgotfrm.txtMember.focus();
			return false;
		}
}
function feedback_validate()
{
if (document.frmFeedback.varComments.value == "") 
		{
			alert ("Please enter your comment");
			document.frmFeedback.varComments.focus();
			return false;
		}	
}

function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}

	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}

 //Function phone validation Script
// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

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++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone)
{
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

//script validation for date 
function date_valid(dateissue,dateissue2){
	var stdate=dateissue.split("/");
	var enddate=dateissue2.split("/");
	var prostdate = new Date();
	prostdate.setFullYear(stdate[2]);
	prostdate.setMonth(stdate[0]-1);
	prostdate.setDate(stdate[1]);
	
	var proenddate = new Date();
	proenddate.setFullYear(enddate[2]);
	proenddate.setMonth(enddate[0]-1);
	proenddate.setDate(enddate[1]);
	
	var startingdate = prostdate.getTime();
	var endingdate = proenddate.getTime();

	if(startingdate > endingdate)
	{
		return false;
	}
	return true;
}

//validation for Registration

function registration_validate(){
		if (document.frmRegistration.txtFirstName.value == "") 
		{
			alert ("Please enter the first name");
			document.frmRegistration.txtFirstName.focus();
			return false;
		}
		if (document.frmRegistration.txtLastName.value == "") 
		{
			alert ("Please enter the last name");
			document.frmRegistration.txtLastName.focus();
			return false;
		}
		if (document.frmRegistration.txtAddress1.value == "") 
		{
			alert ("Please enter the address1");
			document.frmRegistration.txtAddress1.focus();
			return false;
		}
		
		if (document.frmRegistration.txtContact.value == "") 
		{
			alert ("Please enter the contact number");
			document.frmRegistration.txtContact.focus();
			return false;
		}
		
		if(isNaN(document.frmRegistration.txtContact.value ))
		{
			alert("Contact Number Must be in numeric");
			document.frmRegistration.txtContact.value = "";
			document.frmRegistration.txtContact.focus();
			return false;
		}
		
		
		if (document.frmRegistration.txtCity.value == "") 
		{
			alert ("Please enter the city");
			document.frmRegistration.txtCity.focus();
			return false;
		}
		if (document.frmRegistration.txtCountry.value == "") 
		{
			alert ("Please select the country");
			document.frmRegistration.txtCountry.focus();
			return false;
		}
		if(document.frmRegistration.txtCountry.value == "US")
		{
			if (document.frmRegistration.txtState.value == "") 
			{
				alert ("Please select the state");
				document.frmRegistration.txtState.focus();
				return false;
			}
		}
		else
		{
			if (document.frmRegistration.txtState1.value == "") 
			{
				alert ("Please enter the state");
				document.frmRegistration.txtState1.focus();
				return false;
			}
		}
		if (document.frmRegistration.txtZipCode.value == "") 
		{
			alert ("Please enter the zip code");
			document.frmRegistration.txtZipCode.focus();
			return false;
		}		
		
		var emailid = document.frmRegistration.txtEmail.value;
		if ( emailid == "") 
		{
			alert ("Please enter the email address");
			document.frmRegistration.txtEmail.focus();
			return false;
		}	
		
		if (!validateEmail(emailid,1,1)) 
		{
		document.frmRegistration.txtEmail.focus();
		return false;
		}
		var password = document.frmRegistration.txtPassword.value;
		if ( password == "") 
		{
			alert ("Please enter the password");
			document.frmRegistration.txtPassword.focus();
			return false;
		}
		
		var sss = document.frmRegistration.txtPassword.value.length;		
		if(sss < 8)
		{
			alert ("Password must be minimum 8 characters");
			document.frmRegistration.txtPassword.focus();
			return false;			
		}
		
		var conpassword = document.frmRegistration.txtConPassword.value;
		if ( conpassword == "") 
		{
			alert ("Please enter the confirm password");
			document.frmRegistration.txtConPassword.focus();
			return false;
		}
		
		if(document.frmRegistration.txtPassword.value !== document.frmRegistration.txtConPassword.value)
		{
			alert("Please enter the correct password");
			document.frmRegistration.txtConPassword.focus();
			return false;	
		}
		
		//billing address
		
		if (document.frmRegistration.addr_bill.value == "") 
		{
			alert ("Please enter the billing address");
			document.frmRegistration.addr_bill.focus();
			return false;
		}
		if (document.frmRegistration.city_bill.value == "") 
		{
			alert ("Please enter the billing city");
			document.frmRegistration.city_bill.focus();
			return false;
		}
		if (document.frmRegistration.postcode_bill.value == "") 
		{
			alert ("Please enter the zip code");
			document.frmRegistration.postcode_bill.focus();
			return false;
		}
		if(isNaN(document.frmRegistration.postcode_bill.value ))
		{
		alert("Zipcode Must be in numeric");
		document.frmRegistration.postcode_bill.value = "";
		document.frmRegistration.postcode_bill.focus();
		return false;
		}
		
		if (document.frmRegistration.txtCardholdname.value == "") 
		{
			alert ("Please enter the cardholder's name");
			document.frmRegistration.txtCardholdname.focus();
			return false;
		}
		if (document.frmRegistration.txt_cctype.value == "") 
		{
			alert ("Please select the card type");
			document.frmRegistration.txt_cctype.focus();
			return false;
		}
		if (document.frmRegistration.txtCardNumber.value == "") 
		{
			alert ("Please enter the card number");
			document.frmRegistration.txtCardNumber.focus();
			return false;
		}
		if (document.frmRegistration.card_exp_month.value == "") 
		{
			alert ("Please select the expiry month");
			document.frmRegistration.card_exp_month.focus();
			return false;
		}
		if (document.frmRegistration.card_exp_year.value == "") 
		{
			alert ("Please select the expiry year");
			document.frmRegistration.card_exp_year.focus();
			return false;
		}
		if (document.frmRegistration.txtSecurityCode.value == "") 
		{
			alert ("Please enter the security code");
			document.frmRegistration.txtSecurityCode.focus();
			return false;
		}
		
		
}


function order_form(){
	
	
		if (document.frmRegistration.txtFirstName.value == "") 
		{
			alert ("Please enter the first name");
			document.frmRegistration.txtFirstName.focus();
			return false;
		}
		if (document.frmRegistration.txtLastName.value == "") 
		{
			alert ("Please enter the last name");
			document.frmRegistration.txtLastName.focus();
			return false;
		}
		if (document.frmRegistration.txtAddress1.value == "") 
		{
			alert ("Please enter the address1");
			document.frmRegistration.txtAddress1.focus();
			return false;
		}
		
		if (document.frmRegistration.txtContact.value == "") 
		{
			alert ("Please enter the contact number");
			document.frmRegistration.txtContact.focus();
			return false;
		}
		
		if(isNaN(document.frmRegistration.txtContact.value ))
		{
			alert("Contact Number Must be in numeric");
			document.frmRegistration.txtContact.value = "";
			document.frmRegistration.txtContact.focus();
			return false;
		}
		
		
		if (document.frmRegistration.txtCity.value == "") 
		{
			alert ("Please enter the city");
			document.frmRegistration.txtCity.focus();
			return false;
		}
		if (document.frmRegistration.txtCountry.value == "") 
		{
			alert ("Please select the country");
			document.frmRegistration.txtCountry.focus();
			return false;
		}
		if(document.frmRegistration.txtCountry.value == "US")
		{
			if (document.frmRegistration.txtState.value == "") 
			{
				alert ("Please select the state");
				document.frmRegistration.txtState.focus();
				return false;
			}
		}
		else
		{
			if (document.frmRegistration.txtState1.value == "") 
			{
				alert ("Please enter the state");
				document.frmRegistration.txtState1.focus();
				return false;
			}
		}
		if (document.frmRegistration.txtZipCode.value == "") 
		{
			alert ("Please enter the zip code");
			document.frmRegistration.txtZipCode.focus();
			return false;
		}		
		
		var emailid = document.frmRegistration.txtEmail.value;
		if ( emailid == "") 
		{
			alert ("Please enter the email address");
			document.frmRegistration.txtEmail.focus();
			return false;
		}	
		
		if (!validateEmail(emailid,1,1)) 
		{
		document.frmRegistration.txtEmail.focus();
		return false;
		}
		
		if (document.frmRegistration.paym.value == "") 
		{
			alert ("Please Select Payment Method");
			document.frmRegistration.paym.focus();
			return false;
		}	
			

}

//validation for feedreg

function FbReg_validate()
{
		if (document.frmFbReg.txtFirstName.value == "") 
		{
			alert ("Please enter the first name");
			document.frmFbReg.txtFirstName.focus();
			return false;
		}
		if (document.frmFbReg.txtLastName.value == "") 
		{
			alert ("Please enter the last name");
			document.frmFbReg.txtLastName.focus();
			return false;
		}
		if (document.frmFbReg.txtAddress1.value == "") 
		{
			alert ("Please enter the address1");
			document.frmFbReg.txtAddress1.focus();
			return false;
		}
		if (document.frmFbReg.txtContact.value == "") 
		{
			alert ("Please enter the contact number");
			document.frmFbReg.txtContact.focus();
			return false;
		}
		
		if(isNaN(document.frmFbReg.txtContact.value ))
		{
			alert("Contact Number Must be in numeric");
			document.frmFbReg.txtContact.value = "";
			document.frmFbReg.txtContact.focus();
			return false;
		}
			
		if (document.frmFbReg.txtCity.value == "") 
		{
			alert ("Please enter the city");
			document.frmFbReg.txtCity.focus();
			return false;
		}
		if (document.frmFbReg.txtCountry.value == "") 
		{
			alert ("Please select the country");
			document.frmFbReg.txtCountry.focus();
			return false;
		}
		if(document.frmFbReg.txtCountry.value == "US")
		{
			if (document.frmFbReg.txtState.value == "") 
			{
				alert ("Please select the state");
				document.frmFbReg.txtState.focus();
				return false;
			}
		}
		else
		{
			if (document.frmFbReg.txtState1.value == "") 
			{
				alert ("Please enter the state");
				document.frmFbReg.txtState1.focus();
				return false;
			}
		}
		if (document.frmFbReg.txtZipCode.value == "") 
		{
			alert ("Please enter the zip code");
			document.frmFbReg.txtZipCode.focus();
			return false;
		}		
		
		var emailid = document.frmFbReg.txtEmail.value;
		if ( emailid == "") 
		{
			alert ("Please enter the email address");
			document.frmFbReg.txtEmail.focus();
			return false;
		}	
		
		if (!validateEmail(emailid,1,1)) 
		{
		document.frmFbReg.txtEmail.focus();
		return false;
		}
		var username = document.frmFbReg.txtUsername.value;
		if ( username == "") 
		{
			alert ("Please enter the Username");
			document.frmFbReg.txtUsername.focus();
			return false;
		}
		
		var password = document.frmFbReg.txtPassword.value;
		if ( password == "") 
		{
			alert ("Please enter the password");
			document.frmFbReg.txtPassword.focus();
			return false;
		}
		
		var sss = document.frmFbReg.txtPassword.value.length;		
		if(sss < 8)
		{
			alert ("Password must be minimum 8 characters");
			document.frmFbReg.txtPassword.focus();
			return false;			
		}
		
		var conpassword = document.frmFbReg.txtConfirmPassword.value;
		if ( conpassword == "") 
		{
			alert ("Please enter the confirm password");
			document.frmFbReg.txtConfirmPassword.focus();
			return false;
		}
		
		if(document.frmFbReg.txtPassword.value !== document.frmFbReg.txtConfirmPassword.value)
		{
			alert("Please enter the correct password");
			document.frmFbReg.txtConfirmPassword.focus();
			return false;	
		}
		
		//billing address
		
		if (document.frmFbReg.addr_bill.value == "") 
		{
			alert ("Please enter the billing address");
			document.frmFbReg.addr_bill.focus();
			return false;
		}
		if (document.frmFbReg.city_bill.value == "") 
		{
			alert ("Please enter the billing city");
			document.frmFbReg.city_bill.focus();
			return false;
		}
		if (document.frmFbReg.postcode_bill.value == "") 
		{
			alert ("Please enter the zip code");
			document.frmFbReg.postcode_bill.focus();
			return false;
		}
		if(isNaN(document.frmFbReg.postcode_bill.value ))
		{
			alert("Zipcode Must be in numeric");
			document.frmFbReg.postcode_bill.value = "";
			document.frmFbReg.postcode_bill.focus();
			return false;
		}
		if (document.frmFbReg.txtCardholdname.value == "") 
		{
			alert ("Please enter the cardholder's name");
			document.frmFbReg.txtCardholdname.focus();
			return false;
		}
		if (document.frmFbReg.txt_cctype.value == "") 
		{
			alert ("Please select the card type");
			document.frmFbReg.txt_cctype.focus();
			return false;
		}
		if (document.frmFbReg.txtCardNumber.value == "") 
		{
			alert ("Please enter the card number");
			document.frmFbReg.txtCardNumber.focus();
			return false;
		}
		if (document.frmFbReg.card_exp_month.value == "") 
		{
			alert ("Please select the expiry month");
			document.frmFbReg.card_exp_month.focus();
			return false;
		}
		if (document.frmFbReg.card_exp_year.value == "") 
		{
			alert ("Please select the expiry year");
			document.frmFbReg.card_exp_year.focus();
			return false;
		}
		if (document.frmFbReg.txtSecurityCode.value == "") 
		{
			alert ("Please enter the security code");
			document.frmFbReg.txtSecurityCode.focus();
			return false;
		}
				
}


//validation for investors

function login_validate(){	
		if (document.frmLogin.txtUsername.value == "") 
		{
			alert ("Please enter the Username");
			document.frmLogin.txtUsername.focus();
			return false;
		}	
		
		if (document.frmLogin.txtPassword.value == "") 
		{
			alert ("Please enter the password");
			document.frmLogin.txtPassword.focus();
			return false;
		}		
}

function frm_mail()
{
document.frmRegistration.action="inventorregistration.php";
document.frmRegistration.submit();
return true;
}
function PayPal()
{
	window.location = "https://www.paypal.com/cgi-bin/webscr";
}


function addinnovation_validate()
{		
var start  = document.frmAddInno.txtOpenBid.value;
var end    = document.frmAddInno.txtCloseBid.value;

	var StartSplit  = start.split("/");
	var StartDay    = StartSplit[1];
	var StartMonth  = StartSplit[0];
	var StartYear   = StartSplit[2];
	
	var EndSplit  = end.split("/");
	var EndDay    = EndSplit[1];
	var EndMonth  = EndSplit[0];
	var EndYear   = EndSplit[2];
	
var Currentdate  = document.frmAddInno.today.value;

	var Today  = Currentdate.split("-");
	var TodayDay    = Today[2];
	var TodayMonth  = Today[1];
	var TodayYear   = Today[0]; 

		if (document.frmAddInno.txtInventName.value == "") 
		{
			alert ("Please enter the Invention Name");
			document.frmAddInno.txtInventName.focus();
			return false;
		}
		if (document.frmAddInno.txtInnType.value == "") 
		{
			alert ("Please enter the type of innovation");
			document.frmAddInno.txtInnType.focus();
			return false;
		}
		//if (document.frmAddInno.txtPatentId.value == "") 
		//{
		//	alert ("Please upload the patent id");
		//	document.frmAddInno.txtPatentId.focus();
		//	return false;
		//}
		if (document.frmAddInno.txtAbstract.value == "") 
		{
			alert ("Please enter the abstract");
			document.frmAddInno.txtAbstract.focus();
			return false;
		}
		
		/*if (document.frmAddInno.ImageFile.value == "") 
		{
			alert ("Please upload the image file");
			document.frmAddInno.ImageFile.focus();
			return false;
		}
		if (document.frmAddInno.MediaFile.value == "") 
		{
			alert ("Please upload the media file");
			document.frmAddInno.MediaFile.focus();
			return false;
		}*/
		if (document.frmAddInno.varDocs.value == "") 
		{
			alert ("Please upload the documentation file");
			document.frmAddInno.varDocs.focus();
			return false;
		}
		if (document.frmAddInno.XLSFile.value == "") 
		{
			alert ("Please upload the XLS file");
			document.frmAddInno.XLSFile.focus();
			return false;
		}
		if (document.frmAddInno.txtBaseBid.value == "") 
		{
			alert ("Please enter the Basebid value");
			document.frmAddInno.txtBaseBid.focus();
			return false;
		}

		if (isNaN(document.frmAddInno.txtBaseBid.value)) 
		{
			alert ("Please enter the Integer");
			document.frmAddInno.txtBaseBid.focus();
			return false;
		}
		if (document.frmAddInno.txtOpenBid.value == "") 
		{
			alert ("Please enter the open bidding");
			document.frmAddInno.txtOpenBid.focus();
			return false;
		}
		if (document.frmAddInno.txtOpenBid.value != "")
		{
			
			if( TodayYear > StartYear )
			{
				alert ("Please enter the valid year in open bidding");
			    document.frmAddInno.txtOpenBid.focus();
			    return false; 
			}
			if( TodayYear == StartYear )
			{
				if( TodayMonth > StartMonth)
				{
					alert ("Please enter the valid month in open bidding");
			        document.frmAddInno.txtOpenBid.focus();
			        return false; 
				}
			}
			if( TodayMonth == StartMonth )
			{
				if( TodayDay > StartDay)
				{
					alert ("Please enter the valid day in open bidding");
			        document.frmAddInno.txtOpenBid.focus();
			        return false; 
				}
			}	
						
		}
		
		if (document.frmAddInno.txtCloseBid.value == "") 
		{
			alert ("Please enter the close bidding");
			document.frmAddInno.txtCloseBid.focus();
			return false;
		}
		if (document.frmAddInno.txtCloseBid.value != "")
		{
			
			if( EndYear < StartYear )
			{
				alert ("Please enter the valid year in close bidding");
			    document.frmAddInno.txtCloseBid.focus();
			    return false; 
			}
			
			if( EndYear == StartYear )
			{
				if( EndMonth < StartMonth )
				{
					alert ("Please enter the valid month in close bidding");
			        document.frmAddInno.txtCloseBid.focus();
			        return false; 
				}
			}
			if( EndMonth == StartMonth )
			{
				if( StartDay >= EndDay)
				{
					alert ("Please enter the valid day in close bidding");
			        document.frmAddInno.txtCloseBid.focus();
			        return false; 
				}
			}	
						
		}
		
		
}

//validation for inventoremail

function inventoremail_validate(){
	
		var email	= document.frmInventorEmail.txtToEmail.value;
		if (email == "") 
		{
			alert ("Please enter the email address");
			document.frmInventorEmail.txtToEmail.focus();
			return false;
		}
		
		if (!validateEmail(email,1,1)) 
		{
		document.frmInventorEmail.txtToEmail.focus();
		return false;
		}
		
		if (document.frmInventorEmail.txtSubject.value == "") 
		{
			alert ("Please enter the subject");
			document.frmInventorEmail.txtSubject.focus();
			return false;
		}
		
		if (document.frmInventorEmail.txtMessage.value == "") 
		{
			alert ("Please enter the message");
			document.frmInventorEmail.txtMessage.focus();
			return false;
		}
}

//winning bids

function bids_validate()
{
	if(document.frmInventorEmail.txtBidAmount.value == "")
	{
		alert ("Please enter the bids amount");
		document.frmInventorEmail.txtBidAmount.focus();
		return false;
	}
	if(isNaN(document.frmInventorEmail.txtBidAmount.value))
	{
		alert ("Please enter the bids amount as numeric");
		document.frmInventorEmail.txtBidAmount.focus();
		return false;
	}
	if(document.frmInventorEmail.txtMessage.value == "")
	{
		alert ("Please enter the Comments");
		document.frmInventorEmail.txtMessage.focus();
		return false;
	}
}


function winbids_validate()
{
	if(document.frmWinning.radWinningBids.checked == false)
	{
		alert ("Please choose the winning bids");
		return false;
	}
}

function sameaddress()
{
		if(document.frmRegistration.cheAddress.checked)
		{
			document.frmRegistration.addr_bill.value = document.frmRegistration.txtAddress1.value;
			document.frmRegistration.city_bill.value = document.frmRegistration.txtCity.value;
			document.frmRegistration.country_bill.value = document.frmRegistration.txtCountry.value;
			if(document.frmRegistration.txtCountry.value == "US")
			{
				document.frmRegistration.state_bill.value = document.frmRegistration.txtState.value;
				postate = document.getElementById("poststate");
			    if(postate)
			    {
				  postate.style.display="block";
				  postate.style.visibility="visible";
			    }
				pootherstate = document.getElementById("postotherstate");
			    if(pootherstate)
			    {
				  pootherstate.style.display="none";
				  pootherstate.style.visibility="hidden";
			    }
			}
			else
			{
				document.frmRegistration.state_bill1.value = document.frmRegistration.txtState1.value;
				
			}
			document.frmRegistration.postcode_bill.value = document.frmRegistration.txtZipCode.value;
			return true;
		
		}
		if(document.frmRegistration.cheAddress.checked == false)
		{
			document.frmRegistration.addr_bill.value = "";
			document.frmRegistration.city_bill.value = "";
			document.frmRegistration.country_bill.value = "";
			document.frmRegistration.state_bill.value = "";
			document.frmRegistration.state_bill1.value = "";
			document.frmRegistration.postcode_bill.value = "";
			
			pootherstate = document.getElementById("postotherstate");
			    if(pootherstate)
				{
				 pootherstate.style.display="block";
				 pootherstate.style.visibility="visible";
			    }
			    postate = document.getElementById("poststate");
			    if(postate)
			    {
				 postate.style.display="none";
				 postate.style.visibility="hidden";
			   }
			return true;
		
		}
}

function ckecksameaddress()
{
		if(document.frmFbReg.cheAddress.checked){
		document.frmFbReg.addr_bill.value = document.frmFbReg.txtAddress1.value;
		document.frmFbReg.city_bill.value = document.frmFbReg.txtCity.value;
		document.frmFbReg.country_bill.value = document.frmFbReg.txtCountry.value;
		
		    if(document.frmFbReg.txtCountry.value == "US")
			{
				 
				document.frmFbReg.state_bill.value = document.frmFbReg.txtState.value;
				postate = document.getElementById("poststate");
			    if(postate)
			    {
				  postate.style.display="block";
				  postate.style.visibility="visible";
			    }
				pootherstate = document.getElementById("postotherstate");
			    if(pootherstate)
			    {
				  pootherstate.style.display="none";
				  pootherstate.style.visibility="hidden";
			    }
			}
			else
			{
				 //alert(document.frmFbReg.txtState.value);
				document.frmFbReg.state_bill1.value = document.frmFbReg.txtState1.value;
			}
		
		//document.frmFbReg.state_bill.value = document.frmFbReg.txtState.value;
		document.frmFbReg.postcode_bill.value = document.frmFbReg.txtZipCode.value;
		return true;
		
		}
		if(document.frmFbReg.cheAddress.checked == false){
		document.frmFbReg.addr_bill.value = "";
		document.frmFbReg.city_bill.value = "";
		document.frmFbReg.country_bill.value = "";
		document.frmFbReg.state_bill.value = "";
		document.frmFbReg.state_bill1.value = "";
		document.frmFbReg.postcode_bill.value = "";
		
		pootherstate = document.getElementById("postotherstate");
		if(pootherstate)
		{
		 pootherstate.style.display="block";
		 pootherstate.style.visibility="visible";
		}
		postate = document.getElementById("poststate");
		if(postate)
		{
		 postate.style.display="none";
		 postate.style.visibility="hidden";
	   }
		return true;
		
		}
}

function poplinks(url)
{
	newwindow=window.open(url,'ImageDisplay','height=400,width=600,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function popup(url)
{
	newwindow=window.open(url,'ImageDisplay','height=550,width=730,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function popservices(url)
{
	newwindow=window.open(url,'ImageDisplay','height=400,width=600,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function popmessage(url)
{
	newwindow=window.open(url,'ImageDisplay','height=450,width=500,left=200,top=300,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function frm_feed()
{
	if(document.addfeedback.feedback.value == "")
	{
		alert ("Please enter your Feedback");
		document.addfeedback.feedback.focus();
		return false;
	}
return true;	
}

function frm_comment()
{
	if(document.addcomments.comments.value == "")
	{
		alert ("Please enter your Comments");
		document.addcomments.comments.focus();
		return false;
	}
return true;
}
function search_validate()
{
	if(document.frmSearch.keyword.value == "")
	{
		alert ("Please enter the search keyword");
		document.frmSearch.keyword.focus();
		return false;
	}
		return true;
}
/*function searchinvention_validate()
{
	if(document.frmSearch.keyword.value == "")
	{
		alert ("Please enter the search keyword");
		document.frmSearch.keyword.focus();
		return false;
	}
		return true;
}*/
function searchinvention_validate()
{
	var Invention = document.frmSearch.txtInventName.value;
	var ValueFrom = document.frmSearch.txtBaseBidValueFrom.value;
	var ValueTo   = document.frmSearch.txtBaseBidValueTo.value;
	if( Invention=="" && ValueFrom=="" && ValueTo=="")
	{
		alert("Please enter any one value");
		document.frmSearch.txtInventName.focus();
		return false;
	}
/*	if(document.frmSearch.txtInventName.value == "")
	{
		alert ("Please enter the invention name");
		document.frmSearch.txtInventName.focus();
		return false;
	}
	if(document.frmSearch.txtBaseBidValueFrom.value == "")
	{
		alert ("Please enter base bidding value range from");
		document.frmSearch.txtBaseBidValueFrom.focus();
		return false;
	}
	if(document.frmSearch.txtBaseBidValueTo.value == "")
	{
		alert ("Please enter base bidding value range to");
		document.frmSearch.txtBaseBidValueTo.focus();
		return false;
	}*/
	if(isNaN(document.frmSearch.txtBaseBidValueFrom.value))
	{
		alert ("Please enter base bidding value in integer");
		document.frmSearch.txtBaseBidValueFrom.focus();
		return false;
	}
	
	if(isNaN(document.frmSearch.txtBaseBidValueTo.value))
	{
		alert ("Please enter base bidding value in integer");
		document.frmSearch.txtBaseBidValueTo.focus();
		return false;
	}
return true;
}
function search_all()
{
  document.form.action="searchresult.php";
  document.form.submit();
  return true;
}
function SearchAll_validation()
{
	 if(document.Search_All.Search_All.value == "")
	{
		alert ("Please enter keyword to search");
		document.Search_All.Search_All.focus();
		return false;
	}
}
function MyInnovation_validation()
{
	 //alert("hi");
	 var Count  = document.frmMyInnovation.checkcount.value
	 var Concat = 0;
	 for(var i=1;i<=Count;i++)
	 {
		 //alert("hi");
		 var varCheck = document.frmMyInnovation['txtInnoType'+i].checked;
		 if(varCheck)
		 {
		  Concat += 1;
		  //alert(Concat);
		 }
	 }
	 if(Concat == "")
	 {
		  alert("Please choose any one innovation");
		  return false;
	 }
	 return true;
}

function forgetpass_validate(){
var txtUsername=document.frmforgetpass.txtUsername.value;
	 if(txtUsername == "")
			 {
			 alert("Please enter the Username");
			 document.frmforgetpass.txtUsername.focus();
			 return false;
			 }
var txtEmail=document.frmforgetpass.txtEmail.value;
	 if(txtEmail == ""){
			 alert("Please enter the Email address");
			 document.frmforgetpass.txtEmail.focus();
			 return false;
	}

	if (!validateEmail(txtEmail,1,1)) 
	 {
	 document.frmforgetpass.txtEmail.focus();
	 return false;
	 }
}

function printpopup(url)
{
newwindow=window.open(url,'ImageDisplay','height=650,width=750,left=150,top=200,resizable=yes,scrollbars=yes');
if (window.focus) {newwindow.focus()}
}
