function a1() {
	document.getElementById('L1').style.display = 'none';
	document.getElementById('L2').style.display = 'none';
	if(document.getElementById('L3')) {
		document.getElementById('L3').style.display = 'none';
	}
	document.getElementById('ML').style.display = 'none';
	document.getElementById('Lparking').style.display = 'none';
	document.getElementById('Lss').style.display = 'block';
	document.getElementById('A').style.display = "none";
	document.getElementById('B').style.display = "none";
}

function isIE6() {
	var strChUserAgent = navigator.userAgent;
	var intSplitStart = strChUserAgent.indexOf("(",0);
	var intSplitEnd = strChUserAgent.indexOf(")",0);
	var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

	if(strChMid.indexOf("MSIE 6") != -1) {
		return true;	
	}
}

function isIE7() {
	var strChUserAgent = navigator.userAgent;
	var intSplitStart = strChUserAgent.indexOf("(",0);
	var intSplitEnd = strChUserAgent.indexOf(")",0);
	var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

	if(strChMid.indexOf("MSIE 7") != -1) {
		return true;	
	}
}

function opac(ie)
{
	var A = document.getElementById("A");
	var B = document.getElementById("B");
	document.body.style.overflow="hidden";
	pageTracker._trackPageview('/download/');

	if(isIE6()) {
		myHeight = document.body.clientHeight;
		document.body.style.height = document.documentElement.clientHeight + "px";
		A.style.height = myHeight;
		B.style.height = myHeight;
		B.style.top = document.documentElement.scrollTop + 50;
	}
	
	var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
	if(height < 600) {
		B.style.top = 0;
		if(isIE7()) {
			B.style.position = "absolute";
		}
	}

	if(height < 540 && !isIE6() && !isIE7()) {
		height -= 10;
		var downloadWindow = document.getElementById("download-window");
		downloadWindow.style.height = height  + "px";
		downloadWindow.style.overflow = "auto";
	}
		
	A.style.visibility = "visible";
	B.style.visibility = "visible";
	
}

function desopac() {
	window.location.href = "http://" + window.location.hostname + "/meteo";
}

function download() {
	var checked = document.getElementById("mpa").checked;
	var tag = '/AcceptResetv3/';
	var formToSubmit = "frmexeok";
	if(! checked) {
		tag = '/RefuseResetv3/';
		formToSubmit = "frmexeko";
	}
	a1();
	var url = document.getElementById(formToSubmit).action;
	var exe = window.open(url,'exe','width=1,height=1, top=1, left=1');
	exe.blur();
	
	document.body.style.overflow="auto";
	document.getElementById("A").style.visibility = "hidden";
	document.getElementById("B").style.visibility = "hidden";
	pageTracker._trackPageview(tag);
}

