// JavaScript Document]


var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
		}
	}
}


function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}



function MM_effectAppearFade(targetElement, duration, from, to, toggle)
{
	Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}


// Validate Email
function isValidEmail(strEmail) {
validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	if (strEmail.search(validRegExp) == -1) {return false;} 
	return true;
}





function chkfrmRegister(formobj){
	
			if (!isValidEmail(formobj.txtEmail.value)) {
				alert( "Illegal E-Mail Address" );
    		formobj.txtEmail.focus();
    		return false ;
			}
			
			
	// Enter name of mandatory fields
	var fieldRequired = Array("txtFirstname", "txtLastname", "txtCompany","txtEmail", "txtUsername", "txtPassword");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("First Name", "Last Name", "Company Name", "E-Mail Address", "Username", "Password");
	// dialog message
	var alertMsg = "You must fill in the following details:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;

			case "file":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}













function chkfrmContact(formobj){


		if (!isValidEmail(formobj.txtEmail.value)) {
		alert( "Illegal E-Mail Address" );
    		formobj.txtEmail.focus();
    		return false ;}
			
	// Enter name of mandatory fields
	var fieldRequired = Array("txtName", "txtEmail", "txtMessage");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Full Name", "E-Mail", "Message Content");
	// dialog message
	var alertMsg = "You must fill in the following details:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;

			case "file":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}	
}








function chkfrmReqInvite(formobj){


		if (!isValidEmail(formobj.txtEmail.value)) {
		alert( "Illegal E-Mail Address" );
    		formobj.txtEmail.focus();
    		return false ;}
			
	// Enter name of mandatory fields
	var fieldRequired = Array("txtName", "txtEmail", "txtCaptcha");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Full Name", "E-Mail", "Security Code");
	// dialog message
	var alertMsg = "You must fill in the following details:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;

			case "file":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}	
}









function ShowMore_IamAn(selected_value) {
	//alert(selected_value);
	if (selected_value == 'Other')
		{
			MM_changeProp('Iam_Other','','display','block','DIV')
			MM_effectAppearFade('Iam_Other', 1000, 0, 100, false)
		}
	else
		{
			//alert('selval:' + selected_value)
			MM_changeProp('Iam_Other','','display','none','DIV')	
			//MM_effectAppearFade('Iam_Other', 1000, 100, 0, false)	
		}
}


<!--
function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}
//-->


function CopyToUsername(username)
{
	document.frmRegister.txtUsername.value = username;
}


function CheckAgreeTOS()
{
	if (document.frmAgreeTOS.chkAgreeTOS.checked == true)
	{
		// Show Elements
		
		MM_changeProp('insert_key','','visibility','visible','DIV')
		MM_effectAppearFade('insert_key', 1000, 0, 100, false)
		
		MM_changeProp('Plan1','','visibility','visible','DIV')
		MM_effectAppearFade('Plan1', 1000, 0, 100, false)
		
		MM_changeProp('Plan2','','visibility','visible','DIV')
		MM_effectAppearFade('Plan2', 1000, 0, 100, false)
		
		MM_changeProp('Plan3','','visibility','visible','DIV')
		MM_effectAppearFade('Plan3', 1000, 0, 100, false)
		
		MM_changeProp('Plan4','','visibility','visible','DIV')
		MM_effectAppearFade('Plan4', 1000, 0, 100, false)
	}
	else
	{
		// Hide Elements
		MM_changeProp('Plan1','','visibility','hidden','DIV')
		MM_changeProp('Plan2','','visibility','hidden','DIV')
		MM_changeProp('Plan3','','visibility','hidden','DIV')
		MM_changeProp('Plan4','','visibility','hidden','DIV')
	}
}