// JavaScript Document

window.onload = function() {

        var randomnumber = Math.floor(Math.random() * 7);
        var ArrayText = new Array();
ArrayText[0] = "<div style='width:420px;'><div style='float:left; margin-top:5px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>'Thank you for helping me find the woman of my dreams on your website. Thanks again.'</a> - <strong>Jenni</strong><strong style='margin-left:70px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div>";
                                                                       
ArrayText[1] = "<div style='width:420px;'><div style='float:left; margin-top:5px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>'I contacted member jatslough and we began to chat. Weve met up a few times and things look promising.'</a> - <strong>Dee</strong><strong style='margin-left:70px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div>";
                                                                       
ArrayText[2] = "<div style='width:420px;'><div style='float:left; margin-top:5px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>'We met last month on the site and now im introducing him to my parents this weekend.'</a> - <strong>meena</strong><strong style='margin-left:70px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div>";
                                                                       
ArrayText[3] = "<div style='width:420px;'><div style='float:left; margin-top:5px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>'I have met a very nice lady from your website and we hope to get married in the future.'</a> - <strong>Sonya</strong><strong style='margin-left:70px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div>";
                                                                       
ArrayText[4] = "<div style='width:420px;'><div style='float:left; margin-top:5px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>'Thank you for helping me find the woman of my dreams on your website. Thanks again.'</a> - <strong>Rick</strong><strong style='margin-left:70px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div>";
                                                                       
ArrayText[5] = "<div style='width:420px;'><div style='float:left; margin-top:5px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>'How do you delete your profile? I have now met someone off the site and no longer need my profile.'</a> - <strong>Aman</strong><strong style='margin-left:70px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></div></div>";
                                                                       
ArrayText[6] = "<div style='width:420px;'><div style='float:left; margin-top:5px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>'ive just proposed to member Kiran_Princess and were getting married in the fall.'</a> - <strong>Kully</strong><strong style='margin-left:70px;'><a href='/struts/1addtsuccessstories.html' class='testlink'>More Success Stories >> </a></strong></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("txtReligion").value == "") {
            alert("Please enter your Religion");
            document.getElementById("txtReligion").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;
    	}
    }