/**
 *	@author Alex01
**/
		function Select_Value_Set(SelectName, Value) {
			eval('SelectObject = document.' + SelectName + ';');
		  	for(index = 0; index < SelectObject.length; index++) {
			   	if(SelectObject[index].value == Value)
			    	SelectObject.selectedIndex = index;
		   	}
		}

		function emailvalidation(entered, alertbox){
			if(entered.length>3){
				reXp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
				if(reXp.test(entered)==false){
					if (alertbox) {
						document.getElementById('errmsg').innerHTML = alertbox;
					}
					return false;
				}else {
					return true;
				}
			}else{
				return false;
			}
		} 	
		function urlvalidation(entered, alertbox){
			with (entered){
				reXp = /^http:\/\/[a-zA-Z]{2,}.*(\.\w{2,3})$/;
				if(reXp.test(value)==false){
					if (alertbox) {
						document.getElementById('errmsg').innerHTML = alertbox;
					}
					return false;
				}else {
					return true;
				}
			}
		} 	
		function userNameValidation(entered, alertbox){
			with (entered){
				reXp = /^([a-zA-Z0-9]{1})\w{3,23}([a-zA-Z0-9]{1})$/;
				if(reXp.test(value)==false){
					if (alertbox) {
						document.getElementById('errmsg').innerHTML = alertbox;
					}
					return false;
				}else {
					return true;
				}
			}
		} 	
		function passwordValidation(entered, confirmp, alertbox){
			with (entered){
				reXp = /[\W\w]{5,25}/;
				if(reXp.test(value)==false){
					if (alertbox) {
						document.getElementById('errmsg').innerHTML = alertbox;
					}
					return false;
				}else{
					if(value==confirmp.value){
						return true;
					}else{
						if (alertbox) {
							document.getElementById('errmsg').innerHTML = "Password and Confirm Password Does Not Match";
						}
						return false;
					}
				}
			}
		}
		function getIndx(){
			document.getElementById('indx').value = document.getElementById('country').selectedIndex;
		}
		function formvalidation(thisform){
			with (thisform){
				if(FName.value.length<3){
					FName.focus();
					document.getElementById('errmsg').innerHTML = "Invalid FirstName";
					return false;
				}
				if(LName.value.length<3){
					LName.focus();
					document.getElementById('errmsg').innerHTML = "Invalid LastName";
					return false;
				}
				var emailAdd = emailAddress.value;
				if (emailAddress.value.length > 3) {
					if (emailvalidation(emailAdd, "Invalid E-mail Address") == false) {
						emailAddress.focus();
						return false;
					}
				}else{
					emailAddress.focus();
					document.getElementById('errmsg').innerHTML = "Invalid E-mail Address";
					return false;
				}
				if(companyName.value.length<3){
					companyName.focus();
					document.getElementById('errmsg').innerHTML = "Invalid companyName";
					return false;
				}
				if(document.getElementById('position').selectedIndex==0){
					document.getElementById('position').focus();
					document.getElementById('errmsg').innerHTML = "Invalid Selected Position";
					return false;
				}

				if(document.getElementById('country').selectedIndex==0){
					document.getElementById('country').focus();
					document.getElementById('errmsg').innerHTML = "Invalid Selected Country";
					return false;
				}
				if(captcha.value.length<5){
					captcha.focus();
					document.getElementById('errmsg').innerHTML = "Invalid Entry";
					return false;
				}
			}
		}

