
function Invalid_Value(str) {

 if ( str.indexOf("'") != -1 || str.indexOf("%") != -1 || str.indexOf("`") != -1 || str.indexOf("'") != -1)  {
  window.alert("Invalid Information found....\n"+
                           "{ \' , % and ` ' }character's not allowed");
  return true;
 }else
 return false;
}

  

function Correct_Email ( email ) {

	/*var indexvalue1 = email.indexOf("@");
	var indexvalue2 = email.indexOf(".");
	
		if ( indexvalue1 <= 0 || indexvalue2 <=0 || indexvalue2 < indexvalue1 || indexvalue1+1 == indexvalue2) {
			window.alert("Invalid Email Value");
			return false;
		}else if ( email.indexOf("'") != -1 || email.indexOf("%") != -1 ) {
			window.alert("Email value should not contain ( \')  or ( \") character's");
			return false;
 		}
   		      return true;*/
	var indexvalue1 = email.indexOf("@");
		if ( indexvalue1 <= 0) {
			window.alert("Invalid Email Value");
			return false;
		}else if ( email.indexOf("'") != -1 || email.indexOf("%") != -1 ) {
			window.alert("Email value should not contain ( \')  or ( \") character's");
			return false;
 		}
   		      return true;
}


function Correct_DomainName( DomainName ) {

  var ch;

      DomainName = DomainName.toLowerCase();

	  
    if ( DomainName.length == 0 ) {
	     window.alert("Domain Name Should Not Empty\n");
             return false;
     }		
    
         for (var i = 0 ; i < DomainName.length ; i++ ) {
	      ch = DomainName.substring(i,i+1)

		  if ( ! (( ch >= "a" && ch <="z" ) || ( ch >="0" && ch <="9" ))) {
  		     if( ! (ch === "-" )) {
			      window.alert("Invalid Domain name, Should contain 0-9,A-Z,- char. only\n");
                              return false;
			 }
		   } else if( ch == "'" ) {
			  window.alert("Invalid Domain name, Should contain 0-9,A-Z,- char. only\n");
                          return false;
		  }
	 }// end for

  return true;
 		
}

function Correct_DomainType( DomainType ) {

 DomainType = DomainType.toLowerCase();

         if ( DomainType.length == 0 ) {
              window.alert("Domain Extension Should not Empty\n");
              return false;
         } else if ( DomainType.length == 1 ) {
		 	  window.alert("Minimum Extension Length should be 2 character\n");
			  return false;
	     }
		 
          for ( var i = 0 ; i < DomainType.length ;i++ ) {
                ch = DomainType.substring(i,i+1)  
          if ( ch === " " ) {
		  			window.alert("Invalid Domain Extension, Should not contain any blank space\n");
					return false;
  		  } else if ( ch === "." && i == 0 ) {
                         window.alert("Invalid Domain Extension, \".\" Character Should not be a first Character\n");
                         return false;
                  }else if( !(ch >= "a" && ch <="z") && ch != "." ) {
                          window.alert("Invalid Domain Extension, Should contain A-Z char's only\n");
                          return false;
                  }else if( ch == "'" ) {
			  window.alert("Invalid Domain Extension, Should contain A-Z char's only\n");
                          return false;
		  }


                  
	   }// end for

  return true;
}

function Correct_InstaPassword( DomainName, InstaPassword ) {
     

	DomainName = DomainName.toLowerCase();
	InstaPassword = InstaPassword.toLowerCase();



	if ( InstaPassword.length < 5 || InstaPassword.length > 14 ) {
                window.alert("Invalide InstaPassword, Should contain 5 to 14 digits \n");
		return false;

        }
        if ( InstaPassword.indexOf(" ") != -1 ) {
		window.alert("Password Field should not contain space's");
	        return false;
        }

        if ( InstaPassword.indexOf("'") != -1 ) {
		window.alert("Password Field should not contain single colon (')");
	        return false;
        }

        if ( InstaPassword === DomainName ) {
                window.alert("Password Should Not Same as Domain Name\n");
                return false;
         }
  return true;

}

