function changeState(element,key) {
	img=document.getElementById('img_'+element+'_'+key);
	item=EVAL('value_'+element+'['+key+']');
	state=1;
	switch (state) {
		case '1' :
		img.src="/images/checkbox/7.gif";
		break;
		default :
		img.src="/images/checkbox/7.gif";
	}		
}

	var	disableOnClick=false;

function CheckBoxGroup (name,init,type) {
	var	name;
	var checkboxs;
	var	init;
	var current;
	var count=0;
	this.name=name;
	this.init=init;
	this.type=type;
	this.checkboxs=new Array();
	this.count=0;
	element=document.getElementById(this.name); //get the associated hidden data field
	this.init=element.value;
	
this.addBox = function(name) {
		if (this.init==name && this.type=='single'  ) {
			cb=new CheckBox(name,1,this.type);
		} else if ( this.type=='single') {
			cb=new CheckBox(name,0,this.type);
		} else {
			cb=new CheckBox(name,this.init,this.type);			
		}
		this.checkboxs[this.count]=cb;
		this.count++;
		img=document.getElementById('img_'+this.name+'_'+name); //get the associated images
		img.src=cb.displayState(this.type);
}
	
this.onClick= function (name,img) {
		
		if (this.type=='single') {
		
			//if(fullpass){
				//return false;
			//}
			
			formObj=document.frmRegForm;
				
			if (disableOnClick) {
				//alert ('Changes to registration type are not allowed on confirmed bookings');
				return false;
			}
			element=document.getElementById(this.name); //get the associated hidden data field
			for(i=0;i<this.checkboxs.length;i++){
				cb=this.checkboxs[i];
				if (cb.getName()==name) {
					image=document.getElementById('img_'+this.name+'_'+cb.getName()); //get the associated hidden image
					image.src=cb.setState(1);
					element.value=name;
				} 
				else {
					image=document.getElementById('img_'+this.name+'_'+cb.getName()); //get the associated hidden image
					image.src=cb.setState(0);
				}
			} //for loop
			
			//if ((eval('formObj.field2.value.indexOf("<Mon1Mon>")!=-1')) {
			//}
		} else {
			if(typeof formObj.field2!='undefined'){
			//alert(formObj.field2.value.indexOf("<Wed1Wed>"));
			if((formObj.field2.value.indexOf("<Mon1Mon>")!=-1&&formObj.field2.value.indexOf("<Tue1Tue>")!=-1&&name=='Wed')||(formObj.field2.value.indexOf("<Mon1Mon>")!=-1&&formObj.field2.value.indexOf("<Wed1Wed>")!=-1&&name=='Tue')||(formObj.field2.value.indexOf("<Wed1Wed>")!=-1&&formObj.field2.value.indexOf("<Tue1Tue>")!=-1&&name=='Mon')){
			alert ('You can choose only two days');
				return false;
			}
			}
			
			this.current='';
			for(i=0;i<this.checkboxs.length;i++){
				cb=this.checkboxs[i];
				if (cb.getName()==name) {
					img.src=cb.toggleState();
				} //endif
				this.current=this.current+cb.Encode();
			} //for loop
			element=document.getElementById(this.name); //get the associated hidden data field
			
			element.value=this.current;
			
			
			
		}		
		evaluateForm();
}
	
this.Clear = function() {
		var result;
		result=false;
		this.current='';
		for(i=0;i<this.checkboxs.length;i++) {
			cb=this.checkboxs[i];
			image=document.getElementById('img_'+this.name+'_'+cb.getName()); //get the associated hidden image
			image.src=cb.setState(0);
		} //for loop
		element=document.getElementById(this.name); //get the associated hidden data field
		element.value=this.current;
		return result;
}
	
this.SetState = function(index,state) {
		var result;
		result=false;
		this.current='';
		cb=this.checkboxs[index];
		image=document.getElementById('img_'+this.name+'_'+cb.getName()); //get the associated hidden image
		image.src=cb.setState(state);
		element=document.getElementById(this.name); //get the associated hidden data field
		element.value=this.current;
		return result;
}
	
this.exportState =function() {
		for(i=0;i<this.checkboxs.length;i++){
			cb=this.checkboxs[i];
		} //for loop
		return this.current;
}

this.isAnySelected =function () {
		var result;
		result=false;
		for(i=0;i<this.checkboxs.length;i++) {
			cb=this.checkboxs[i];
			if (cb.isSelected()) { result=true; }
		} //for loop
		return result;
}
	
this.getState = function(name) {
	return this.current;
}	


}  // end onject/function checkbok group



