function gotoUrl(url){
	document.location.href = url;
	return true;
}
function hideDiv(id){
	if (document.getElementById) { // DOM3 = IE5, NS6 
		document.getElementById(id).style.display = 'none';
	} 
	else {
		if (document.layers) { // Netscape 4 
			document.id.display = 'none';
		} 
		else { // IE 4 
			document.all.id.style.display = 'none'; 
		} 
	} 
} 
function showDiv(id){
	if (document.getElementById) { // DOM3 = IE5, NS6 
		document.getElementById(id).style.display = 'block'; 
	} 
	else { 
		if (document.layers) { // Netscape 4 
			document.id.display = 'block'; 
		} 
		else { // IE 4 
			document.all.id.style.display = 'block'; 
		} 
	} 
}
function submitonce(theform){
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
	//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i]
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
	//disable em
			tempobj.disabled=true
		}
	}
}
//************
function mOver1f(id) {
	id.style.backgroundColor='#1f1f1f';
}
function mOut1a(id) {
	id.style.backgroundColor='#1a1a19';
}
//************
function mOverbbbc(id) {
	id.style.borderBottom='1px solid #bc4343';
}
function mOutbb00(id) {
	id.style.borderBottom='1px solid #000000';
}
//************
function mOverbtbc(id) {
	id.style.borderTop='1px solid #bc4343';
}
function mOutbt00(id) {
	id.style.borderTop='1px solid #000000';
}
//************
function menu5(id) {
	id.style.background="url('template/images/menu5_bg.gif') #111111";
}
function menu5a(id) {
	id.style.background="url('template/images/menu5_bg_a.gif') #000000";
}
//************
function menu6(id) {
	id.style.background="url('template/images/menu6_bg.gif') #111111";
}
function menu6a(id) {
	id.style.background="url('template/images/menu6_bg_a.gif') #000000";
}
//************
var Dom = {
	get: function(el) {
		if (typeof el === 'string') {
			return document.getElementById(el);
		}
		else{
			return el;
		}
	},
	add: function(el, dest) {
		var el = this.get(el);
		var dest = this.get(dest);
		dest.appendChild(el);
	},
	remove: function(el) {
		var el = this.get(el);
		el.parentNode.removeChild(el);
	}
};
var Event = {
	add: function() {
		if (window.addEventListener) {
			return function(el, type, fn) {
				Dom.get(el).addEventListener(type, fn, false);
			};
		}
		else if (window.attachEvent) {
			return function(el, type, fn) {
				var f = function() {
					fn.call(Dom.get(el), window.event);
				};
				Dom.get(el).attachEvent('on' + type, f);
			};
		}
	}()
};
Event.add(window, 'load', function() {
	var i = 2;
	Event.add('add-element', 'click', function() {
		var el = document.createElement('tr');
		el.innerHTML = '<td>' + ++i + '. válasz:</td><td><input type="text" name="option[]" /></td>';
		Dom.add(el, 'content');
		Event.add(el, 'click', function(e) {});
	});
});
//*****
function countdown_clock(year, month, day, hour, minute, format){
	html_code = '<span id="countdown"></span>';
	document.write(html_code);
	countdown(year, month, day, hour, minute, format);                
}

function countdown(year, month, day, hour, minute, format){
	Today = new Date();
	Todays_Year = Today.getFullYear() - 2000;
	Todays_Month = Today.getMonth();                  

	Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
	Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();                                 
	Target_Date = (new Date(year, month - 1, day, hour, minute, 00)).getTime();                  

	Time_Left = Math.round((Target_Date - Todays_Date) / 1000);

	if(Time_Left < 0) Time_Left = 0;
	switch(format){
		case 0:
		document.all.countdown.innerHTML = Time_Left + ' seconds';
		break;
		case 1:
		days = Math.floor(Time_Left / (60 * 60 * 24));
		Time_Left %= (60 * 60 * 24);
		hours = Math.floor(Time_Left / (60 * 60));
		Time_Left %= (60 * 60);
		minutes = Math.floor(Time_Left / 60);
		Time_Left %= 60;
		seconds = Time_Left;
		var days = '' + days + '';
		if(hours < 10){ var hours = '0' + hours + ''; }
		else{ var hours = '' + hours + ''; }
		if(minutes < 10){ var minutes = '0' + minutes + ''; }
		else{ var minutes = '' + minutes + ''; }
		if(seconds < 10){ var seconds = '0' + seconds + ''; }
		else{ var seconds = '' + seconds + ''; }
		

		document.all.countdown.innerHTML = '';
		if(days > 0 || hours > 00 || minutes > 00 || seconds > 00){
			if(days > 0){
				if(days > 9){
					document.all.countdown.innerHTML += '<img src="template/images/num_' + days.slice(0,1) + '.gif" alt="' + days.slice(0,1) + '" />';
					document.all.countdown.innerHTML += '<img src="template/images/num_' + days.slice(1) + '.gif" alt="' + days.slice(1) + '" />';
				}
				else{ document.all.countdown.innerHTML += '<img src="template/images/num_' + days + '.gif" alt="' + days + '" />'; }
				document.all.countdown.innerHTML += '<img src="template/images/num_d.gif" alt="nap" />';
			}
			document.all.countdown.innerHTML += '<img src="template/images/num_' + hours.slice(0,1) + '.gif" alt="' + hours.slice(0,1) + '" />';
			document.all.countdown.innerHTML += '<img src="template/images/num_' + hours.slice(1) + '.gif" alt="' + hours.slice(1) + '" /><img src="template/images/num_--.gif" alt=":" />';
			document.all.countdown.innerHTML += '<img src="template/images/num_' + minutes.slice(0,1) + '.gif" alt="' + minutes.slice(0,1) + '" />';
			document.all.countdown.innerHTML += '<img src="template/images/num_' + minutes.slice(1) + '.gif" alt="' + minutes.slice(1) + '" /><img src="template/images/num_--.gif" alt=":" />';
			document.all.countdown.innerHTML += '<img src="template/images/num_' + seconds.slice(0,1) + '.gif" alt="' + seconds.slice(0,1) + '" />';
			document.all.countdown.innerHTML += '<img src="template/images/num_' + seconds.slice(1) + '.gif" alt="' + seconds.slice(1) + '" />';
		}
		else{ document.all.countdown.innerHTML += '<img src="template/images/num_over.gif" alt="Irány a chat!" />'; }
		break;
		default: 
		document.all.countdown.innerHTML = Time_Left + ' seconds';
	}
	setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + format + ');', 1000);
}