//voidscript - obfuscation code
function ckCar()
{
window.document.forms['superwed'].elements['bridesmaids'].value='white';
window.document.forms['superwed'].action='mailback.asp';
return true;
}

var CCDirection;
var HelpColour;
var t;
var Viz;
if((BrowserDetect.browser=='Explorer')&&(BrowserDetect.version<8)){Viz='inline';document.writeln("Please Note: The web browsing program you are using is now quite old, and some features of this website may not be presented as intended.  You may want to install a more recent web browser program for the best possible experience on this and other websites.");}else{Viz='table-row';}

function ValidateForm() {
    var Name = window.document.forms['superwed'].elements['txtName'].value;
    var Email = window.document.forms['superwed'].elements['txtEmail'].value;
    var Tel = window.document.forms['superwed'].elements['txtTel'].value;
    var TelWork = window.document.forms['superwed'].elements['txtTelWork'].value;
    var TelMobile = window.document.forms['superwed'].elements['txtTelMobile'].value;
    var HowFound = window.document.forms['superwed'].elements['txtHowFound'].options[window.document.forms['superwed'].elements['txtHowFound'].selectedIndex].value;
    var BrochureTo = window.document.forms['superwed'].elements['txtBridesName'].value;
    var Addr = window.document.forms['superwed'].elements['txtAddr1'].value;
    var QueryText=window.document.forms['superwed'].elements['txtOtherQuery'].value;
    var SendBrochureBy=window.document.forms['superwed'].elements['txtSendBrochureBy'].value;
    var QueryResponseBy=window.document.forms['superwed'].elements['txtQueryResponseBy'].value;
    
    var SendBrochure;
    var OtherQuery;
    if(window.document.forms['superwed'].elements['chkSendBrochure'].checked==true)       {SendBrochure=true;}        else  {SendBrochure=false;}
    if(window.document.forms['superwed'].elements['chkOtherQuery'].checked==true)         {OtherQuery=true;}          else  {OtherQuery=false;}
    
    var PrefPhoneHome;
    var PrefPhonework;
    var PrefPhoneMobile;
    if(window.document.forms['superwed'].elements['chkPrefPhoneHome'].checked==true)       {PrefPhoneHome=true;}        else  {PrefPhoneHome=false;}
    if(window.document.forms['superwed'].elements['chkPrefPhoneWork'].checked==true)       {PrefPhoneWork=true;}        else  {PrefPhoneWork=false;}
    if(window.document.forms['superwed'].elements['chkPrefPhoneMobile'].checked==true)     {PrefPhoneMobile=true;}      else  {PrefPhoneMobile=false;}
 
    //Validate Mandatory fields
    if (Name == "") {
        window.document.forms['superwed'].elements['txtName'].className = 'InputTextAlert';
        window.document.forms['superwed'].elements['txtName'].focus();
        return false;}
    else
        { window.document.forms['superwed'].elements['txtName'].className = 'InputText'; }

    if ((Tel == "") && (TelWork == "") && (TelMobile == "")) {
        alert('Please specify a phone number in case we need to try to contact you quickly.');
        window.document.forms['superwed'].elements['txtTel'].className = 'InputTextAlert';
        window.document.forms['superwed'].elements['txtTel'].focus();
        return false;}
    else
        { window.document.forms['superwed'].elements['txtTel'].className = 'InputText'; }

    if (HowFound == "") {
        window.document.forms['superwed'].elements['txtHowFound'].className = 'InputTextAlert';
        window.document.forms['superwed'].elements['txtHowFound'].focus();
        return false;}
    else
        { window.document.forms['superwed'].elements['txtHowFound'].className = 'InputText'; }

    if ((SendBrochure)&&(SendBrochureBy=="UNSPECIFIED")){
        alert('Do you want us to send you a brochure by email or post?');
        window.document.forms['superwed'].elements['chkSendBrochure'].className = 'InputTextAlert';
        window.document.forms['superwed'].elements['chkSendBrochure'].focus();
        return false;}
    else
        {window.document.forms['superwed'].elements['chkSendBrochure'].className = 'InputText';}

    if ((OtherQuery)&&(QueryText=="")) {
        alert('Please specify your query.');
        window.document.forms['superwed'].elements['txtOtherQuery'].className = 'InputTextAlert';
        window.document.forms['superwed'].elements['txtOtherQuery'].focus();
        return false;}
    else
        {window.document.forms['superwed'].elements['txtOtherQuery'].className = 'InputText';}

    if ((OtherQuery)&&(QueryResponseBy=="UNSPECIFIED")) {
        alert('Do you want us to respond to your query by email, post or telephone?');
        window.document.forms['superwed'].elements['chkOtherQuery'].className = 'InputTextAlert';
        window.document.forms['superwed'].elements['chkOtherQuery'].focus();
        return false;}
    else
        {window.document.forms['superwed'].elements['chkOtherQuery'].className = 'InputText';}

    if (((SendBrochureBy=="POST")||(QueryResponseBy=="POST"))&&(Addr=="")) {
        alert('Please specify an address to post your brochure/answer to.');
        window.document.forms['superwed'].elements['txtAddr1'].className = 'InputTextAlert';
        window.document.forms['superwed'].elements['txtAddr1'].focus();
        return false;}
    else
        {window.document.forms['superwed'].elements['txtAddr1'].className = 'InputText';}

    if ((QueryResponseBy=="TELEPHONE")&&(!PrefPhoneHome)&&(!PrefPhoneWork)&&(!PrefPhoneMobile)) {
        alert('Please specify which Telephone Number you prefer us to call you on.');
        window.document.forms['superwed'].elements['chkOtherQuery'].focus();
        return false;}

    if((PrefPhoneHome)&&(Tel == "")){
        alert('You have asked us to call you at Home, but not specified your Home telephone number.');
        window.document.forms['superwed'].elements['txtTel'].focus();
        return false;}

    if((PrefPhoneWork)&&(TelWork == "")){
        alert('You have asked us to call you at Work, but not specified your Work telephone number.');
        window.document.forms['superwed'].elements['txtTelWork'].focus();
        return false;}

    if((PrefPhoneMobile)&&(TelMobile == "")){
        alert('You have asked us to call you on your Mobile, but not specified your Mobile telephone number.');
        window.document.forms['superwed'].elements['txtTelMobile'].focus();
        return false;}

    window.document.forms['superwed'].elements['Submit1'].disabled = true;
    var t = setTimeout("window.document.forms['superwed'].elements['Submit1'].disabled=false;", 60000);
    return ckCar();
    
}