function setElementValue(name,value) {
		if (element=document.getElementById(name)) { //get the associated hidden data field
			element.value=value;
			return true;
		}
			return false;
}



function CheckBox (name,data,type) {
	
	var name;
	var	init=null;
	var	current=null;
	this.name=name;
	if ((data !='') && type !='single') {
		zero=data.indexOf('<'+this.name+'0'+this.name+'>');
		one=data.indexOf('<'+this.name+'1'+this.name+'>');
		if (zero>=0) {
			this.init=0;
		} else if (one>=0) {
			this.init=1;
		}	
		this.current=this.init;
	}
	if ((data !='') && type =='single') {
		if (data=='1') {
			this.init=1;
		} else {
			this.init=0;
		}	
		this.current=this.init;
	}

this.Decode =function(data) {
	//return this.current;
}
this.isSelected =function() {
	return this.current;
}
	
this.getName = function() {
	return this.name;
}	

this.Encode=function() {
	if (this.current==null) this.current=0;
	return '<'+cb.getName()+''+this.current+''+cb.getName()+'>'
}	
this.toggleState=function() {
	if (this.current==1) {
		this.current=0;
	} else {
		this.current=1;		
	}
	return this.displayState();
}

this.setState= function(state) {
		this.current=state;
		return this.displayState();
}
this.displayState=function() {
	if (this.init==null) {
		if (this.current==1) {
		 	return "/images/checkbox/2.gif";
		} else {
		 	return "/images/checkbox/1.gif";			
		}	 			
	} else if (this.current==this.init) {
		// basic image on or off
		if (this.current==1) {
		 	return "/images/checkbox/2.gif";
		} else {
		 	return "/images/checkbox/1.gif";			
		}
	} else { // state has changed show current state but with a red border
		if (this.current==1) {
		 	return "/images/checkbox/7.gif";
		} else {
		 	return "/images/checkbox/10.gif";			
		}
	}
}
		
		} // end checkbox



function fillcombos(form) {
}
// this function should be called whenever the form is be be evaluated dynamically

function inArray(array,value) {
return (array.toString().indexOf(value) != -1);
} 

function evaluateForm() {
	var item;
	var value=0;
	var bNoWorkShop
	formObj=document.frmRegForm;
	value=formObj.categoryid.value;
	item=level0[value];
	if (item) {
		changehtml("morepricedetail",item["morepricedetail"]);
		changehtml("catprice","&#0036;"+item["catprice"]);
		
		if(item['id']=='6697'){		
			viewState("id_dp2","none");
			viewState("id_productid_5674","block");
			viewState("id_productid_5675","block");
			viewState("id_productid_5676","block");		
		}else{
			viewState("id_dp2","block");
			formObj.productid_5674[0].checked=false;
			formObj.productid_5675[0].checked=false;
			formObj.productid_5676[0].checked=false;
			viewState("id_productid_5674","none");
			viewState("id_productid_5675","none");
			viewState("id_productid_5676","none");
		}
	
		if(item['id']==6914){
		viewState("id_dp2","none");
		}else if(item['id']!='6697'){
		viewState("id_dp2","block");
		}
		
		/*
		// categories who cannot see workshops
		bNoWorkShop = (item['id']=='6031' || item['id']=='5888' || item['id']=='5889' || item['id']=='5890'|| item['id']=='5979' || item['id']=='5988'|| item['id']=='6020');
		
		// slide workshops if required
		if (bNoWorkShop && bWorkshopOut) {
			showHideWorkshops(false);			
		}
		else if (!bNoWorkShop && !bWorkshopOut) {
			showHideWorkshops(true);
		}		
		
		
		// show / hide vouchers if required
		if (item['id']=='4282' && !bVoucherOut) {
			showHideVoucher(true);
		}	
		else if (item['id']!='4282' && bVoucherOut) {
			showHideVoucher(false);
			formObj.vouchercode.value='';
			frmRegForm.voucherValid.value='';
			getObj('vouchercode').disabled = false;			
			if (getObj('voucher_<?=TICKET_PRODUCT?>')) {
				getObj('voucher_<?=TICKET_PRODUCT?>').value='';
			}
			if (getObj('couponid_<?=TICKET_PRODUCT?>')) {
				getObj('couponid_<?=TICKET_PRODUCT?>').value='';
			}			
			txValidate.innerHTML='<button id="btVoucherSubmit" class="smallnormal" type="button" onmouseover="this.className=\'btSmallOver\';"  onmousedown="this.className=\'btSmallDown\';" onmouseup="this.className=\'btSmallOver\';" onmouseout="this.className=\'smallnormal\';" onClick="doVoucher();" >Validate</button>';
		}
		*/			
	}

	if (false) {
		style=item["style"];
		if (item["p2"]=="") {
			setstyle("three");		
		} 
		else {
			setstyle("one");		
		}
		changehtml("price1",item["p1"]);
		changehtml("price2",item["p2"]);
		changehtml("price3",item["p3"]);
		changehtml("price4",item["p4"]);
		changehtml("price5",item["p5"]);
		//changehtml("price6",item["p6"]);
		changehtml("price7",item["p7"]);
		//changehtml("price7",item["p7"]);
		viewState("D1",true);
		viewState("D2",false);
	}
		
}

