function C2Cpopup()
   {
    window.open(location.protocol.toLowerCase() + '//c2c01.ulterius.net/c2c/e28162292c15232e394a00c4351b660a/call','','menubar=no,toolbar=no,status=no,resizable=no,scrollbars=no,width=320,height=320');
   }

function C2CresetForm(data)
   {
    data.name.value='';
    data.areacode.selectedIndex=0;
    data.phonenum.value='';
   }

function C2CcheckForm(data)
   {
    var badnum = false;

    if (data.name.value.length < 2)
       {
        alert("Please enter your name.");
        return false;
       }

    if (data.areacode.value.length == 0)
       {
        alert("Please select your area code.");
        return false;
       }

    tmpnum = data.phonenum.value.replace(/[^0-9]/g,"");

    if (data.areacode.value.match(/^\+61/))
       {
        if (data.areacode.value == "+614")
           {
            if ((tmpnum.substr(0,2) == "04") && (tmpnum.length == 10))
               {
                tmpnum = tmpnum.substr(2,8);
               }

            if (tmpnum.length != 8 || !data.phonenum.value.match(/^(04){0,1}[0-9\-\.\ ]*[0-9]$/))
               badnum = true;
           }
         else
           {
            if ((tmpnum.length != 8) || !data.phonenum.value.match(/^[2-9][0-9\-\.\ ]*[0-9]$/))
                badnum = true;
           }
       }
    else if (data.areacode.value.match(/^\+64/))
       {
        if (data.areacode.value == "+642")
           {
            if ((tmpnum.substr(0,2) == "02") && (tmpnum.length >= 9) && (tmpnum.length <= 11))
               {
                tmpnum = tmpnum.substr(2, tmpnum.length - 2);
               }

            if ((tmpnum.length < 7) || (tmpnum.length > 8) || !data.phonenum.value.match(/^(02){0,1}[0-9\-\.\ ]*[0-9]$/))
               badnum = true;
           }
         else
           {
            if ((tmpnum.length != 7) || !data.phonenum.value.match(/^[2-9][0-9\-\.\ ]*[0-9]$/))
                badnum = true;
           }
       }

    if (badnum)
       {
        alert("Please enter your telephone number using only numerals, dashes, spaces and dots.\nExamples include:\n\t0412 345 678 for a mobile\n\t1234 5678 for a landline");
        return false;
       }

    data.phone.value = data.areacode.value + tmpnum;

    return true;
   }
