// JavaScript Document
 
    function setExpiryDate(){
        //create the date
        var myDate = new Date();

        //add 5 days to the date      
        myDate.setDate(myDate.getDate() + 5);       
        
        //convert the month to abbreviation
        var months = new Array();
        months[0] = 'Jan';
        months[1] = 'Feb';
        months[2] = 'Mar';
        months[3] = 'Apr';
        months[4] = 'May';
        months[5] = 'Jun';
        months[6] = 'Jul';
        months[7] = 'Aug';
        months[8] = 'Sep';
        months[9] = 'Oct';
        months[10] = 'Nov';
        months[11] = 'Dec';

        //get day
        var day = myDate.getDate();
                
        //get Month
        var iMonth = myDate.getMonth();
        var month = months[iMonth];
        
        //get Year
        var year = myDate.getFullYear();
       
        //convert the date to the correct format
        var formattedDate = day + '-' + month + '-' + year; 

        //Assumes hidden field has id called ZoneExpiry
        var id = 'ZoneExpiry'; 
                
        //find the hidden element
        if (document.getElementById){
            var obj = document.getElementById(id);
            //set the date on the hidden element
            obj.value = formattedDate;
        } else if (document.all){ 
            var obj = document.all[id];
            //set the date on the hidden element
            obj.value = formattedDate;
        } else if (document.layers){
            var obj = document.layers[id];
            //set the date on the hidden element
            obj.value = formattedDate;
        }
               
        //debug
        //alert(obj.value);    
    }