﻿// JScript File
// By Using this Javascript, the link of the CSS File Changes as per the Browser Used to Browse the Site.
// So that the Site will look Unique & Proper in every Browser.



// alert(navigator.appVersion);
 var ua = navigator.userAgent.toLowerCase(); 

if ( ua.indexOf( "opera" ) != -1 ) 
	{ 
		alert("opera"); 

	} 

else if ( ua.indexOf( "msie 8" ) != -1 ) 
	{ 
 var cssforie = document.createElement('link');
  cssforie.type='text/css';
  cssforie.rel='stylesheet';
  cssforie.href='http://www.coxandkings.co.uk/App_Themes/IECSS/Style.css';
  document.getElementsByTagName('head')[0].appendChild(cssforie);
	} 
	
	else if ( ua.indexOf( "msie 7" ) != -1 ) 
	{ 
 var cssforie = document.createElement('link');
  cssforie.type='text/css';
  cssforie.rel='stylesheet';
  cssforie.href='http://www.coxandkings.co.uk/App_Themes/IECSS/Style7.css';
  document.getElementsByTagName('head')[0].appendChild(cssforie);
	}
	else if ( ua.indexOf( "msie 6" ) != -1 ) 
	{ 
 var cssforie = document.createElement('link');
  cssforie.type='text/css';
  cssforie.rel='stylesheet';
  cssforie.href='http://www.coxandkings.co.uk/App_Themes/IECSS/Style6.css';
  document.getElementsByTagName('head')[0].appendChild(cssforie);
	}
	

else if ( ua.indexOf( "safari" ) != -1 ) 
	{ 
	
var cssforsafari = document.createElement('link');
  cssforsafari.type='text/css';
  cssforsafari.rel='stylesheet';
  cssforsafari.href='http://www.coxandkings.co.uk/App_Themes/SafariCSS/Style.css';
  document.getElementsByTagName('head')[0].appendChild(cssforsafari);
	} 

else if ( ua.indexOf( "mozilla" ) != -1 ) 
	{ 
if ( ua.indexOf( "firefox" ) != -1 ) 
	{ 
 var cssforfirefox = document.createElement('link');
  cssforfirefox.type='text/css';
  cssforfirefox.rel='stylesheet';
  cssforfirefox.href='http://www.coxandkings.co.uk/App_Themes/MozillaCSS/Style.css';
  document.getElementsByTagName('head')[0].appendChild(cssforfirefox);
	} 

else 	{ 
 var cssforfirefox = document.createElement('link');
  cssforfirefox.type='text/css';
  cssforfirefox.rel='stylesheet';
  cssforfirefox.href='http://www.coxandkings.co.uk/App_Themes/MozillaCSS/Style.css';
  document.getElementsByTagName('head')[0].appendChild(cssforfirefox);
	} 
	} 




