<script language="javascript">
    var asInitVals = new Array();
    var prd = document.getElementById('val_prd_div');
    var iss = document.getElementById('val_iss_div');
    var dt = document.getElementById('val_dt_div');   
    $(document).ready(function() {

        $("#partcpnt_id").autocomplete("autocomplete.php", {
            width: 260,
            matchContains: true,
            highlight: false,
            autoFill: false,
            scroll: true,
            scrollHeight: 180
        });

        $("#partcpnt_id2").autocomplete("autocomplete.php", {
            width: 260,
            matchContains: true,
            highlight: false,
            autoFill: false,
            scroll: true,
            scrollHeight: 180
        });
        
        // $("#tabs").tabs('select',2);
        $("#tabs").tabs({disabled: [1,2]});

        $("#tabs").tabs( {
            "show": function(event, ui) {
                var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
                var tab1 = $("#tabs-1").is(":visible");
                var tab2 = $("#tabs-2").is(":visible");
                var tab3 = $("#tabs-3").is(":visible");

                if(tab1)
                {
                    $("#tab_id").val("1");
                }
                if(tab2)
                {
                    $("#tab_id").val("2");
                }
                if(tab3)
                {
                    $("#tab_id").val("3");
                }

                if ( oTable.length > 0 ) {
                    oTable.fnAdjustColumnSizing();
                }
            }
        } );

  
    } );
    function part_id()
    {
        if(navigator.appName != "Microsoft Internet Explorer")
            frmname = document.recuirtment;

        lcn = frmname.location.value;
        lcn_typ = frmname.location_type.value;
        frmname.participant_id.value = lcn+lcn_typ;
		
        /*if(frmname.location.value == "")
		{
			alert("Please Provide Report Type");
			frmname.location.focus();
			return false;
		}*/
    }
    function frm_validation()
    {
        if(navigator.appName != "Microsoft Internet Explorer")
            frmname = document.recuirtment;

        var tab1 = $("#tabs-1").is(":visible");
        var tab2 = $("#tabs-2").is(":visible");
        var tab3 = $("#tabs-3").is(":visible");

        if(tab1)
            $("#tab_id").val("1");
        if(tab2)
            $("#tab_id").val("2");
        if(tab3)
            $("#tab_id").val("3");

        if(tab1)
        {
            if(frmname.survey_id.value == "")
            {
                alert("Please Select Survey");
                frmname.survey_id.focus();
                return false;
            }
            if(frmname.location.value == "")
            {
                alert("Please Select Location");
                frmname.location.focus();
                return false;
            }
            /*if(frmname.participant_id.value == "")
			{
				alert("Please Provide Participant ID");
				frmname.participant_id.focus();
				return false;
			}*/
            if(frmname.cupn_cde.value == "")
            {
                alert("Please Provide Coupon Code");
                frmname.cupn_cde.focus();
                return false;
            }
            else
            {
                var Pattern = /^[A-Z]{2}[0-9]{4}$/;
                if(!$("#cupn_cde").val().match(Pattern))
                {
                    alert("Please Provide Valid Coupon Code. Example: CH1001");
                    frmname.cupn_cde.focus();
                    return false;
                }
            }
            if(frmname.location_type.value == "")
            {
                alert("Please Select Participant Type");
                frmname.location_type.focus();
                return false;
            }
            if(frmname.age.value == "")
            {
                alert("Please Provide Age");
                frmname.age.focus();
                return false;
            }
            else if(frmname.age.value != "" && isNaN(frmname.age.value))
            {
                alert("Please Provide Age in Numeric");
                frmname.age.focus();
                return false;
            }
            if(frmname.dob.value == "")
            {
                alert("Please Provide Date of Birth");
                frmname.dob.focus();
                return false;
            }
            if(frmname.sex.value == "")
            {
                alert("Please Provide Gender");
                frmname.sex.focus();
                return false;
            }
            /*if(frmname.ntwrk_sze.value == "")
            {
                alert("Please Provide Network Size");
                frmname.ntwrk_sze.focus();
                return false;
            }
            else if(frmname.ntwrk_sze.value != "" && isNaN(frmname.ntwrk_sze.value))
            {
                alert("Please Provide Network Size in Numeric");
                frmname.ntwrk_sze.focus();
                return false;
            }
            /*if(frmname.biometric_ref.value == "")
			{
				alert("Please Provide Biometric Reference");
				frmname.biometric_ref.focus();
				return false;
			}*/
        }

        if(tab2)
        {
            if(frmname.partcpnt_id2.value == "")
            {
                alert("Please Provide Participant ID");
                frmname.partcpnt_id2.focus();
                return false;
            }
            /*
			if(frmname.biometric_ref.value == "")
            {
                alert("Please Provide Biometric Reference");
                frmname.biometric_ref.focus();
                return false;
            }
			*/
        }

        if(tab3)
        {
            if(frmname.partcpnt_id.value == "")
            {
                alert("Please Provide Participant ID");
                frmname.partcpnt_id.focus();
                return false;
            }
            if(frmname.cupn.value == "")
            {
                alert("Please Provide No of Coupons");
                frmname.cupn.focus();
                return false;
            }
            else
            {
                for(i=0; i<frmname.cupn.value; i++)
                {
                    cupn_lst = $("#cupn_lst_"+i);
                    if(cupn_lst.val() == "")
                    {
                        alert("Please Provide Coupon Code");
                        cupn_lst.focus();
                        return false;
                    }
                    else
                    {
                        var Pattern = /^[A-Z]{2}[0-9]{4}$/;
                        if(!$("#cupn_lst_"+i).val().match(Pattern))
                        {
                            alert("Please Provide Valid Coupon Code");
                            cupn_lst.focus();
                            return false;
                        }
                    }
                    /*cupn_dt = $("#cupn_dt_"+i);
					if(cupn_dt.value == "")
					{
						alert("Please Provide Coupon Issue Date");
						cupn_dt.focus();
						return false;
					}
					cupn_prd = $("#cupn_prd_"+i);
					if(cupn_prd.value == "")
					{
						alert("Please Provide Coupon Valid Period");
						cupn_prd.focus();
						return false;
					}
					prd_type = $("#prd_type_"+i);
					if(prd_type.value == "")
					{
						alert("Please Provide Coupon Valid Period");
						prd_type.focus();
						return false;
					}
					cupn_vld_dt = $("#cupn_vld_dt_"+i);
					if(cupn_vld_dt.value == "")
					{
						alert("Please Provide Coupon Valid Date");
						cupn_vld_dt.focus();
						return false;
					}*/
                }
            }

            /*if(frmname.cupn_lst.value == "")
			{
				alert("Please Provide Coupon List");
				frmname.cupn_lst.focus();
				return false;
			}*/
            if(frmname.cupn_dt.value == "")
            {
                alert("Please Provide Coupon Issue Date");
                frmname.cupn_dt.focus();
                return false;
            }
            if(frmname.cupn_prd.value == "")
            {
                alert("Please Provide Coupon Valid Period");
                frmname.cupn_prd.focus();
                return false;
            }
            if(frmname.prd_type.value == "")
            {
                alert("Please Provide Coupon Valid Period");
                frmname.prd_type.focus();
                return false;
            }
            if(frmname.cupn_vld_dt.value == "")
            {
                alert("Please Provide Coupon Valid Date");
                frmname.cupn_vld_dt.focus();
                return false;
            }
        }
    }

    function val_age(bDay, dt_fmt)
    {
        bD = bDay.split('-');
        mnth = bD[1];
        days = bD[0];
        yrs = bD[2];
        
        if(dt_fmt == 'yyyy-mm-dd')
        {
            yrs = bD[0];
            mnth = bD[1];
            days = bD[2];
        }
        if(dt_fmt == 'dd-mm-yyyy')
        {
            yrs = bD[2];
            mnth = bD[1];
            days = bD[0];
        }
        if(dt_fmt == 'mm-dd-yyyy')
        {
            yrs = bD[2];
            mnth = bD[0];
            days = bD[1];
        }

        yr = CalAge(mnth, days, yrs);

        if(!isNaN(yr))
            $("#age").val(yr);
        // alert(yr);
    }

    function date_cal(bDay, intr, mode, i, dt_fmt)
    {
        bD = bDay.split('-');
        mnth = bD[1];
        days = bD[0];
        yrs = bD[2];
        
        if(dt_fmt == 'yyyy-mm-dd')
        {
            yrs = bD[0];
            mnth = bD[1];
            days = bD[2];
        }
        if(dt_fmt == 'dd-mm-yyyy')
        {
            yrs = bD[2];
            mnth = bD[1];
            days = bD[0];
        }
        if(dt_fmt == 'mm-dd-yyyy')
        {
            yrs = bD[2];
            mnth = bD[0];
            days = bD[1];
        }

        yr = date_interval(eval(mnth), eval(days), eval(yrs), eval(intr), eval(mode), dt_fmt);

        // $("#cupn_vld_dt_"+i).val(yr);
        $("#cupn_vld_dt").val(yr);
        // alert(yr);
    }

    function addRow_att(tableID, cnt)
    {
        var out = '';
        for(i=1; i<cnt; i++)
        {
            out = out+'<div class="questionrow"><div class="question">Coupons Code '+(i+1)+'</div><div class="answer"><input type="text" name="cupn_lst[]" id="cupn_lst_'+i+'" value="" /></div></div>';
        }
        $("#"+tableID).html(out);
    }

    function frm_val(formvars)
    {
        // alert(formvars);
        len = formvars.length;
	
        for(i=0; i<len; i++)
        {
            if(formvars[i].name == 'reg_id[]')
            {
                if(formvars[i].checked)
                {
                    survey = 'survey_'+i;
                    reg_location = 'reg_location'+i;
                    participant_type = 'participant_type_'+i;
                    cupn_code = 'cupn_code_'+i;
                    dor = 'dor_'+i;
                    ns = 'ns_'+i;
                    dob = 'dob_'+i;
                    age = 'age_'+i;
                    sex = 'sex_'+i;

                    alert(formvars[i].value+" "+$("#tab_id").val());
                }
            }
        }
      
    }

    function frm_edit_val(frmval)
    {
        var url = "";
        var loc = window.location;
        var pathName = loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1);
        url = loc.href.substring(0, loc.href.length - ((loc.pathname + loc.search + loc.hash).length - pathName.length));
        $("#delete_img").show();

        $.ajax({
            type: "POST",
            data: "page="+getUrlVars()["page"]+"&mode=edit&id="+frmval["participant_id"]+"&sur_id="+frmval["survey"],
            url: url+"index.php",
            error: function(msg){
				alert( msg.status );
            },
            success: function(msg){
                $("#content").html(msg);
                close_frame();
            }
        });
        return false;

        // alert(frmval.length);
        // $("#survey_id").find("option[value='"+frmval["survey"]+"']").attr("selected","selected");
        // $("#location").find("option[value='"+frmval["reg_location"]+"']").attr("selected","selected");
        // $("#location_type").find("option[value='"+frmval["participant_type"]+"']").attr("selected","selected");
        $("#id").val(frmval["reg_id"]);
        $("#survey_id").val(frmval["survey"]);
        $("#location").val(frmval["reg_location"]);
        $("#location_type").val(frmval["participant_type"]);
        $("#participant_div .questionrow .question").html("Participant ID");
        $("#participant_div .questionrow .answer").html(frmval["participant_id"]);
        // $("#participant_div .questionrow").css("margin-bottom", 10);
        $("#participant_div").show();
        $("#cupn_cde").val(frmval["cupn_code"]);
        $("#dor_span").html(frmval["dor"]);
        $("#dor").val(frmval["dor"]);
        $("#ntwrk_sze").val(frmval["ns"]);
        $("#dob").val(frmval["dob"]);
        $("#age").val(frmval["age"]);
        $("#sex").val(frmval["sex"]);
        $("#partcpnt_id2").val(frmval["participant_id"]);
        $("#biometric_ref").val(frmval["biometric_ref"]);
        $("#partcpnt_id").val(frmval["participant_id"]);
        $("#cupn").val(frmval["coupon_count"]);
        $("#cupn_dt").val(frmval["cupn_dt"]);
        $("#cupn_prd").val(frmval["cupn_prd"]);
        $("#prd_type").val(frmval["prd_type"]);
        $("#cupn_vld_dt").val(frmval["cupn_vld_dt"]);
        
        addRow_att('cpn_list', frmval["coupon_count"]);
        
        if(frmval["coupon_count"] != "" || frmval["coupon_count"] > 1)
        {
            for(i=0; i<frmval["coupon_count"]; i++)
            {
                t_id = "coupn_part_id_"+frmval["reg_id"]+"_"+i;
                $("#cupn_lst_"+i).val(frmval[t_id]);
            }
        }
        else
            $("#cupn_lst_0").val("");
        
        close_frame();
    }
	
	function enb_div(val)
	{
		if(val != "")
		{
			$("#dob_div").show();
			$("#dob_clean_div").show();
		}
		else
		{
			$("#dob_div").hide();
			$("#dob_clean_div").hide();
			$("#dob").val("");
		}
	}
	
	function assign_partid(val)
	{
		//alert(val);
		if($("#sur_title").is(":visible"))
			$("#sur_title").html(val["sur_title"]);
		
		$("#survey_id").val(val["sur_id"]);
		$("#cupn_cde").val(val["reg_id"]);
		$("#location_type").val(val["prt_type"]);
		$("#age").val(val["reg_age"]);
		//$("#age").parent().append("<span>"+val["reg_age"]+"</span>");
		$("#disp_age").html(val["reg_age"]);
		$("#sex").val(val["prt_gndr"]);
		dob = dateFormat(val["prt_dob"], '<?php echo DT_FMT; ?>');
		$("#dob").val(dob);
		// CalYearfrmAge(val["reg_age"], "#dob");
		enb_div(val["reg_age"]);
		close_frame();
	}
