/**
 * NAT AG
 * @author Younes Labdidi
 * Copyright notice
 * (c) 2010 younes labdidi <younes.labdidi@nat.eu>
 * @date: 28/01/2010
 * All rights reserved
 */

	function detectBrowser(pageId){
		//var gerMessage																	= 'Achtung, Sie benutzen keinen der empfohlenen Internet Browser! \n\nZur fehlerfreien Nutzung aller NAT Intranet Webapplikationen benutzen Sie bitte einen der empfohlenen Internet Browser:\n* Microsoft Internet Explorer ab Ver. 7\n* Mozilla Firefox ab Ver. 3.5';
		var gerMessage																		= 'Achtung, Sie benutzen keinen der empfohlenen Internet Browser! \n\nZur fehlerfreien Nutzung aller NAT Intranet Webapplikationen benutzen Sie bitte einen der empfohlenen Internet Browser:\n* Mozilla Firefox ab Ver. 3.5';
		//var ungMessage																	= 'Figyelem,Ön nem az ajánlott Internet Browser-t használja! \n\nHibamentes webalkalmazás érdekében használja az ajánlott Internet Browser egyikét:\n* Microsoft Internet Explorer 7\n* Mozilla Firefox 3.5';
		var ungMessage																		= 'Figyelem,Ön nem az ajánlott Internet Browser-t használja! \n\nHibamentes webalkalmazás érdekében használja az ajánlott Internet Browser egyikét:\n* Mozilla Firefox 3.5';
		//var engMessage																	= 'Attention, you are not using any of the recommended Internet Browser! \n For an error-free use of all NAT intranet web applications please use one of the recommended Internet Browsers:\n* Microsoft Internet Explorer from version 7\n* Mozilla Firefox from version 3.5';
		var engMessage																		= 'Attention, you are not using any of the recommended Internet Browser! \n For an error-free use of all NAT intranet web applications please use one of the recommended Internet Browsers:\n* Mozilla Firefox from version 3.5';
		var ungLang																			= document.URL.indexOf('L=1');
		var engLang																			= document.URL.indexOf('L=2');
		var message																			= ungLang != -1 ? ungMessage : (engLang != -1 ? engMessage : gerMessage);
		if(pageId == 124 || pageId == 355)													{
			//if(!(jQuery.browser.mozilla) && !(jQuery.browser.msie))						{
			if(!(jQuery.browser.mozilla))													{
				alert(message);
			}else																			{
				if(jQuery.browser.mozilla && (jQuery.browser.version.slice(0,3) < 1.9))		{ alert(message); }
				//if(jQuery.browser.msie && (parseInt(jQuery.browser.version) < 7))			{ alert(message); }
			}
		}
	}
		
	function playSoundLogo(){
		var soundLogoSwf = document.getElementById('SoundLogo');
		var msie = navigator.userAgent.indexOf('MSIE');
		if(soundLogoSwf){
			soundLogoSwf.style.display='block';
			if(msie != -1){
				soundLogoSwf.Play();
			}
		}
		aktiv 	= window.setTimeout("gotoStartPage()", 3000);
	}
	
	function gotoStartPage(){
		document.location.href='/';
		window.clearTimeout(aktiv);
	}
	
	function openWindow (url,name) {
		 newWindow = window.open(url,name, "width=650,height=750,left=300,top=100,menubar=no,toolbar=no,statusbar=no,directories=no,locationbar=no,resizable=no,scrollbars=no");
	 	 newWindow.focus();
	}
	
	var status = true;
	function blinker(elementId){
		element  				= document.getElementById(elementId);
		if(status){
			element.className = "blink";
		}else{
			element.className = 'blinkout';
		}
		status=!status;
	}
	
	function setPwmBlinkInterval(){
		blinker("nat_pwm");
	}

	function setIEDocumentModus(){
		//$jq 			  	= jQuery.noConflict();
		//$jq(document).ready(function() { });
		engine = null;
		if (window.navigator.appName == "Microsoft Internet Explorer"){
		   // This is an IE browser. What mode is the engine in?
		   if (document.documentMode){ // IE8
				//engine = document.documentMode;
				  engine = 7;
			}else {
			   // IE 5-7
			  engine = 5; // Assume quirks mode unless proven otherwise
			  if (document.compatMode){
				 if (document.compatMode == "CSS1Compat")
					engine = 7; // standards mode
			  }
		   }
		   // the engine variable now contains the document compatibility mode.
		   //alert(document.documentMode);
		   alert(engine);
		}
	}
	//setIEDocumentModus();