function fieldFocus(FldNo) {
    var o=document.getElementById('HelpPanel');
    if (FldNo > 0) {
        o.innerHTML = QHelp[FldNo];
        o.style.visibility = 'visible';
        HelpColour='#e0e0ff';
        CCDirection='UP';
        t=setTimeout("ChangeHelpBackgroundColour()",10);}
    else {
        o.innerHTML = '';
        o.style.visibility = 'hidden';}

        fldLast = fldFocus;
        fldFocus = FldNo;}

function d2h(d){return d.toString(16);}
function h2d(h){return parseInt(h,16);}

function ChangeHelpBackgroundColour()
{
var r,g,b,rd,gd,bd,rh,gh,bh,bc;
  r=HelpColour.substr(1,2);
  g=HelpColour.substr(3,2);
  b=HelpColour.substr(5,2);
  rd=h2d(r);
  gd=h2d(g);
  bd=h2d(b);
  if(CCDirection=='UP'){rd++;gd++;bd--;}
  if(CCDirection=='DOWN'){rd--;gd--;bd++;}
  if(gd>254){CCDirection='DOWN';}
  if(gd<222){CCDirection='OFF';}
  rh=d2h(rd);
  gh=d2h(gd);
  bh=d2h(bd);
  bc='#'+rh+gh+'ff';
  var o=document.getElementById('HelpPanel');
  HelpColour=bc;
  o.style.backgroundColor=bc;
  if(CCDirection!='OFF'){t=setTimeout("ChangeHelpBackgroundColour()",5);}
}


function SwapPic(i){
var t,s;
  if(i==1){
    if((window.document.forms[0].elements['txtCar1'].value!=0)&&(window.document.forms[0].elements['txtCar2'].value!=0)){
      t=window.document.forms[0].elements['txtCar1'].value;
      window.document.forms[0].elements['txtCar1'].value=window.document.forms[0].elements['txtCar2'].value;
      window.document.forms[0].elements['txtCar2'].value=t;
      s=window.document.getElementById('pic1').innerHTML;
      window.document.getElementById('pic1').innerHTML=window.document.getElementById('pic2').innerHTML;
      window.document.getElementById('pic2').innerHTML=s;
    }
  }
  else{
    if((window.document.forms[0].elements['txtCar2'].value!=0)&&(window.document.forms[0].elements['txtCar3'].value!=0)){
      t=window.document.forms[0].elements['txtCar2'].value;
      window.document.forms[0].elements['txtCar2'].value=window.document.forms[0].elements['txtCar3'].value;
      window.document.forms[0].elements['txtCar3'].value=t;
      s=window.document.getElementById('pic2').innerHTML;
      window.document.getElementById('pic2').innerHTML=window.document.getElementById('pic3').innerHTML;
      window.document.getElementById('pic3').innerHTML=s;
    }
  }
}