function changehtml(idname,text) {
	//
	if (element=document.getElementById(idname)) {
		if (text=="0") {
			element.innerHTML = "FREE";		
		} else if (text=="") {
			element.innerHTML = "NA";				
		} else {
			element.innerHTML = text;
		}
	}
}

function buttonSubmit(button,formObj,result) {
	
	if (result===true) {
		
		button.innerHTML ='Please wait...';
		button.disabled=true;		
		formObj.submit();
	} 
	else {
		//alert ('result of validation not true')	
	}
}

function setstyle(days) {

	switch (days) {
		case 'three':
			form.oneday.checked = false;		
			form.oneday.disabled = true;		
			form.threeday.checked = true;		
			form.threeday.disabled = true;		
			form.day1.checked = true;		
			form.day1.disabled = true;		
			form.day2.checked = true;		
			form.day2.disabled = true;		
			form.day3.checked = true;		
			form.day3.disabled = true;		
		
		break;
		default:
			form.oneday.disabled = false;		
			form.threeday.disabled = false;		
			form.day1.disabled = false;		
			form.day2.disabled = false;		
			form.day3.disabled = false;		
		break;
	}

}

function Selectable (name,checked) {
	this.name=name;
	this.checked=checked;
}

function viewState (childname,state) {
  var browser = detect_ie();   
   	if (element = document.getElementById(childname)) {	
		if(state=='block'){
			  if(browser == true) {    
				element.style.display = 'block';
			  } else {
				element.style.display = 'table-row';
			  }
		}
		else{
			element.style.display = state;
		}		
	}
}

function detect_ie() {
    if (navigator.appName.indexOf('Microsoft') != -1) {
      return true;
    } else {
      return false;
    }
 } 



Selectable.prototype.IsSelected = function() {
	return this.selected;	
}

var day1 = new Selectable('day1',false);
var day2 = new Selectable('day2',false);
var day3 = new Selectable('day3',false);
var oneday = new Selectable('oneday',false);
var threeday = new Selectable('threeday',false);

// generic isvalid function changes use based on name of form
// use framework for all formsbased on name of form

function isFormValid(formObj,eventnumber) {
	var prompt ="";
	switch (formObj.name) {
		case 'frmRegForm' :
			prompt=ValidateForm(formObj,eventnumber);
		break;
		case 'frmCheckout' :
			prompt=validateCheckoutForm(formObj,eventnumber);
		break;
		case 'frmHotelCheckout' :
			prompt=validateHotelCheckoutForm(formObj,eventnumber);
		break;
		case 'frmUnlock' :
			prompt=validateUnlockForm(formObj,eventnumber);
		break;
		case 'frmStatementAddress' :
			prompt=validateStatementAddress(formObj,eventnumber);
		break;	
		case 'frmNoBIC' :
			prompt=validateInviteRequest(formObj,eventnumber);
		break;	
		default :
			prompt= 'function to validate form not found, proceed? '+formObj.name;
		break	
	} // switch
	if (prompt) {
		alert(convertChars(prompt));
		return false;
	} else {
		if (eventnumber != "" ) formObj.event.value=eventnumber; // set the exit event
		return true;
	}
}

function isABN (str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return ( false );
  var r2 = new RegExp("ABNA", "i");
  if (r2.test(str)) {
  return (true);
  }
  return ( false );
}

function isBARC (str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return ( false );
  var r2 = new RegExp("BARC", "i");
  if (r2.test(str)) {
  return (true);
  }
  return ( false );
}

