// JavaScript Document

window.onload = function() {

        var randomnumber = Math.floor(Math.random() * 11)
        var ArrayText = new Array();
ArrayText[0] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'After I put my profile on your website I met someone im now about to marry.' - <strong>Adam</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        

ArrayText[1] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'We have just done nikaah after meeting on your site back in Janaury.' - <strong>elisha</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        
                                                     
ArrayText[2] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'Thanks to islamicfaces.com for helping me find my future wife.' - <strong>asif</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        

                                                     
ArrayText[3] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'Mashallah ive met my perfect partner your site.' - <strong>Liyahh</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        

                                                     
ArrayText[4] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'I was surprised by how many compatible matches there were on the website.' - <strong>Nat</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";                                 

ArrayText[5] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'I have been successful in finding a partner on islamicfaces.com. Keep up the good work.' - <strong>Abdul T</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        
                                                     
ArrayText[6] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'Was fed up of my parents introducing me to unsuitable people which motivated me to join Islamic Faces.' - <strong>naz</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        
                                                     
                                                     
ArrayText[7] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'Jazak allah I have met someone on here.' - <strong>Saeda</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";         

                                                     
ArrayText[8] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'Allhumdullah thanks to the site I have now met the right companion.' - <strong>Aliyah</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        
                                                     
ArrayText[9] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'I met my partner from islamic Faces. Im from the US and my partner is from London.' - <strong>Mo</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        
                                                     
ArrayText[10] = "<div style='width:350px;'><div style='float:left; margin-top:5px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>'Weve just booked our wedding after meeting on islamicfaces.com.' - <strong>Rubina</strong></a><div><strong style='margin-left:190px;'><a href='/struts/1muslsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div></div>";        

		
        document.getElementById("divText").innerHTML = ArrayText[randomnumber];
        document.getElementById("imgText").src = "images/" + randomnumber + ".jpg";
        
    }

    function fnValidation() {
        if (document.getElementById("txtUserName").value == "") {
            alert("Please enter a User Name");
            document.getElementById("txtUserName").focus();
            return false;
        }
        if (document.getElementById("txtUserName").value.length < 4) {
            alert("User Name should be more than 3 charcter");
            document.getElementById("txtUserName").focus();
            return false;
        }

        var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
        for (var i = 0; i < document.getElementById("txtUserName").value.length; i++) {
            if (iChars.indexOf(document.getElementById("txtUserName").value.charAt(i)) != -1) {
                alert("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");
                document.getElementById("txtUserName").value.focus();
                return false;
            }
        }


        if (document.getElementById("txtPassword").value == "") {
            alert("Please enter a Password");
            document.getElementById("txtPassword").focus();
            return false;
        }

        if (document.getElementById("txtPassword").value.length < 5) {
            alert("Password should be more than 4 charcter");
            document.getElementById("txtPassword").focus();
            return false;
        }

        if (document.getElementById("txtCountry").value == "") {
            alert("Please enter a Country");
            document.getElementById("txtCountry").focus();
            return false;
        }

        if (document.getElementById("cmbDate").selectedIndex == 0 || document.getElementById("cmbMonth").selectedIndex == 0 || document.getElementById("cmbYear").selectedIndex == 0) {
            alert("Please enter a valid Date of Birth");
            return false;
        }

        var email = document.getElementById('txtEmail').value;
        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        if (reg.test(email) == false) {
            alert('Please enter a valid Email Address');
            return false;
        }




        if (document.getElementById("rdoAgree").checked == false) {
            alert("Please accept the Terms and Conditions");
            document.getElementById("rdoAgree").focus();
            return false;
        }

        return true;
    }
    function fnSubmit()
    {
    	if (fnValidation())
    	{
    		document.form1.submit();
    	}
    	else
    	{
    		return false;
    	}
    }