
//************************* Information ************************

var UAgent=navigator.userAgent;

//************************ get cookie **********************************

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  var c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    var c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
   	return true;
    }
  }
return false;
}

//******************************  Styles  ******************************************************
var dePath = '<LINK REL=StyleSheet HREF=\"'+DbPath+'/resources/css/$file/';
var deType = 'TYPE=\"text/css\">'
var deCSS = 'false'

//************************* Windows  **********************************
function itsWindows(){
if (UAgent.indexOf('Chrome')>0){ deCSS = 'Safari.css'}
else if (UAgent.indexOf('Firefox')>0){ deCSS = 'FireFox.css'}
else if (UAgent.indexOf('MSIE')>0) { deCSS = 'MSIE.css'}
else if (UAgent.indexOf('Opera') +1 > 0) { deCSS = 'Opera.css'}
else if (UAgent.indexOf('Safari')>0){ deCSS = 'Safari.css'}

}
//************************* Apple **************************************
function itsApple(){
	 if (UAgent.indexOf('Safari')>0) { deCSS = 'Safari.css'}
	else if (UAgent.indexOf('Gecko')>0){ deCSS = 'Gecko.css'}
	else if (UAgent.indexOf('Opera') +1 > 0) { deCSS = 'Opera.css'}

}

//************************* Mobile **************************************
function itsMobile(){
	if (UAgent.indexOf('Safari')>0) { deCSS = 'MobileSafari.css'}
}

//************************* Linux ****************************************
function itsLinux(){
		if (UAgent.indexOf('Linux')>0) { deCSS = 'FireFox.css'}
}

//************************* Other *****************************************
function itsOther(){
if(getCookie('BloodServices')){ deCSS = 'Safari.css' }	
}
//*********************************************************************

if(UAgent.indexOf('Windows') > 0){
	itsWindows();
}
else if( (UAgent.indexOf('Mobile') > 0) || UAgent.indexOf('BlackBerry') > 0 || UAgent.indexOf('PlayBook') > 0 ){
	itsMobile();
}
else if(UAgent.indexOf('Mac') > 0){
	itsApple();
}
else if(UAgent.indexOf('Linux') > 0){
	itsLinux();
}
else {
	itsOther();
}

if(deCSS == 'false'){window.location = DbPath+"/BrowserNotification?OpenPage"}
else {document.write(dePath + deCSS +'\"'+deType);}