function ClearPic(i){
  if(i==1){
    window.document.forms[0].elements['txtCar1'].value=window.document.forms[0].elements['txtCar2'].value;
    window.document.getElementById('pic1').innerHTML=window.document.getElementById('pic2').innerHTML;
    window.document.getElementById('td1').style.backgroundColor=window.document.getElementById('td2').style.backgroundColor;
    window.document.forms[0].elements['txtCar2'].value=window.document.forms[0].elements['txtCar3'].value;
    window.document.getElementById('pic2').innerHTML=window.document.getElementById('pic3').innerHTML;
    window.document.getElementById('td2').style.backgroundColor=window.document.getElementById('td3').style.backgroundColor;
    window.document.forms[0].elements['txtCar3'].value=0;
    window.document.getElementById('pic3').innerHTML='';
    window.document.getElementById('td3').style.backgroundColor='#e0e0ff';}

  if(i==2){
    window.document.forms[0].elements['txtCar2'].value=window.document.forms[0].elements['txtCar3'].value;
    window.document.getElementById('pic2').innerHTML=window.document.getElementById('pic3').innerHTML;
    window.document.getElementById('td2').style.backgroundColor=window.document.getElementById('td3').style.backgroundColor;
    window.document.forms[0].elements['txtCar3'].value=0;
    window.document.getElementById('pic3').innerHTML='';
    window.document.getElementById('td3').style.backgroundColor='#e0e0ff';}

  if(i==3){
    window.document.forms['superwed'].elements['txtCar3'].value=0;
    window.document.getElementById('pic3').innerHTML='';
    window.document.getElementById('td3').style.backgroundColor='#e0e0ff';}

  if(window.document.forms['superwed'].elements['txtCar2'].value==0){
       window.document.getElementById('td2').style.backgroundColor='#e0e0ff';
       window.document.getElementById('td3').style.backgroundColor='#ffffff';
  }
  if(window.document.forms['superwed'].elements['txtCar1'].value==0){
       window.document.getElementById('td1').style.backgroundColor='#e0e0ff';
       window.document.getElementById('td2').style.backgroundColor='#ffffff';
  }
}




function ProcessTix(Tixel)
{
  switch(Tixel)
  {
      case 1:
          if (window.document.forms['superwed'].elements['chkSendBrochure'].checked == true)
          { document.getElementById('SendBrochure').style.display = Viz; }
          else 
          {document.getElementById('SendBrochure').style.display = 'none';};
          break;

  case 2:
    window.document.forms['superwed'].elements['txtSendBrochureBy'].value="EMAIL";
    if ((window.document.forms['superwed'].elements['txtSendBrochureBy'].value == "POST") || (window.document.forms['superwed'].elements['txtQueryResponseBy'].value == "POST"))
    { document.getElementById('PostalAddress').style.display = Viz; }
    else
    { document.getElementById('PostalAddress').style.display='none'; };
    break;

  case 3:
    window.document.forms['superwed'].elements['txtSendBrochureBy'].value="POST";
    if ((window.document.forms['superwed'].elements['txtSendBrochureBy'].value == "POST") || (window.document.forms['superwed'].elements['txtQueryResponseBy'].value == "POST"))
    { document.getElementById('PostalAddress').style.display = Viz; }
    else
    { document.getElementById('PostalAddress').style.display='none'; };
    break;

  case 4:
    break;

  case 5:
    if (window.document.forms['superwed'].elements['chkOtherQuery'].checked == true)
    { document.getElementById('QueryResponse').style.display = Viz; }
    else
    { document.getElementById('QueryResponse').style.display = 'none'; };
    break;

case 6:
    window.document.forms['superwed'].elements['txtQueryResponseBy'].value="EMAIL";
    if ((window.document.forms['superwed'].elements['txtSendBrochureBy'].value == "POST") || (window.document.forms['superwed'].elements['txtQueryResponseBy'].value == "POST"))
    { document.getElementById('PostalAddress').style.display = Viz; }
    else
    { document.getElementById('PostalAddress').style.display='none'; };
    if (window.document.forms['superwed'].elements['txtQueryResponseBy'].value=="TELEPHONE")
    { document.getElementById('PhoneResponse').style.display = Viz; }
    else
    { document.getElementById('PhoneResponse').style.display = 'none'; };
    break;

case 7:
    window.document.forms['superwed'].elements['txtQueryResponseBy'].value="TELEPHONE";
    if ((window.document.forms['superwed'].elements['txtSendBrochureBy'].value == "POST") || (window.document.forms['superwed'].elements['txtQueryResponseBy'].value == "POST"))
    { document.getElementById('PostalAddress').style.display = Viz; }
    else
    { document.getElementById('PostalAddress').style.display='none'; };
    if (window.document.forms['superwed'].elements['txtQueryResponseBy'].value=="TELEPHONE")
    { document.getElementById('PhoneResponse').style.display = Viz; }
    else
    { document.getElementById('PhoneResponse').style.display = 'none'; };
    break;

case 8:
    window.document.forms['superwed'].elements['txtQueryResponseBy'].value="POST";
    if ((window.document.forms['superwed'].elements['txtSendBrochureBy'].value == "POST") || (window.document.forms['superwed'].elements['txtQueryResponseBy'].value == "POST"))
    { document.getElementById('PostalAddress').style.display = Viz; }
    else
    { document.getElementById('PostalAddress').style.display = 'none'; };
    if (window.document.forms['superwed'].elements['txtQueryResponseBy'].value=="TELEPHONE")
    { document.getElementById('PhoneResponse').style.display = Viz; }
    else
    { document.getElementById('PhoneResponse').style.display = 'none'; };
    break;

default:
    break;
  }
}
