// Macromedia & 3rd party code - Partnerzone

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function P7_JumpMenu(selObj,restore){ //v1.7 by Project Seven
	var theFullString = selObj.options[selObj.selectedIndex].value;
	if (restore) selObj.selectedIndex=0;
	var theLength = theFullString.length;
	var endPos = theFullString.lastIndexOf("~");
	var theUrl, theTarget, theParent;
	if (endPos > 0) {theUrl = theFullString.substring(0,endPos);}
	else {theUrl = theFullString;}
	endPos++
	if (endPos < theLength) {theTarget = theFullString.substring(endPos,theLength)}
	else {theTarget = "window:Main";}
	if (theTarget == "window:New") {window.open(theUrl,'','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=470');}
	else if (theTarget == "window:Main") {eval("parent.location='"+theUrl+"'");}
	else {eval("parent.frames[\'"+theTarget+"\'].location='"+theUrl+"'");}
}

function tmt_regExpValidator(f,re,eMsg,ru,r){
	var myErr="";var fv=MM_findObj(f).value;var rex=new RegExp(unescape(re));
	var t=eval(ru+rex.test(fv));if(r){if(fv.length<=0||!t){alert(unescape(eMsg));myErr+="eMsg";}}
	else if(fv.length>0&&!t){alert(unescape(eMsg));myErr+="eMsg";}document.MM_returnValue=(myErr=="");
}

// Custom code - reservation of numbers form

function showFormElement(element,status) {
	if (status) {
		document.getElementById(element).style.display="block";
	} else {
		document.getElementById(element).style.display="none";
	}
}
function pnClick(element) {
	if (element.checked) {
		showFormElement("07xx_dyn",1);
	} else {
		showFormElement("07xx_dyn",0);
	}	
}
function prClick(element) {
	if (element.checked) {
		showFormElement("09xx_dyn",1);
		showFormElement("09xx2_dyn",1);
		showFormElement("09xxdropcharge_dyn",1);
		showFormElement("09xxppm_dyn",0);
	} else {
		showFormElement("09xx_dyn",0);
		showFormElement("09xx2_dyn",0);
		showFormElement("09xxdropcharge_dyn",0);
		showFormElement("09xxppm_dyn",0);		
		document.forms.ReservationOfNumbers.DROPCHARGEORPPM.selectedIndex=1;
	}	
}
function dcppmclick(element) {
	if (element.options(element.selectedIndex).value == "1") {
		showFormElement("09xxdropcharge_dyn",1);
		showFormElement("09xxppm_dyn",0);
	} else if(element.options(element.selectedIndex).value == "2"){
		showFormElement("09xxdropcharge_dyn",0);
		showFormElement("09xxppm_dyn",1);
	} else {
		showFormElement("09xxdropcharge_dyn",0);
		showFormElement("09xxppm_dyn",0);	
	}
}