<!--

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
		//alert(this.browser + "     " + this.version);
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera",
			versionSearch: "Version"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();






 var viewportwidth;
 var viewportheight;
  
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
  
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
  
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
 
 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
  
 // older versions of IE
  
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }

//document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
//-->

//alert(viewportwidth + ' / ' + viewportheight);


//calculam aspect ratio
 var viewportaspectratio = viewportwidth / viewportheight;
 var photowidth = 2219;
 var photoheight = 1120;
 var photoaspectratio = photowidth / photoheight;

 var proportieredimensionare = 0.9; //doar un default float


if (viewportaspectratio > photoaspectratio) { //nu intra toata inaltimea
	proportieredimensionare = viewportwidth / photowidth;
	//alert(proportieredimensionare);
}
else {  //nu intra toata latimea
	proportieredimensionare = viewportheight / photoheight;
}




	//alert(proportieredimensionare);






	if ((BrowserDetect.browser == "Explorer") && (BrowserDetect.version == "9")) { //aplicam filtrul si apoi amplasam linkurile in functie de redimensionare
		//alert("IE9");
		document.body.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='intro_.jpg', sizingMethod='scale');"		
		document.getElementById('LinkSuprapusIntro').style.marginLeft = Math.round( (485 * proportieredimensionare) - 150);	
		document.getElementById('LinkSuprapusIntro').style.marginTop = Math.round( -20 * proportieredimensionare );
		document.getElementById('linkintrare1').style.fontSize = Math.round( 18 * proportieredimensionare );
		document.getElementById('linkintrare2').style.fontSize = Math.round( 18 * proportieredimensionare );
	} 
	else if (((BrowserDetect.browser == "Explorer") && (BrowserDetect.version == "8")) || ((BrowserDetect.browser == "Explorer") && (BrowserDetect.version == "7")) || ((BrowserDetect.browser == "Explorer") && (BrowserDetect.version == "6"))){
		//pt versiuni mai vechi de IE trebuie sa redimensionam noi si apoi abia sa amplasam
		document.write("<div id='overthebackground'><img src='intro_.jpg' id='otbgimg'></div>");

				if (viewportaspectratio > photoaspectratio) { //nu intra toata inaltimea  //aici refacem poza
					document.getElementById('overthebackground').style.width = Math.round(photowidth / photoheight * viewportheight);
					document.getElementById('otbgimg').style.width = Math.round(photowidth / photoheight * viewportheight);
					//alert("latimea ar trebui sa fie mai mica decat ecranul");
				}
				else {  //nu intra toata latimea
					document.getElementById('overthebackground').style.width = Math.round(photowidth / photoheight * viewportheight);					
					document.getElementById('otbgimg').style.width = Math.round(photowidth / photoheight * viewportheight);					
					//alert("latimea ar trebui sa fie mai mare decat ecranul");

				}

		proportieredimensionare = viewportheight / photoheight;

		//proportieredimensionare = Math.round(photowidth / photoheight * viewportheight) / photowidth;
		//alert(proportieredimensionare);
		
		var latimefinalapoza = Math.round(photowidth / photoheight * viewportheight);
		var constanta = 0;
		if (latimefinalapoza>viewportwidth) { //ecranul adauga spatiu in dreapta si atunci centrarea se face prea in stanga...
			constanta = (latimefinalapoza - viewportwidth)/2;
		}
		document.getElementById('LinkSuprapusIntro').style.marginLeft = Math.round( (485 * proportieredimensionare) - 150 + constanta);	
		document.getElementById('LinkSuprapusIntro').style.marginTop = Math.round( -20 * proportieredimensionare );
		document.getElementById('linkintrare1').style.fontSize = Math.round( 18 * proportieredimensionare );
		document.getElementById('linkintrare2').style.fontSize = Math.round( 18 * proportieredimensionare );
		if (latimefinalapoza>viewportwidth) { //pun scrollul pe mijloc...
			window.scroll(constanta,0);
		}

	}
	else { //amplasam linkurile in functie de redimensionare
		document.getElementById('LinkSuprapusIntro').style.marginLeft = Math.round( (485 * proportieredimensionare) - 150);	
		document.getElementById('LinkSuprapusIntro').style.marginTop = Math.round( -20 * proportieredimensionare );
		document.getElementById('linkintrare1').style.fontSize = Math.round( 18 * proportieredimensionare );
		document.getElementById('linkintrare2').style.fontSize = Math.round( 18 * proportieredimensionare );
	}






 