function validateUsername(formObj,username) {
	var prompt="";
	if ( formObj.bic8.value =="" ) prompt=prompt +"BIC or PIC Code is a required field"+"\n";
	if ( username =="" ) prompt=prompt +"E-mail Address is a required field"+"\n";
	if ( !validateemail(username) ) prompt=prompt +"E-mail Address is not a valid E-mail address format"+"\n";
	if (prompt) {
		alert(convertChars(prompt));
		return false;
	} else {
		return true;
	}
}

function validateInviteRequest(formObj,eventnumber){
	var prompt="";
	if ( formObj.firstname.value =="" ) prompt=prompt +"First name is a required field"+"\n";
	if ( formObj.lastname.value =="" ) prompt=prompt +"Last name is a required field"+"\n";
	if ( formObj.company.value =="" ) prompt=prompt +"Institution is a required field"+"\n";
	if ( formObj.email.value =="" ) prompt=prompt +"E-mail Address is a required field"+"\n";
	if ( !validateemail(formObj.email.value) ) prompt=prompt +"E-mail Address is not a valid E-mail address format"+"\n";
	return (prompt);
}

function validateStatementAddress (formObj,eventnumber) {
		var prompt="";
	if (element=document.getElementById('StatementAddressSection1')) {
		element.value="1";  //enable this section during save
		if ( formObj.title.value =="" ) prompt=prompt +"Title (Mr, Mrs..) is a required field"+"\n";
		if ( formObj.firstname.value =="" ) prompt=prompt +"First Name is a required field"+"\n";
		if ( formObj.lastname.value =="" ) prompt=prompt +"Last Name is a required field"+"\n";
		if ( formObj.phone1.value =="" ) prompt=prompt +"Phone is a required field"+"\n";
		if ( formObj.email.value =="" ) prompt=prompt +"E-mail Address is a required field"+"\n";
		if ( !validateemail(formObj.email.value) ) prompt=prompt +"E-mail Address is not a valid E-mail address format"+"\n";
		if ( formObj.company.value =="" ) prompt=prompt +"Company Name is a required field"+"\n";
		if ( formObj.address1.value =="" ) prompt=prompt +"Address1 is a required field"+"\n";
		if ( formObj.city.value =="" ) prompt=prompt +"City is a required field"+"\n";
		if ( formObj.postcode.value =="" ) prompt=prompt +"Postcode is a required field"+"\n";
		if ( formObj.countryname.options[formObj.countryname.selectedIndex].value=="" ) prompt=prompt +"Country is a required field"+"\n";
		return prompt;
	}
	if ( (element=document.getElementById('StatementAddressSection2'))  ) {
		if  (!(formObj.firstname_1.value+formObj.lastname_1.value+formObj.company_1.value+formObj.address1_1.value+formObj.city_1.value+formObj.postcode_1.value==""))  {
			element.value="1";  //enable this section during save
			if ( formObj.firstname_1.value =="" ) prompt=prompt +"Invoice first name is a required field"+"\n";
			if ( formObj.lastname_1.value =="" ) prompt=prompt +"Invoice last name is a required field"+"\n";
			if ( formObj.company_1.value =="" ) prompt=prompt +"Invoice company Name is a required field"+"\n";
			if ( formObj.address1_1.value =="" ) prompt=prompt +"Invoice address1 is a required field"+"\n";
			if ( formObj.city_1.value =="" ) prompt=prompt +"Invoice city is a required field"+"\n";
			if ( formObj.postcode_1.value =="" ) prompt=prompt +"Invoice postcode is a required field"+"\n";
			if ( formObj.countryname_1.options[formObj.countryname_1.selectedIndex].value=="" ) prompt=prompt +"Invoice country is a required field"+"\n";
			if ( formObj.email_1.value =="" ) prompt=prompt +"Invoicecemail address is a required field"+"\n";
			if ( !validateemail(formObj.email_1.value) ) prompt=prompt +"Invoice email address is not a valid E-mail address format"+"\n";
		} else {
			element.value="0";  //disable this section during save
		}
	} 
//	if ( (element=document.getElementById('StatementAddressSection3'))  ) {
//		element.value="1";  //enable this section during save
//		if  (!(formObj.address1_2.value+formObj.city_2.value+formObj.postcode_2.value+formObj.payDevice.value==""))  {
//			prompt=validateCheckoutForm(formObj,eventnumber)
//			if ( formObj.address1_2.value =="" ) prompt=prompt +"Card address1 is a required field"+"\n";
//			if ( formObj.city_2.value =="" ) prompt=prompt +"Card city is a required field"+"\n";
//			if ( formObj.postcode_2.value =="" ) prompt=prompt +"Card postcode is a required field"+"\n";
//			if ( formObj.countryname_2.options[formObj.countryname_2.selectedIndex].value=="" ) prompt=prompt +"Card country is a required field"+"\n";
//		} else {
//			element.value="0";  //disable this section during save
//		}
//	} 
	return prompt;
}


