﻿
        function CheckFileExtension()
        {
            var ctrlUpload = document.getElementById('ctl00_ContentPlaceHolder1_fileUploadResume');

            //Does the user browse or select a file or not
            if (ctrlUpload.value =='' )
            {return true;
            }

            //Extension List for validation. Add your required extension here with comma separator
            var extensionList = new Array(".pdf", ".doc");
            //Get Selected file extension
            var extension = ctrlUpload.value.slice(ctrlUpload.value.indexOf(".")).toLowerCase();

            //Check file extension with your required extension list.
            for (var i = 0; i < extensionList.length; i++)
            {
            if (extensionList[i] == extension)
            return true;
            }
            alert("You can only upload below File Types:\n\n"+extensionList.join("\n"));
            ctrlUpload.focus();
            return false;
        }
        
//Generating Pop-up Print Preview page
    function getPrint(print_area)
    {
        //Creating new page
        var pp = window.open();
        //Adding HTML opening tag with <HEAD> … </HEAD> portion 
        pp.document.writeln('<HTML><HEAD>')
        pp.document.writeln('<LINK href=Styles.css type="text/css" rel="stylesheet">')
        pp.document.writeln('<LINK href="Stylesheets/C4UStyleSheet.css" type="text/css" rel="stylesheet">')
        pp.document.writeln('<LINK href=PrintStyle.css ' + 
                            'type="text/css" rel="stylesheet" media="print">')
        pp.document.writeln('<base target="_self"></HEAD>')

        //Adding Body Tag
        pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
        pp.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
        //Adding form Tag
        pp.document.writeln('<form method="post">');

        //Creating two buttons Print and Close within a HTML table
        pp.document.writeln('<div class="NormalText"><h3>Caring for You Nursing Agency</h3></div>');
        pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right>');
        pp.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');
        pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');
        pp.document.writeln('<INPUT ID="CLOSE" type="button" ' + 
                            'value="Close" onclick="window.close();">');
        pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');

        //Writing print area of the calling page
        pp.document.writeln(document.getElementById(print_area).innerHTML);
        //Ending Tag of </form>, </body> and </HTML>
        pp.document.writeln('</form></body></HTML>'); 
    }



    function NewWindowTestimonial(mypage, myname, w, h, scroll) {
        var win = null;
        LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
        TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
        settings = 'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable'
        win = window.open(mypage, myname, settings)
    }
