	function mediacns(pagename){
		mediacns_window=window.open(pagename,'mediacns_window','toolbar=no,location=no,borders=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=0,width=874,height=610');
	}

function go_gt(){

if(document.gt_form.event_name.options[document.gt_form.event_name.selectedIndex].value==0){
	alert("Please select an event to get tickets");
	}else{
window.location=document.gt_form.event_name.options[document.gt_form.event_name.selectedIndex].value;
	}

}


	function test(obj,msg) {
		  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
		  if (regex.test(obj.value))
		  {
			return true;
		  }
		  else{
			alert(msg);
			obj.focus();
			return false;
		  }
		}
	function checkint(obj,msg)
	{
	 if(isNaN(obj.value))
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	function checkempty(obj,msg)
	{
	 if(obj.value=="" || obj.value=="NULL")
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
	function check_spaces_in_string(obj,msg){
		if(obj.search(' ')!=-1){
		alert(msg);
		return false;
		}
	}
	
	function checklength(obj,rlen,msg)
	{
	 if(obj.value.length<rlen)
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
	
	
function checkpassword(obj,obj1,msg)
	{
	 if(obj.value!=obj1.value)
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
	
	function checkboxcheck(obj,msg)
	{
	 if(!obj.checked)
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
function check_special(field,msg){
var obj = field.value;
var iChars = "*|,\":<>[]{}`\';()@&$#% -";
for (var i = 0; i < obj.length; i++) {
if (iChars.indexOf(obj.charAt(i)) != -1){
alert(msg);
return false;
}
}
}

function check_regform()
	{
		
		
		if (checkempty(document.reg_form.name,"Type your first name")==false) return false;
		if (checkempty(document.reg_form.lastname,"Type your last name")==false) return false;
     	if (checkempty(document.reg_form.username,"Type your user name")==false) return false;
		if (checklength(document.reg_form.username, 6, "Minimum user name length is 6")==false) return false;
		if (check_special(document.reg_form.username,"Special characters and spaces are not allowed in user name, please user a-z and 0-9")==false) return false;
		
		
		if (checkempty(document.reg_form.pass,"Please enter a password")==false) return false;
		if (checklength(document.reg_form.pass, 6, "Minimum password length is 6")==false) return false;
		if (checkpassword(document.reg_form.pass,document.reg_form.conpass,"Passwords doesn't match, enter same passwords")==false) return false;
        if (checkempty(document.reg_form.pass_question,"Type your password question")==false) return false;
        if (checkempty(document.reg_form.pass_ans,"Type your password answer")==false) return false;
        //if (checkempty(document.signup_form.scode,"Please Enter displayed Security Code")==false) return false;	
return true;

	}
	
	
	function check_forgetpass()
	{
		
		
		if(document.reg_form.email.value=="" || document.reg_form.email.value=="NULL"){
			
			
		if (checkempty(document.reg_form.user_name,"Type user name")==false) return false;
		if (checkempty(document.reg_form.password_question,"Type password question")==false) return false;
     	if (checkempty(document.reg_form.password_answer,"Type password")==false) return false;
		
			
		}else{
			if (test(document.reg_form.email,"Please enter valid email address")==false) return false;
			}
		
return true;

	}
	
	
		function check_forgetusername(){
	
		if (test(document.reg_form.email,"Please enter valid email address")==false) return false;
return true;

	}
	
	
	
	function check_change_forgetpass()
	{
		
		if (checkempty(document.reg_form.newpassword,"Please enter a password")==false) return false;
		if (checkempty(document.reg_form.password_confirm, "Minimum confirm password")==false) return false;
		if (checkpassword(document.reg_form.newpassword,document.reg_form.password_confirm,"Both passwords doesn't match, enter same passwords")==false) return false;
		
		
		
return true;

	}



<!--
function animationdiv(id){
document.getElementById(id).style.visibility="visible"
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->



//----------------------------------------
//---------------------------------------
// 	auto tab function
//------------------------------------------
//-------------------------------------------


var isNN = (navigator.appName.indexOf("Netscape")!=-1);

function autoTab(input,len, e) {
  var keyCode = (isNN) ? e.which : e.keyCode; 
  var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
  if(input.value.length >= len && !containsElement(filter,keyCode)) {
    input.value = input.value.slice(0, len);
    input.form[(getIndex(input)+1) % input.form.length].focus();
  }

  function containsElement(arr, ele) {
    var found = false, index = 0;
    while(!found && index < arr.length)
    if(arr[index] == ele)
    found = true;
    else
    index++;
    return found;
  }

  function getIndex(input) {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
    if (input.form[i] == input)index = i;
    else i++;
    return index;
  }
  return true;
}