function validateUnlockForm (formObj,eventnumber) {
	if ( (formObj.unlock.value=="") && (formObj.unlock.value.length!=5) )  return 'Enter a valid unlock Code';
}

	function isAnySessionSelected(item)  {
		var result;
		window.alert(item);
		result = item.indexOf(">1<"); // look for selected settions
		alert(result);
	}
	
	var bRTC = false;				
	var	bAllowCookies=false;
	
	function doTerms(srcimage,state,terms) {
		if (terms!='') bigpopupwindow(terms,true);
		setCookie("bReadTC","Y");
		bRTC = state;
		if (state) {
			document.getElementById(srcimage).src = "/images/checkbox/7.gif";
		} else {
			document.getElementById(srcimage).src = "/images/checkbox/1.gif";		
		}
		return false;	
	} // doTerms
	
	function toggleHidden (childname) {
	    element = document.getElementById(childname);
	    element.style.display = (element.style.display == "none") ? "" : "none";
	}
	
	function validateReadTerms(frm,event) {	
		var prompt="";
		if (!bRTC) {
			prompt=prompt+ 'Please ensure you have read the Terms and Conditions'+"\n";
		}
		if (prompt) {
			alert(convertChars(prompt));
			return false;
		} else {
			return true;
		}
	}
	var	bCheckcv2;
	var bCheckcv2=1;
	function validateCheckoutForm(frm,event) {	
	var	bCheckcv2;
	var bCheckcv2=1;
		var prompt="";
			
		if (frm.payType.value=="Cheque" || frm.payType.value=="EFT") {
			//if (frm.poNumber.value=='') {
				//return 'A reference or PO number must be specified'+"\n";
			//}
		}
		if (frm.payType.value=="Free") {
		}
		if (frm.payType.value=="MyCard") {
		}
		if (frm.payType.value=='CreditCard') {
			if (frm.payMethod.selectedIndex=='0') {
				 prompt=prompt+ 'A card type must be selected'+"\n" ;
			}
			now = new Date();		
			endDate = new Date(frm.endYear.options[frm.endYear.selectedIndex].value,frm.endMonth.options[frm.endMonth.selectedIndex].value);
			if (now > endDate) {
				prompt=prompt+ 'Credit card has expired'+"\n";
			}
			
			if (frm.cardName.value.length<2) {
				 prompt=prompt+ 'Credit card name not supplied'+"\n" ;
			}
			if ( bCheckcv2 && (frm.cv2.value.length<3) && (frm.payMethod.value!='swch')) {
				 prompt=prompt+ 'The security code is required'+"\n" ;
			}
			//if ( (frm.postcode_2.value.length<3) ) {
			//	 prompt=prompt+ 'A cardholder address is required'+"\n" ;
			//}

			if ( frm.address1_2.value =="" ) prompt=prompt +"A cardholder address is required"+"\n";
			if ( frm.city_2.value =="" ) prompt=prompt +"A cardholder city is required"+"\n";
			if (frm.countryname_2.selectedIndex=='0') {
				prompt=prompt+ 'A cardholder country is required'+"\n" ;
			}
			
			if (frm.payMethod.value=='swch') {
				// validate switch stuff
				if (frm.issueNumber.value=='' || !isFinite(frm.issueNumber.value)) {
					 //prompt=prompt+ 'A SWITCH card requires a valid issue number'+"\n";
				}	
				startDate = new Date(frm.startYear.options[frm.startYear.selectedIndex].value,frm.startMonth.options[frm.startMonth.selectedIndex].value);
				if (startDate >= endDate) {
					 prompt=prompt+ 'SWITCH card requires a valid from date'+"\n";
				} // if				
			} // if switch
			if (!isValidCardNumber(frm.payDevice.value)) {
				 prompt=prompt+ 'Invalid credit card number (length and format)'+"\n";
			}		
		} // if creditcard
		return prompt;	

} // validateCheckoutForm	


