﻿ 
 
 
// --------------------------------------------------------------------------------------------------
//          Code to apply different Stylesheets according to the Browser 
// --------------------------------------------------------------------------------------------------
 
 
 // Get the Protocol from the url
    var _Protocol               =   location.protocol + "//";
    // Get the Host Address from the url
    var _Host                   =   location.host;
    // Get the array for the project folder name from the pathname
    var _arrProjectFolderName   =   location.pathname.split("/");
    var _ApplicationName        =   "";
    var _CssPath                =   "";
    // If the array exists
    if ( _arrProjectFolderName )
    {
        if ( _arrProjectFolderName.length  >=  1 )
        {
            if ( _arrProjectFolderName[1] )
            {
                // Get the application name ie the Application name used in the url
               _ApplicationName     =   _arrProjectFolderName[1];
            }    
        }
    }
    
 // Concatenate all the parts and make the fixed portion of the url
    var _ApplicationPath        =   _Protocol + _Host + "/" + _ApplicationName;

    // If the Browser used is Firefox
    if((parseInt(navigator.appName.indexOf("Internet")) == -1 ))
    {
        //alert('Firefox')
        _CssPath    =   "<link rel='stylesheet' href='" + _ApplicationPath + "/CSS/New/Mozilla.css' type='text/css'>";
	    document.write(_CssPath); 
    }
    else
    {
        //alert('IE')	
        // Variable to store the Current Browser Version
        BrowserVersion = 0
        // Check again if the Browser is IE
        if (navigator.appVersion.indexOf("MSIE")!= -1)
        {
            // Get the whole Version String and then split it by MSIE 
            TotalBrowserVersionString = navigator.appVersion.split("MSIE");
            // Then refer the first part of the above array
            BrowserVersion = parseFloat(TotalBrowserVersionString[1]);
        }
        // If the Browser is 6.0
        if (BrowserVersion == 6.0) 
        {
            _CssPath    =   "<link rel='stylesheet' href='" + _ApplicationPath + "/CSS/New/IE6.css' type='text/css'>";
	        document.write(_CssPath); 
	    }
	    // If the browser is 7.0	    
	    else if (BrowserVersion == 7.0)     
	    {
            _CssPath    =   "<link rel='stylesheet' href='" + _ApplicationPath + "/CSS/New/IE7.css' type='text/css'>";
	        document.write(_CssPath); 	    
	    }
	    // If the browser is other than 6.0 and 7.0
	    else
	    {
            _CssPath    =   "<link rel='stylesheet' href='" + _ApplicationPath + "/CSS/New/IE6.css' type='text/css'>";
	        document.write(_CssPath); 	        
	    }
    }


// --------------------------------------------------------------------------------------------------
//          Code to apply different Stylesheets according to the Browser 
// --------------------------------------------------------------------------------------------------



//if ((screen.width>=800) && (screen.height>=600))  
//{
//    if ("<img width=488px height=66px />")
//    {
//        document.write("<img width=288px height=54px />");
//    }
//}

