<script type="text/javascript">
function validate()
{ 
    if(trim(document.getElementById('varname').value)=='')
    {
        alert('Please enter your full name.');
        document.getElementById('varname').focus();
        return false;
    }
    else if(trim(document.getElementById('varemail').value)=='')
    {
        alert('Please enter your Email ID.');
        document.getElementById('varemail').focus();
        return false;
    }
    else if(!chkemail_validate(trim(document.getElementById('varemail').value)))
    {
		alert("Please enter your valid Email ID.");
		document.getElementById('varemail').focus();
		return false;
    }  
    else if(trim(document.getElementById('kindofneed').value)=='')
    {
        alert('Please select the features you want.');
        document.getElementById('kindofneed').focus();
        return false;
    }
    else if(document.getElementById('varmessage').value=='')
    {
		alert("Please write about your choice.");
		document.getElementById('varmessage').focus();
		return false;
    }

	var postdata = $("#emailthis").serialize();


	$.ajax({
	   type: "POST",
	    url: "index.php?module=settings&view=morepopup&task=submitform",
	   data: postdata,
	   async: true,
	   start : loader_in('html/js'),
	   success: function(data){

		//alert(data);
		//var datalength = data.length;
		alert('Your mail has been sent successfully to admin.');
		disablePopup();
              //  jAlert(data, 'Success');
	        return false;
		}

	});


}

function chkemail_validate(str1)
{
	var str=str1;
        var strarray=str.split(",");
        var error=false;
        for(i=0;i<strarray.length;i++)
        {
            var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
            if (!(filter.test(trim(strarray[i]))))
            error=true;
        }
        if(error==true)
            {
                return false;
            } else {
                return true;
            }

}

</script>


<form name="emailthis" id="emailthis" action="" onsubmit="return false;" method="post">
<div>
    <div>
        <div class="left"><img width="5" height="5" alt="top left" src="html/images/top-left.png"></div>
        <div class="n_pop-up-user-box"></div>
        <div class="left"><img width="5" height="5" alt="top left" src="html/images/top-right.png"></div>
    </div> <div class="clear"></div>

    <div class="n_pop-up-box">
        <div class="left">
            <span class="dragme" style="color:#ffffff;
                  font-family:Arial,Helvetica,sans-serif;font-size:16px;font-weight:bold;">Request More Features</span></div>
        <div class="right"><a href="javascript:;"><img width="15" vspace="5" hspace="10" height="15" alt="close" onclick="return disablePopup();" src="html/images/pop-up-close.gif"></a></div>
        <div class="clear"></div>
        <div class="white-box-bg">
            <div>
                <div class="left"><img width="5" height="5" alt="top wht left" src="html/images/white-top-left.gif"></div>
                <div class="right"><img width="5" height="5" alt="top wht right" src="html/images/white-top-right.gif"></div>
            </div>
            <div class="whitebg ">
                <form name="requestfrm" id="requestfrm" onsubmit="return false;" action="post">
                    <input type="hidden" id="id" name="id" value="<?=$_GET['eid']?>" />
                    <table width="87%" border="0" align="center" cellpadding="3" cellspacing="3">
                        <tr>
                            <td width="33%" align="left" valign="top"><strong>Name :</strong></td>
                            <td width="67%" align="left" valign="top"><input name="varname" style="width: 240px;" type="text" class="pop-up-textarea" id="varname" maxlength="50" value="" /></td>
                        </tr>
                        <tr>
                            <td align="left" valign="top"><strong>Email :</strong></td>
                            <td align="left" valign="top"><input name="varemail" type="text" style="width: 240px;" class="pop-up-textarea" value="" id="varemail" maxlength="50" /></td>
                        </tr>
                        <tr>
                            <td align="left" valign="top"><strong>What kind of Features you need? :</strong></td>
                            <td align="left" valign="top">                                
                             <?php echo $html;?>                                
                            </td>
                        </tr>
                        <tr>
                            <td align="left" valign="top"><strong>Description :</strong></td>
                            <td colspan="3" align="left" valign="top"><textarea id="varmessage" class="pop-up-textarea" name="varmessage" style="width:240px; height:100px;"></textarea></td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <div align="center">
                                    <input type="image" src="html/images/ok-button.gif" onmouseover="MM_swapImage('Imagesn','','html/images/ok-hover-button.gif',1)" onmouseout="MM_swapImgRestore()" alt="Submit" name="submit1" width="58" height="29" border="0" id="submit1" onclick="javascript: return validate();" />
                                    <a onmouseover="MM_swapImage('Imagecan','','html/images/cancel-hover.jpg',1)" onclick="return disablePopup();" onmouseout="MM_swapImgRestore()" href="javascript:;"><img border="0" width="78" height="29" id="Imagecan" name="Imagecan" alt="Ok" src="html/images/cancle.gif"></a>
                                </div>
                            </td>
                        </tr>
                    </table>
                </form>

            </div>

            <div>
                <div class="left"><img width="0" height="5" alt="btm wht left" src="html/images/white-btm-left.gif"></div>
                <div class="right"><img width="0" height="5" alt="btm wht right" src="html/images/white-btm-right.gif"></div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div>
        <div class="left"><img width="5" height="5" alt="btm left" src="html/images/btm-left.png"></div>
        <div class="n_pop-up-user-box"></div>
        <div class="left"><img width="5" height="5" alt="btm left" src="html/images/btm-right.png"></div>
    </div>

</div>
</form>