</script>
<div style="width: 95%; margin: 0 auto; padding: 10px;" id="content">
    <div id="frm_display">
        <div id="tabs">
            <ul>
                <li class="active"><a href="#tabs-1">&nbsp;Registration&nbsp;</a></li>
                <li><a href="#tabs-2">&nbsp;Biometric Reference&nbsp;</a></li>
                <li><a href="#tabs-3">&nbsp;Coupon Information&nbsp;</a></li>
            </ul>

            <form class="form" name="recuirtment" id="recuirtment" method="post" action="<?php echo $action; ?>" onsubmit="return frm_validation();">
                <div id="tabs-1">
					<?php if(isset($_REQUEST['pid'])) { ?>
                    <div class="questionrow">
                        <div class="question">Survey</div>
                        <div class="answer">
                            <input type="hidden" name="id" id="id" value="" />
                            <input type="hidden" name="tab_id" id="tab_id" value="" />
                            <input type="hidden" name="pid" id="pid" value="<?php echo $_REQUEST['pid']; ?>" />
                            <input type="hidden" name="dt_fmt" id="dt_fmt" value="<?php echo DT_FMT; ?>" />
                            <input type="hidden" name="coupn_fxd" id="coupn_fxd" value="<?php echo COUPONFXD; ?>" />
                            <input type="hidden" name="survey_id" id="survey_id" value="<?php echo $survey_id; ?>" />
                            <?php
                            date_default_timezone_set('Asia/Calcutta');
							echo $sur_title;
                            // $common->dropdown('sur_code', 'sur_title', 'custom_survey_master', '', 'sur_title', 'survey_id', $survey_id, 'class="required"');
                            ?>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Location</div>
                        <div class="answer">
                            <input type="hidden" name="location" id="location" value="<?php echo $location; ?>" />
                            <?php
								echo $loc_title;
                            // $common->dropdown('loc_code', 'loc_name', 'custom_location', '', 'loc_name', 'location_sel', $location, 'disabled');
                            ?>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Participant Type</div>
                        <div class="answer">
                            <input type="hidden" name="location_type" id="location_type" value="<?php echo $location_type_val; ?>" />
                            <?php
								if($location_type_val == "S")
									echo "Seed";
								elseif($location_type_val == "W")
									echo "Recruit";
                            ?>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow" id="participant_div" style="display: none;">
                        <div class="question">Participant ID</div>
                        <div class="answer">
                            <?php echo $participant_id; ?>
                            <input type="hidden" name="participant_id" id="participant_id" value="<?php echo $participant_id; ?>" />
                        </div>
                    </div>
                    <div class="clear_form" style="display: none;">
                    </div>
                    <div class="questionrow">
                        <div class="question">Coupon Code</div>
                        <div class="answer">
                            <?php echo $cupn_cde; ?>
                            <input type="hidden" name="cupn_cde" id="cupn_cde" value="<?php echo $cupn_cde; ?>" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
					<?php } else { ?>
                    <div class="questionrow">
                        <div class="question">Survey</div>
                        <div class="answer">
                            <input type="hidden" name="id" id="id" value="" />
                            <input type="hidden" name="tab_id" id="tab_id" value="" />
                            <input type="hidden" name="dt_fmt" id="dt_fmt" value="<?php echo DT_FMT; ?>" />
                            <?php
								if($survey_id == "")
									$survey_id = SURVY;
								
								if(SURVYFXD == 'Y')
								{
									echo '<input type="hidden" name="survey_id" id="survey_id" value="'.SURVY.'" />';
									echo '<span id="sur_title">'.SURVYTITLE.'</span>';
									echo '<script>get_location("'.SURVY.'", \'location_coupon\', true);</script>';
								}
								else
								{
									//$common->dropdown('sur_code', 'sur_title', 'custom_survey_master', 'status = "Y"', 'sur_title', 'survey_id', $survey_id, 'class="required" onchange="return get_location(this.value, \'location_coupon\', true);"');
									
									echo '<input type="hidden" name="survey_id" id="survey_id" value="'.SURVY.'" />';
									echo '<span id="sur_title"></span>';
									echo '<script>get_location("'.SURVY.'", \'location_coupon\', true);</script>';
								}
                            ?>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Location</div>
                        <div class="answer">
                            <input type="hidden" name="location" id="location" value="" />
                            <input type="hidden" name="location_fxd" id="location_fxd" value="" />
                            <?php
                            $common->dropdown('loc_code', 'loc_name', 'custom_location', '', 'loc_name', 'location_sel', $location, '');
                            ?>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow" style="display: none;">
                        <div class="question">Participant ID</div>
                        <div class="answer">
                            <input type="text" name="participant_id" id="participant_id" value="" onfocus="return part_id();" />
                        </div>
                    </div>
                    <div class="clear_form" style="display: none;">
                    </div>
                    <div id="participant_div" style="display: none;">
                        <div class="questionrow">
                            <div class="question"></div>
                            <div class="answer"></div>
                        </div>
                    </div>
                    <div class="questionrow">
                        <div class="question">Coupon Code</div>
                        <div class="answer">
                            <!--<input type="text" name="cupn_cde" id="cupn_cde" value="<?php // echo LCTN; ?>" maxlength="6" onKeydown="return keyRestricted(this, event, document.recuirtment.location.value.length, false);" onKeyup="return keyRestricted(this, event, document.recuirtment.location.value.length, true);" />-->
                            <input type="text" name="cupn_cde" id="cupn_cde" value="" maxlength="6" readonly />
							<img src="includes/images/search_img.png" style="vertical-align: middle;" onclick="open_frame('autocomplete.php?from=registration');">
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Participant Type</div>
                        <div class="answer">
                            <select name="location_type" id="location_type">
                                <option value="">Select</option>
                                <option value="S">Seed</option>
                                <option value="W">Recruit</option>
                            </select>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
					<?php } ?>
                    <div class="questionrow">
                        <div class="question">Recruitment Date</div>
                        <div class="answer">
                            <?php
                            $dt_fmt = str_replace("mm", "m", DT_FMT);
                            $dt_fmt = str_replace("dd", "d", $dt_fmt);
                            $dt_fmt = str_replace("yyyy", "Y", $dt_fmt);
                            date_default_timezone_set('Asia/Calcutta');
                            echo '<span id="dor_span">' . date($dt_fmt) . '</span>';
                            ?>
                            <input type="hidden" name="dor" id="dor" value="<?php echo date($dt_fmt); ?>" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Age</div>
                        <div class="answer">
                            <input type="hidden" name="age" id="age" value="<?php echo $age; ?>" onblur="return CalYearfrmAge(this.value, '#dob'), enb_div(this.value);" maxlength="3" />
							<span id="disp_age"><?php echo $age; ?></span>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow" id="dob_div" style="display: none;">
                        <div class="question">Date of Birth</div>
                        <div class="answer">
                            <input type="text" name="dob" id="dob" value="<?php echo $dob; ?>" readonly="readonly" />
                            <script>
								$(function() {
                                    $('#dob').datepick({pickerClass: 'datepick-jumps', 
										renderer: $.extend({}, $.datepick.defaultRenderer, 
										{picker: $.datepick.defaultRenderer.picker. 
											replace(/\{link:prev\}/, '{link:prevJump}{link:prev}'). 
											replace(/\{link:next\}/, '{link:nextJump}{link:next}')
										}), 
										dateFormat: '<?php echo DT_FMT; ?>', 
										yearRange: '1900:<?php echo date('Y'); ?>',
										showTrigger: '#calImg'
                                    });
                                });
                            </script>
                            <!--<a style="cursor: pointer;" onclick="return showCalendar(this,'dob', '<?php echo DT_FRMT; ?>');"><img src="includes/images/cal.gif" border="0"/></a>-->
                        </div>
                    </div>
                    <div class="clear_form" id="dob_clean_div" style="display: none;">
                    </div>
					<?php echo '<script>enb_div("'.$age.'"); //CalYearfrmAge("'.$age.'", "#dob");</script>'; ?>
                    <div class="questionrow">
                        <div class="question">Gender</div>
                        <div class="answer">
							<?php $common->dropdown('gen_code', 'gen_name', 'custom_gender_master', '', 'gen_name', 'sex', $sex, ''); ?>
                            <!--<select name="sex" id="sex">
                                <option value="">Select</option>
                                <option value="1">Male</option>
                                <option value="2">Female</option>
                                <option value="3">Hijrah / Transgender</option>
                            </select>-->
                        </div>
                    </div>
                    <div class="clear_form" style="display: none;">
                    </div>
                    <div class="questionrow" style="display: none;">
                        <div class="question">Network size</div>
                        <div class="answer">
                            <input type="text" name="ntwrk_sze" id="ntwrk_sze" value="" onkeyup="return acceptDigits(this);" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div style="padding: 5px;" align="center">
                            <input type="submit" name="Submit" value="Next" />
                        </div>
                    </div>
                </div>
                <div id="tabs-2">
                    <div class="questionrow">
                        <div class="question">Particpant ID</div>
                        <div class="answer">
                            <input type="text" name="partcpnt_id2" id="partcpnt_id2" value="" readonly />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Biometric Reference</div>
                        <div class="answer">
							<input type="text" name="biometric_ref" id="biometric_ref" value="" maxlength="8" />
                            <!--<select name="biometric_ref" id="biometric_ref">
                                <option value="">Select</option>
                                <option value="1">Yes</option>
                                <option value="0">No</option>
                            </select>-->
                            <script>
                                select_checked('biometric_ref', '<?php echo $biometric_ref; ?>', "");
                            </script>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div style="padding: 5px;" align="center">
                            <input type="submit" name="Submit" value="Next" />
                        </div>
                    </div>
                </div>
                <div id="tabs-3">
                    <div class="questionrow">
                        <div class="question">Particpant ID</div>
                        <div class="answer">
                            <input type="text" name="partcpnt_id" id="partcpnt_id" value="" />
                            <?php // echo $common->dropdown('reg_id', 'reg_participant_id', 'custom_participant_registration', '', 'reg_participant_id', 'partcpnt_id', $partcpnt_id, 'class="required"'); ?>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">No of Coupons</div>
                        <div class="answer">
                            <input type="text" name="cupn" id="cupn" value="1" onkeyup="return acceptDigits(this), addRow_att('cpn_list', this.value);" onblur="return addRow_att('cpn_list', this.value);" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div class="question">Coupons Code 1</div>
                        <div class="answer">
                            <input type="text" name="cupn_lst[]" id="cupn_lst_0" value="" />
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div id="cpn_list">
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow" id="val_iss_div" >
                        <div class="question">Coupon Issue Date</div>
                        <div class="answer">
                            <input type="text" name="cupn_dt" id="cupn_dt" value="" readonly="readonly" />
                            <script>
                                /*$(function() {
                                    $('#cupn_dt').datepick({pickerClass: 'datepick-jumps', 
                                            renderer: $.extend({}, $.datepick.defaultRenderer, 
                                            {picker: $.datepick.defaultRenderer.picker. 
                                                replace(/\{link:prev\}/, '{link:prevJump}{link:prev}'). 
                                                replace(/\{link:next\}/, '{link:nextJump}{link:next}')
                                            }), 
                                            dateFormat: '<?php echo DT_FMT; ?>', 
                                            yearRange: '1900:<?php echo date('Y'); ?>',
                                            showTrigger: '#calImg'
                                    });
                                });*/
                            </script>
                            <!--<a style="cursor: pointer;" onclick="return showCalendar(this,'cupn_dt', '<?php echo DT_FRMT; ?>');"><img src="includes/images/cal.gif" border="0"/></a>-->
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow" id="val_prd_div">
                        <div class="question">Coupon Validity Period</div>
                        <div class="answer">
                            <input type="text" name="cupn_prd" id="cupn_prd" value="" size="7" />
                            <select name="prd_type" id="prd_type">
                                <!--<option value="">Select</option>-->
                                <option value="1">Days</option>
                                <option value="2">Weeks</option>
                                <option value="3">Month</option>
                                <option value="4">Year</option>
                            </select>
                            <script>
                                select_checked('prd_type', '<?php echo $prd_type; ?>', "");
                            </script>
                        </div>
                    </div>
                    <div class="clear_form">
                    </div>
                    <div class="questionrow" id="val_dt_div">
                        <div class="question">Coupon Validity Date</div>
                        <div class="answer">
                            <input type="text" name="cupn_vld_dt" id="cupn_vld_dt" value="" readonly="readonly" onfocus="return date_cal($('#cupn_dt').val(), $('#cupn_prd').val(), $('#prd_type').val(), 0, '<?php echo DT_FMT; ?>')" />
                            <!--<a style="cursor: pointer;" onclick="return showCalendar(this,'cupn_vld_dt','<?php echo DT_FMT; ?>');"><img src="includes/images/cal.gif" border="0"/></a> -->
                        </div>
                    </div>
                    <!--<div class="clear_form">
                    <div class="question">Mobile</div>
                    <div class="answer">
                    <input type="text" name="" id="" value="" />
                    </div>
                    </div> -->
                    <div class="clear_form">
                    </div>
                    <div class="questionrow">
                        <div style="padding: 5px;" align="center">
                            <input type="submit" name="Submit" value="Submit" />
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>