﻿function writeAddFavorite() {
	if (document.all && window.external)
		document.write('<img src="images/asterisk.gif" alt="*" title="Přidat do oblíbených" width="16" height="16" style="margin: 6px 0 0 443px; position: absolute; left: 50%; cursor: pointer;" onclick="window.external.AddFavorite(\'http://www.revize-instalaci.cz\',\'ELVA - elektrorevize\');" />');
}

function popupPaper() {
	if (document.getElementById) {
		document.getElementById('paper').className = 'popup';
		document.onclick = function() {
			if (document.getElementById('paper').style.display != 'none') {
				document.onclick = null;
				document.getElementById('paper').style.display = 'none';
			}
		};
	}
}

function disableSelection(target) {
	if (typeof target.onselectstart != 'undefined') {
		target.onselectstart = function() {
			return false;
		};
	} else if (typeof target.style.MozUserSelect != 'undefined') {
		target.style.MozUserSelect = 'none';
	} else {
		target.onmousedown = function() {
			return false;
		};
	}
	target.style.cursor = 'default';
}

function encrypt(ref) {
	ref.hash.value = hex_hmac_md5(hex_md5(ref.password.value), ref.hash.value);
	ref.password.disabled = true;
	ref.submit();
	ref.password.disabled = false;
	return false;
}

window.defaultStatus = 'ELVA - elektrorevize, Váš partner pro Vaše revize elektro a školení a přezkoušení z vyhlášky č. 50/1978 Sb.';

function hw1() {
	$('#hw1').css('color', '#F0ECE8');
	$('#hw1').animate({
		color: '#989898'
	}, 1500, 'swing', function() {
		$('#hw1').css('color', '#989898');
		setTimeout(hw2, 250);
	});
}

function hw2() {
	$('#hw2').css('color', '#F0ECE8');
	$('#hw2').animate({
		color: '#989898'
	}, 1500, 'swing', function() {
		$('#hw2').css('color', '#989898');
		setTimeout(hw3, 250);
	});
}

function hw3() {
	$('#hw3').css('color', '#F0ECE8');
	$('#hw3').animate({
		color: '#989898'
	}, 1500, 'swing', function() {
		$('#hw3').css('color', '#989898');
		setTimeout(hw1, 4000);
	});
}

jQuery(function($) {
	setTimeout(hw1, 2000);
});
