// by DA studio - http://www.dastudio.biz
//function valid login
function valid_login()
	{
	var form=document.getElementById('loginform');
	var Username=form.Username.value;
	var Pass=form.Pass.value;
	if (Username.length==0 || Pass.length==0 ) {
		
		document.getElementById('Username').className='txt';
		document.getElementById('Pass').className='txt';
	

		var alertmsg='';
		
		if (Username.length==0) {
			document.getElementById('Username').className='txt Error';
			alertmsg=alertmsg+'- please enter your Username\n';
		}
		if (Pass.length==0) {
			document.getElementById('Pass').className='txt Error';
			alertmsg=alertmsg+'- please enter your Password\n';
		}
		
		alert(alertmsg);
		
	}		
	else {

		form.submit();

	}
	}//end function valid login
function contactCheck(keystr) {
	var form=document.getElementById('formular');
	
	var Name=form.Name.value;
	var Email=form.Email.value;
	var Comment=form.Comment.value;	
	var Security=form.Security.value;	
	//alert(keystr);
	email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw))$/;

	if (Email.length==0 || !email.test(Email) || Name.length==0 || Comment.length==0 || Security.length==0) {
		document.getElementById('Email').className='txt';
		document.getElementById('Name').className='txt';
		document.getElementById('Comment').className='';
		document.getElementById('Security').className='stxt';
		var alertmsg='';
		
		if (Name.length==0) {
			document.getElementById('Name').className='txt Error';
			alertmsg=alertmsg+'- please enter your name\n';
		}
		if(Email.length==0 || !email.test(Email)) {
			document.getElementById('Email').className='txt Error';
			alertmsg=alertmsg+'- please enter a valid email address\n';
		}		
		if (Comment.length==0) {
			document.getElementById('Comment').className='Error';
			alertmsg=alertmsg+'- please enter your comment\n';
		}
		if (Security.length==0 || Security!=keystr ) {
			document.getElementById('Security').className='stxt Error';
			alertmsg=alertmsg+'- please enter the valid security code\n';
		}
		alert(alertmsg);
	}		
	else {
		form.submit();
	}
}


function registerCheck(keystr) {
	var form=document.getElementById('formular');
	
	var twit_name=form.twit_name.value;
	var password=form.password.value;	
	var pass_rep=form.pass_repeat.value;	
	var keyv=form.key.value;	

	var Email=form.email.value;
	var zip=form.zip.value;	
	var phone=form.phone.value;	
	var agreevalue=form.agree.value;	
	email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw))$/;

	
		document.getElementById('twit_name').className='txt';
		document.getElementById('password').className='txt';
		document.getElementById('zip').className='txt';
		document.getElementById('email').className='txt';
		document.getElementById('phone').className='txt';
		document.getElementById('key').className='txt';
		document.getElementById('pass_repeat').className='txt';
		var alertmsg='';
		
		if (twit_name.length==0) {
			document.getElementById('twit_name').className='txt Error';
			alertmsg=alertmsg+'- please enter your login name\n';
		}
		if (password.length==0) {
			document.getElementById('password').className='txt Error';
			alertmsg=alertmsg+'- please enter your password\n';
		}
		if (password != pass_rep ) {
			document.getElementById('pass_repeat').className='txt Error';
			alertmsg=alertmsg+'- please confirm your password\n';
		}
		if(Email.length==0 || !email.test(Email)) {
			document.getElementById('email').className='txt Error';
			alertmsg=alertmsg+'- please enter a valid email address\n';
		}		
		if (zip.length==0) {
			document.getElementById('zip').className='txt Error';
			alertmsg=alertmsg+'- please enter your zip code\n';
		}
		if (isNaN(zip)) {
			document.getElementById('zip').className='txt Error';
			alertmsg=alertmsg+'- Please enter Numeric Zip\n';
		}
		if (phone.length==0) {
			document.getElementById('phone').className='txt Error';
			alertmsg=alertmsg+'- please enter your phone number\n';
		}
		
		if (isNaN(phone)) {
			document.getElementById('phone').className='txt Error';
			alertmsg=alertmsg+'- Please enter Numeric phone number\n';
		}
		if (keyv != keystr) {
			document.getElementById('key').className='txt Error';
			alertmsg=alertmsg+'- Please enter Valid Security Code\n';
		}
if (form.agree.checked != 1) {
			
			alertmsg=alertmsg+'- Please check the box to agree terms and conditions\n';
		}
		
		if(alertmsg!="")
			{
			alert(alertmsg);
		
			}
			
	else {

		form.submit();
	}
}