function validateHotelCheckoutForm(frm,event) {	
		var prompt="";
			
		//Always a credit card
			if (frm.payMethod.selectedIndex=='0') {
				 prompt=prompt+ 'A card type must be selected'+"\n" ;
			}
			now = new Date();		
			endDate = new Date(frm.endYear.options[frm.endYear.selectedIndex].value,frm.endMonth.options[frm.endMonth.selectedIndex].value);
			if (now > endDate) {
				prompt=prompt+ 'Credit card has expired'+"\n";
			}
			
			if (frm.cardName.value.length<2) {
				 prompt=prompt+ 'Credit card name not supplied'+"\n" ;
			}
			if ( bCheckcv2 && (frm.cv2.value.length<3) && (frm.payMethod.value!='swch')) {
				 prompt=prompt+ 'The security code is required'+"\n" ;
			}

		
			if (frm.payMethod.value=='swch') {
				// validate switch stuff
				if (frm.issueNumber.value=='' || !isFinite(frm.issueNumber.value)) {
					 //prompt=prompt+ 'A SWITCH card requires a valid issue number'+"\n";
				}	
				startDate = new Date(frm.startYear.options[frm.startYear.selectedIndex].value,frm.startMonth.options[frm.startMonth.selectedIndex].value);
				if (startDate >= endDate) {
					 prompt=prompt+ 'SWITCH card requires a valid from date'+"\n";
				} // if				
			} // if switch
			if (!isValidCardNumber(frm.payDevice.value)) {
				 prompt=prompt+ 'Invalid credit card number (length and format)'+"\n";
			}
			
			var checked1=false;  
			for (var i = 0; i < frm.HOTEL_DECHAR2.length; i++ ) { 
			if (frm.HOTEL_DECHAR2[i].checked==true) { 
			checked1=true; 
		}   
	}  
	if (!(checked1) ) prompt=prompt +"Smoking is a mandatory question"+"\n";	
		

		return prompt;	

} // validateHotelCheckoutForm		







function goMainreg(formObj)
{
	var prompt = '';
	if(formObj.SWIFT_DECHAR0.value=='') prompt =prompt + 'Estimated time of Arrival is required field\n';
	if(formObj.SWIFT_DECHAR9.value=='') prompt += 'Date of Arrival is required field\n';
	if(formObj.SWIFT_DECHAR8.value=='') prompt += 'Flight number is required field\n';
	
	if(prompt.length>0)
		alert(prompt);
	else
	{
		document.getElementById('main_registrations').style.display='block';
		document.getElementById('crew_registrations').style.display='none';
	}
}//End function

function goAdminMainreg(formObj)
{
	var prompt = '';
	
	if(prompt.length>0)
		alert(prompt);
	else
	{
		document.getElementById('main_registrations').style.display='block';
		document.getElementById('crew_registrations').style.display='none';
	}
}//End function



function checkCrewDiv(catgoryid, formObj)
{
	if( (catgoryid == 1486 || catgoryid == 1516) && (formObj.SWIFT_DECHAR0.value=='' || formObj.SWIFT_DECHAR9.value=='' || formObj.SWIFT_DECHAR8.value==''))
	{
		
		document.getElementById('main_registrations').style.display='none';
		document.getElementById('crew_registrations').style.display='block';
	}
	else
	{
		
		document.getElementById('main_registrations').style.display='block';
		document.getElementById('crew_registrations').style.display='none';
	}//End if
}//End function






function copyCardholder(formObj,state) {
	if (state) {
		formObj.address1_2.value=document.myaddress.address1.value;
		formObj.address2_2.value=document.myaddress.address2.value;
		formObj.city_2.value=document.myaddress.city.value;
		formObj.county_2.value=document.myaddress.county.value;
		formObj.postcode_2.value=document.myaddress.postcode.value;
		formObj.countryname_2.value=document.myaddress.countryname.value;
	} else {
		formObj.address1_2.value=document.cardholderaddress.address1.value;
		formObj.address2_2.value=document.cardholderaddress.address2.value;
		formObj.city_2.value=document.cardholderaddress.city.value;
		formObj.county_2.value=document.cardholderaddress.county.value;
		formObj.postcode_2.value=document.cardholderaddress.postcode.value;
		formObj.countryname_2.value=document.cardholderaddress.countryname.value;
	}
	
}
