/**********************************************************
***********************************************************
*  Copyright 2004 (c) Aumediage S.P.R.L. All Rights Reserved.								*
*  This is a commercial software product, please visit												*
*  http://www.aumediage.net for more information. or send email to					*
*  aumediage@hotmail.com																						*
*  See http://www.aumediage.net for Commercial License Agreement				*
*  All Copyright statements must always remain in place in all files at all times	*
*		***** PLEASE NOTE: THIS IS NOT FREE SOFTWARE	*****						*
*				*****	IT MUST BE LICENSED FOR ALL USE	*****								*
*  HISTORY																												*
*	Name			Date							Action					Version									*
*	GdB				27/02/2003			Creation				1.00											*
																																	*
************************************************************
***********************************************************/
/******************************************************Get browser info******************************************************/function ClientSniffer(){
	if (!readCookie('snif')){
		sBwName				= GetBrowserName();
		saveCookie('stgs', sBwName, 'bw', 60, g_sDomain, "/");
		iBwVersion			= GetBrowserVersion(parseFloat(navigator.appVersion));
		var iBwMajVer		= parseInt(iBwVersion);
		saveCookie('stgs', iBwMajVer.toString(), 'bwVer', 60, g_sDomain, "/");
		var sJsVersion		= GetJavascriptVersion(1.1) || 1.1;
		var sPlatform		= navigator.platform || '';
		var sPlatformNice	= GetPlatformName() || sPlatform;
		saveCookie('stgs', sPlatformNice, 'plfm', 60, g_sDomain, "/");
		var bBwJava			= (navigator.javaEnabled())?true:false;
		var bBwCookie		= (navigator.cookieEnabled)?true:false;
		var sCpuClass		= navigator.cpuClass || '';
		var bAccessOtherDomain	= false;
		var sConnType		= '';
		var bHomePage		= '';
		if(document.body.addBehavior){/*(isIE && iBwMajVer >= 5 && sPlatformNice.indexOf("Windows") != -1){*/
			document.body.addBehavior("#default#clientCaps");
			sConnType		= document.body.connectionType;
			document.body.addBehavior("#default#homePage");
			bHomePage		= document.body.isHomePage(location.href);
		}
		var sWwScreen		= (window.screen)?window.screen.width + 'X' + window.screen.height + 'X' + window.screen.colorDepth:'0X0X0';
		var sBwLanguage		= (navigator.language || navigator.userLanguage)?(navigator.userLanguage ||navigator.language ):'';
		saveCookie('stgs', sBwLanguage, 'sLngID', 60, g_sDomain, "/");
		var dNewDate		=  new Date();
		var iZone				= (dNewDate.getTimezoneOffset())/-60;
		saveCookie('stgs', (iZone+''), 'Zone', 60, g_sDomain, "/");
		var iFlashVersion	= DetectFlash();
		var sQueryString	= 'b='+escape(sBwName)+'&v='+escape(iBwVersion)+'&mv='+escape(iBwMajVer)+'&p='+escape(sPlatform)+'&pn='+escape(sPlatformNice);
		sQueryString		+=	'&j='+escape(bBwJava)+'&c='+escape(bBwCookie)+'&ct='+escape(sConnType)+'&h='+escape(bHomePage)+'&w='+escape(sWwScreen)+'&z='+iZone;
		sQueryString		+=	'&l='+escape(sBwLanguage)+'&hn='+escape(g_sDomain)+'&js='+escape(sJsVersion)+'&cpu='+escape(sCpuClass)+'&t='+escape(bAccessOtherDomain)+'&f='+escape(iFlashVersion);
		document.write ('<img src="'+g_sHrefPath+'Utils/LogInfo.aspx?'+sQueryString+'" width="20" height="20">');
	}
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function GetBrowserName(){	if (isOp)
		return 'Opera';
	else if (isSaf)
		return 'Safari';
	else if (isKonq)
		return 'Konqueror';
	else if (sBwAgent.indexOf('aol') != -1)
		return 'aol';
	else if (isWebTV)
		return 'WebTV';
	else if (isFFox)
		return 'Firefox';
	else if (isFBird)
		return 'Firebird';
	else if (isMoz)
		return 'Mozilla';
	else if (sBwAgent.indexOf('msn') != -1)
		return 'Msn Explorer';
	else if (isN)
		return 'Netscape';
	else if (isIE)
		return 'Internet Explorer';
	else
		return "UnKnown"
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function GetBrowserVersion(iThisBwVersion){		var iIndex;
		if (isOp)
			iIndex = sBwAgent.indexOf('opera')+sBwName.length;
		else if (isIE || sBwName == 'aol')
			iIndex = sBwAgent.indexOf('msie')+'msie'.length;
		else if ( isN && iBwVersion >= 5){
			iIndex = sBwAgent.indexOf(sBwName.toLowerCase())+sBwName.length;
			iIndex = (sBwAgent.indexOf('/', iIndex)!= -1)? sBwAgent.indexOf('/', iIndex)+1 : iIndex;
		}
		else if ( isFBird || isFFox){
			iIndex = (sBwAgent.lastIndexOf('/')!= -1 > (sBwAgent.indexOf('/')!= -1))? sBwAgent.lastIndexOf('/')+1 : 0;
		}
		if (iIndex){
			var iLoop = 0;isOk = false;
			while (isOk == false && iLoop <= 3){
				iThisBwVersion = parseFloat(sBwAgent.substr(iIndex+iLoop));
				iLoop++;
				if ( !isNaN(iThisBwVersion) && iThisBwVersion != 0)
					isOk = true;
			}
			if (isNaN(iThisBwVersion))
				iThisBwVersion = 0;
		}
		return iThisBwVersion;}/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function GetPlatformName(){		if(sBwAgent.indexOf("windows 3.1")!=-1 || sBwAgent.indexOf("win16")!=-1 || sBwAgent.indexOf("windows 16-bit")!=-1){
			return 'Windows 3.1';}
		else if (sBwAgent.indexOf("win95")!=-1 || sBwAgent.indexOf("windows 95")!=-1)
			return 'Windows 95';
		else if(sBwAgent.indexOf("win98")!=-1 || sBwAgent.indexOf("windows 98")!=-1)
			return 'Windows 98';
		else if (sBwAgent.indexOf('windows nt 5.1') != -1 || sBwAgent.indexOf('windows xp') != -1)
			return 'Windows XP';
		else if (sBwAgent.indexOf('nt 5.0') != -1 || sBwAgent.indexOf('windows 2000') != -1)
			return 'Windows 2000';
		else if (sBwAgent.indexOf('nt 5.2') != -1 || sBwAgent.indexOf('windows 2003') != -1)
			return 'Windows 2003';
		else if (sBwAgent.indexOf("winnt")!=-1 || sBwAgent.indexOf("windows nt")!=-1)
			return 'Windows NT';
		else if (sBwAgent.indexOf("os/2")!=-1 || navigator.appVersion.indexOf("os/2")!=-1 || sBwAgent.indexOf("ibm-webexplorer")!=-1 )
			return 'OS/2';
		else if (sBwAgent.indexOf("mac")!=-1 && ( sBwAgent.indexOf("68k")!=-1 || sBwAgent.indexOf("68000")!=-1 ))
			return 'Mac 68k';
		else if (sBwAgent.indexOf("mac")!=-1 && ( sBwAgent.indexOf("ppc")!=-1 || sBwAgent.indexOf("powerpc")!=-1 ))
			return 'Mac PowerPC';
		else if ( sBwAgent.indexOf("mac")!=-1)
			return 'Macintosh';
		else if ( sBwAgent.indexOf("sunos 4")!=-1)
			return 'Sun 4';
		else if ( sBwAgent.indexOf("sunos 5")!=-1)
			return 'Sun 5';
		else if ( sBwAgent.indexOf("i86")!=-1 && sBwAgent.indexOf("sunos")!=-1)
			return  'Sun i86';
		else if ( sBwAgent.indexOf("sunos")!=-1)
			return 'Sun';
		else if ( sBwAgent.indexOf("inux")!=-1)
			return 'Linux';
		else if ( sBwAgent.indexOf("unix_system_v")!=-1)
			return 'Unix ware';
		else if ( sBwAgent.indexOf("unix")!=-1)
			return 'Unix';
		else if ( sBwAgent.indexOf("freebsd")!=-1)
			return 'Freebsd';
		else if ( sBwAgent.indexOf("bsd")!=-1)
			return 'Bsd';
		else if (sBwAgent.indexOf('windows ce') != -1)
			return 'Windows CE';
		else if (sBwAgent.indexOf("win")!=-1)
			return 'Windows';
}/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function GetJavascriptVersion(iVersion){	var iNewVersion = (((iVersion*10)+1)/10);	document.write('<scri'+'pt language="Javascript'+iVersion+'">');	document.write('sJsVersion = '+iVersion+';');	document.write('GetJavascriptVersion('+iNewVersion+');');	document.write('</scri'+'pt>');	return sJsVersion;	}
/*******************************************************
********************************************************
CHECK PLUGINS
********************************************************
*******************************************************/

/*******************************************************Detect the flash version of the browser*******************************************************/function DetectFlash(){
	flashVersion = 0;
	if (isIE && !isMac && !isMac45 ) {//FOR IE on WIN
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('bOk = true \n');
		document.write('iLoop = 2 \n');
		document.write('do while bOk = true \n');		document.write('iLoop = iLoop+1 \n');
		document.write('	bOk = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash."&iLoop)) \n');
		document.write('if iLoop > 9 OR bOk <> True OR (Err.number <> 0 AND iLoop >2)then \n');
		document.write('	bOk = False \n');
		document.write('end if \n');
		document.write('Loop\n');
		document.write('flashVersion = iLoop-1\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	else if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		}
	}
	return isNaN(flashVersion)?0:flashVersion;
}

/*******************************************************real player
*******************************************************/function checkRealPlayer(){
	if (navigator.plugins ) {
		var iPluginsCount = navigator.plugins.length;
		for (var i = 0 ; i < iPluginsCount; i++)	{
			var sPlugin = navigator.plugins[i];
			if (sPlugin.name.substring(0,10)=="RealPlayer")	
				return  true;
		}
	}
	else {
		var oMp7 = new ActiveXObject('WMPlayer.OCX');
		if (oMp7)
			return true;
	}
	return false;
    //document.write('<OBJECT ID=RealPlayerAX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" WIDTH=200 HEIGHT=200></OBJECT>');
	// realPlayer_IE = document.RealPlayerAX;
}
/*******************************************************windows media player
*******************************************************/function checkWindowsMediaPlayer(){
	if (!isIE ) {
		if (navigator.mimeTypes["application/x-mplayer2"] != null){
			return true;
		}
	}
	return false;
	//document.write('<OBJECT ID="MediaPlayerAX" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"></OBJECT>');
	//wma_IE = document.MediaPlayerAX;
}

/*
if (ie && win) {
	pluginlist =	detectIE("Adobe.SVGCtl","SVG Viewer") +	
						detectIE("SWCtl.SWCtl.1","Shockwave Director") + 
						detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + 
						detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + 
						detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + 
						detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + 
						detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win) {
		nse = ""; 
		for (var i=0;i<navigator.mimeTypes.length;i++) 
			nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}
function detectIE(ClassID,name) { 
	result = false; 
	document.write('<SCRIPT LANGUAGE=VBScript>\n '); 
	document.write('on error resume next \n '); 
	document.write('result = IsObject(CreateObject("' + ClassID + '"))'); 
	document.write('</SCRIPT>\n'); 
	if (result) 
		return name+','; 
	else 
		return ''; 
}
function detectNS(ClassID,name) {
	n = "";
	if (nse.indexOf(ClassID) != -1) 
		if (navigator.mimeTypes[ClassID].enabledPlugin != null) 
			n = name+","; 
	return n;
}

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) 
	pluginlist = pluginlist.substring(0,pluginlist.length-1);
*/

/**********************************************************
***********************************************************
*  Copyright 2004 (c) Aumediage S.P.R.L. All Rights Reserved.								*
*  This is a commercial software product, please visit												*
*  http://www.aumediage.net for more information. or send email to					*
*  aumediage@hotmail.com																						*
*  See http://www.aumediage.net for Commercial License Agreement				*
*  All Copyright statements must always remain in place in all files at all times	*
*		***** PLEASE NOTE: THIS IS NOT FREE SOFTWARE	*****						*
*				*****	IT MUST BE LICENSED FOR ALL USE	*****								*
*  HISTORY																												*
*	Name			Date							Action					Version									*
*	GdB				27/02/2003			Creation				1.00											*
																																	*
************************************************************
***********************************************************/
