﻿// JScript File 

function ValidateSiteUrl()
        {
        var siteUrl=window.location.href;
        var urlLength=siteUrl.length;
        var varHidSiteLoadCounter=document.getElementById('hidSiteLoadCounter');
       //  alert('ValidateSiteUrl : ' + varHidSiteLoadCounter.value);
        //alert('index: ' + siteUrl.indexOf("/",siteUrl.length-1)==siteUrl.length-1);
        //alert(siteUrl.toLowerCase().indexOf("aspx"));
        /* NOTE :append '/' to the end of the url if it does not end with '/' and  it does not contain .aspx */
        if (siteUrl.indexOf("/",urlLength-1) != urlLength-1 && siteUrl.toLowerCase().indexOf(".aspx")==-1)
        {
           siteUrl=siteUrl+"/"; 
           window.location.href=siteUrl;
            varHidSiteLoadCounter.value=1; 
               /*alert('a : ' +  varHidSiteLoadCounter.value);*/
        }
      
        
    
    }

