var compat = true;


function like(width, height, faces, colorscheme, layout, send, fbml, appID) {
	/*default values*/
	if (width === null) {		width = 450;	}
	if (height === null) {	height = 80;	}
	if (faces === null) {		faces = 'true';	}
	if (colorscheme === null) {		colorscheme = 'light';	}
	if (layout === null) {		layout = 'standard';	}
	if (typeof (fbml) === 'undefined' || fbml !== true) {		fbml = false;	}
	if (send === true) {
		if(fbml) {
			send = ' send="true"';
		} else {
			send = '&amp;send=true';
		}
	} else {
		send = '';
	}
	if(typeof (appID)==='undefined') { appID=''; }
	
	if(!fbml) {
		document.write('<iframe src="http://www.facebook.com/widgets/like.php?app_id=' + appID + '&amp;show_faces=' + faces + '&amp;colorscheme=' + colorscheme + '&amp;layout=' + layout + '" scrolling="no" frameborder="0" style="border:none; width:' + width + 'px; height:' + height + 'px;" allowTransparency="true"></iframe>');
	} else {
		if(typeof (FB)==='undefined') {
			document.write('<script src="http://connect.facebook.net/hu_HU/all.js#appId=' + appID + '&amp;xfbml=1"></script>');
		}
		document.write('<fb:like' + send + ' width="' + width + '" show_faces="' + faces + '" font="tahoma" layout="' + layout + '"></fb:like>');
	}
}

function recommend(width, height, faces, colorscheme, layout, fbml, href, type, font, send, appID) {
	/*default values*/
	if (width === null) {		width = 450;	}
	if (height === null) {	height = 80;	}
	if (faces === null) {		faces = 'true';	}
	if (colorscheme === null) {		colorscheme = 'light';	}
	if (layout === null) {		layout = 'standard';	}
	if (fbml === null) {		fbml = false;	}
	if (href === null) {		href = encodeURIComponent(location.href);	}
	if (type !== null) {		type = ' action="recommend" ';	} else { type=''; }
	if (font === null) {		font = 'tahoma';	}
	if (send === true) {		if(fbml) {send = ' send="true"'; } else { send = '&amp;send=true'; }	} else { send = ''; }
	if(typeof (appID)==='undefined') { appID=''; }
	
	if(fbml) {
		document.write('<iframe src="http://www.facebook.com/plugins/like.php?app_id=' + appID + '&amp;action=recommend&amp;show_faces=' + faces + '&amp;colorscheme=' + colorscheme + '&amp;layout=' + layout+send + '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' + width + 'px; height:' + height + 'px;" allowTransparency="true"></iframe>');
	} else {
		if(typeof (FB)==='undefined') {
			document.write('<script src="http://connect.facebook.net/hu_HU/all.js#appId=' + appID + '&amp;xfbml=1"></script>');
		}
		document.write('<fb:like' + send + ' show_faces="' + faces + '" width="' + width + '" colorscheme=' + colorscheme+type + ' font="' + font + '"></fb:like>');
	}
}

function tweet(framed, width, height, count) {
	/*default values*/
	if (framed === null) {	framed = true;	}
	if (width === null) {		width = 130;	}
	if (height === null) {	height = 50;	}
	if (count === null) {		count = 'standard';	}
	
	if(framed==true) {
	code='<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?count=' + count + '&amp;via=Koeroesi86" style="width:' + width + 'px; height:' + height + 'px;"></iframe>';
	} else{        
	code='<a href="http://twitter.com/share" class="twitter-share-button" data-count="' + count + '" data-via="Koeroesi86">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
	}
	document.write(code);
}

function iwiw(t, s, title, width, height) {
	
	/*
	t lehet: tetszik,kiraly, zsir, szeretem, simiznem, ezjo, ajanlom, osztom, komoly, bejon, imadom, cuki, lajk, kul, szexi, laza, izlik, fincsi, bevallalnam, trendi, csucs, megszavazom, dogos, fajin, oromteli, lol, habarnam, rantanam, megsutnem, megfoznem, jatszanam, megvennem, igen, drotoznam, tesztelnem, kiprobalnam, oltanam, osztanam, pompas, kedvelem, atjon, sun, homar, nyul, negynegynegy, iwiwgyanus, nemtetszik, nemjo, nemajanlom, komolytalan, nemizlik, buntet, leszavazod, ciki, szomoru, nem, nemkedvelem, nemjonat, elegtelen, badarsag, mondjonle, kifutyulom, lekarateznam, buksiznam, ultragaz
	Ha t nincs megadva, akkor megosztási link lesz.
	
	s lehet: white, blue
	
	width: szélesség pixelben
	height: magasság pixelben
	*/
	
	if (width === null) {		width = 220;	}
	if (height === null) {	height = 21;	}
	if (t !== null) {	t = '&t=' + t;	} else { t = ''; }
	if (s === null) {	s = 'white';	}
	if (title === null) {	title = document.title;	} else { title = title; }
	code="<iframe src='http://iwiw.hu/like.jsp?u="+encodeURIComponent(document.location)+"&title="+encodeURIComponent(title)+t+"&s="+s+"' width='"+width+"px' height='"+height+"px' style='border: none' scrolling='no' frameBorder='0'></iframe>";
	
	document.write(code);
}

function plusone(size, lang, count, dhref) {
	
	if(typeof (size)==="undefined") { size="standard"; }
	if(typeof (lang)==="undefined") { lang="hu"; }
	if(typeof (count)==="undefined") { count="false"; }
	if(typeof (dhref)==="undefined") { dhref=document.location; }
	
	jQuery('head').append('<script type="text/javascript" src="https://apis.google.com/js/plusone.js">{lang: "' + lang + '"}</script>');
	code='<div style="height: auto; overflow-y:hidden;"><g:plusone size="' + size + '" count="' + count + '"></g:plusone></div>';
	
	document.write(code);
}

function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function getCookie(c_name)
{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
		{
		c_start=c_start + c_name.length+1;
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		return unescape(document.cookie.substring(c_start,c_end));
		}
	  }
	return "";
}

function eraseCookie(c_name) {
	setCookie(c_name,"",-1);
}

function change() {
	player=getCookie("player");
	if (player==2 || player=='')
	  {
		setCookie("player", 1,365);
	  }
	else
	  {
		eraseCookie("player");
		setCookie("player", 2,365);
	  }
}

function share(width, height, own) {
	if (width === null || (width!=16 && width!=32 && width!=64 && width!=128)) {		width = 16;	}
	if (height === null || (height!=16 && height!=32 && height!=64 && height!=128)) {	height = 16;	}
	if (own === null || (own!=true && own!=false)) {		own = true;	}
	if(own) {
		twitter		= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/Twitter 02.jpg";
		facebook	= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/Facebook.jpg";
		startlap	= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/startlap.jpg";
		iwiw		= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/iwiw2.jpg";
		google		= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/Google.jpg";
		myspace		= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/Myspace.jpg";
		delicious	= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/Delicious.jpg";
		digg		= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/Digg 01.jpg";
		thumblr		= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/Thumblr.jpg";
		stumble		= "http://korosikrisztian.hu/images/icons/icon_pack/"+width+"/StumbleUpon 02.jpg";
	} else {
		twitter		= "http://kepfeltoltes.hu/100218/Twitter_02_www.kepfeltoltes.hu_.png";
		facebook	= "http://kepfeltoltes.hu/100218/Facebook_www.kepfeltoltes.hu_.png";
		startlap	= "http://kepfeltoltes.hu/100218/startlap_www.kepfeltoltes.hu_.png";
		iwiw		= "http://kepfeltoltes.hu/100218/iwiw_www.kepfeltoltes.hu_.png";
		google		= "http://kepfeltoltes.hu/100218/Google_www.kepfeltoltes.hu_.png";
		myspace		= "http://kepfeltoltes.hu/100218/Myspace_www.kepfeltoltes.hu_.png";
		delicious	= "http://kepfeltoltes.hu/100218/Delicious_www.kepfeltoltes.hu_.png";
		digg		= "http://kepfeltoltes.hu/100218/Digg_01_www.kepfeltoltes.hu_.png";
		thumblr		= "http://kepfeltoltes.hu/100218/Thumblr_www.kepfeltoltes.hu_.png";
		stumble		= "http://kepfeltoltes.hu/100218/StumbleUpon_02_www.kepfeltoltes.hu_.png";
	}
	
document.write("<a target=\"_blank\" href=\"http://www.twitter.com/\" onclick=\"window.open('http://twitter.com/home?status=' + encodeURIComponent(document.title) + ' ' + encodeURIComponent(location.href));return false;\" title=\"Add a Twitter-hez\"><img border=\"0\" alt=\"Add a Twitter-hez\" src=\""+twitter+"\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");


document.write("<a target=\"_blank\" href=\"http://www.facebook.com/\" onclick=\"window.open('http://www.facebook.com/share.php?u=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title));return false;\" title=\"Add a Facebook-hoz\"><img border=\"0\" alt=\"Add a Facebook-hoz\" src=\""+facebook+"\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
		
document.write("<a target=\"_blank\" href=\"http://www.startlap.hu/\" onclick=\"window.open('http://www.startlap.hu/sajat_linkek/addlink.php?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title));return false;\" title=\"Add a Startlaphoz\"><img border=\"0\" alt=\"Add a Startlaphoz\" src=\""+startlap+"\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
		
document.write("<a target=\"_blank\" href=\"http://www.iwiw.hu/\" onclick=\"window.open('http://iwiw.hu/pages/share/share.jsp?u=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title));return false;\" title=\"Add az iWiW-hez\"><img border=\"0\" alt=\"Add az iWiW-hez\" src=\""+iwiw+"\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
		
document.write("<a class=\"google-share\" href=\"javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&amp;&amp;!document.xmlVersion) {void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/link-bookmarklet.js');void(b.appendChild(z));}else{}\" title=\"Add a Google Reader-hez\"><img border=\"0\" alt=\"Add a Google Reader-hez\" src=\""+google+"\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
document.write("<a target=\"_blank\" href=\"http://www.myspace.com/\" onclick=\"window.open('http://www.myspace.com/index.cfm?fuseaction=postto&l=3&u=' + encodeURIComponent(location.href) + '&t=' + encodeURIComponent(document.title));return false;\" title=\"Add a Myspace-hez\"><img src=\""+myspace+"\" border=\"0\" alt=\"Add a Myspace-hez\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
document.write("<a target=\"_blank\" href=\"http://del.icio.us/\" onclick=\"window.open('http://del.icio.us/post?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title));return false;\" title=\"Add a Delicious-hoz\"><img src=\""+delicious+"\" border=\"0\" alt=\"Add a Delicious-hoz\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
document.write("<a target=\"_blank\" href=\"http://digg.com/\" onclick=\"window.open('http://digg.com/submit?phase=2&amp;url=' + encodeURIComponent(location.href));return false;\" title=\"Add a Digg-hez\"><img src=\""+digg+"\" border=\"0\" alt=\"Add a Digg-hez\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
document.write("<a target=\"_blank\" href=\"http://www.tumblr.com/\" onclick=\"window.open('http://www.tumblr.com/share?v=3&u=' + encodeURIComponent(location.href) + '&t=' + encodeURIComponent(document.title));return false;\" title=\"Add a Tumblr-hez\"><img src=\""+thumblr+"\" border=\"0\" alt=\"Add a Tumblr-hez\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
		
document.write("<a target=\"_blank\" href=\"http://www.stumbleupon.com/\" onclick=\"window.open('http://www.stumbleupon.com/submit?url=' + encodeURIComponent(location.href));return false;\" title=\"Add a Stumble-höz\"><img src=\""+stumble+"\" border=\"0\" alt=\"Add a Stumble-hoz\" style=\"width:"+width+"px;height:"+height+"px;\" /></a>");
}

function player(width, height, playerid, videoid, livestream, customparams) {
	/*default values*/
	if (typeof (width) === 'undefined') {		width = 400;	}
	if (typeof (height) === 'undefined') {	height = 300;	}
	if (typeof (playerid) === 'undefined') {	playerid = 'liveplayer';	}
	if (typeof (videoid) === 'undefined') {	videoid = '';	} else { videoid = '&amp;vid=' + videoid; }
	if (typeof (livestream) === 'undefined') {	livestream = '';	} else { livestream = '&amp;live=' + livestream; }
	
	var c_pars='';
	if(typeof (customparams) === 'object') {
		c_pars='&amp;o_w=' + customparams.origwidth + '&amp;o_h=' + customparams.origheight;
	}
	/*
	old version
	code='<iframe src="http://korosikrisztian.hu/php/player.php?width=' + width + '&amp;height=' + height+videoid+livestream+c_pars + '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' + width + 'px; height:' + height + 'px;" allowTransparency="true"></iframe>';
	*/
	code='<iframe src="http://korosikrisztian.hu/php/getdata.php?page=live-f1&amp;override&amp;width=' + width + '&amp;height=' + height+videoid+livestream+c_pars + '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' + width + 'px; height:' + height + 'px;" allowTransparency="true"></iframe>';
	
	document.getElementById(playerid+"").innerHTML=code+"";
	
}

function openPage(str, content_holder) {
	if(typeof (content_holder)==="undefined") { content_holder="#content_wrapper"; }
	var loc='';
	if(typeof (top.location.href)!="undefined") { loc=top.location.href; }
	/*if (loc.indexOf("korosikrisztian") ==-1 && (str=="1" || str=="fooldal" || typeof (str)==="undefined") && str!="fbml-embed") {
		str="fbml-embed";
	} else {
		
	}*/
	window.setTimeout(function() {
		$.ajax({
		  url: "http://" + window.location.hostname + "/php/getdata.php?page="+str,
		  context: content_holder,
		  /*timeout: 5000,*/
		  success: function(data) {
			$(content_holder).html(data);
		  }
	});}, 100);
}

function extPage(url, holder) {
$(holder).load("http://" + window.location.hostname + "/php/getdata.php?page=proxy&override&url="+encodeURIComponent(url));
}

function submitform(id, writer, message) { 
	if (id === null) { id = this; }
	if (writer === null) { writer = "#defaultw"; }
	if (message === null) { message = "Sikerült."; }
	
	var currentTime = new Date();
	var hours = currentTime.getHours();
	var minutes = currentTime.getMinutes();
	
	if(hours<10) {hours='0' + hours;}
	if(minutes<10) {minutes='0' + minutes;}
	
	$.ajax({ 
		type: "POST",
		url: "php/postdata.php",
		data: $(id).serialize(),
		dataType: "html",
		success: function(data) {
			msg='<span class="messageholder">' + data + '</span><img src="/images/icons/accepted_48.png" style="width: 12px; height: 12px; display: inline;" /> ' + hours + ':' + minutes;
			$(writer).html(msg);
			$(".messageholder").hide();
			$(".messageholder").fadeIn("slow");
			setTimeout('$(".messageholder").fadeOut("slow");', 1500);
		}
	}); 
	return false;
}

function show_hide_chat() {
	$(".fb_chat").toggle("slow"); 
}

function menu(mainelement, bordertopto, borderbottomto, extlinks) {
	if (mainelement === null) {
		mainelement= 'main'; /*the name of the shown  element on load*/
	}
	
	if(typeof (extlinks)==="undefined" || extlinks) {
		$('body a').filter(function() {
			 return this.hostname && this.hostname !== location.hostname;
        }).addClass('externalLink').attr('target', '_blank');
	}
	
	if (bordertopto === null) { bordertopto= "#cccccc"; }
	if (borderbottomto === null) { borderbottomto= "#cccccc"; }
	
	bordertopfrom=$('#dolphinnav a').css('border-top-color');
	borderbottomfrom=$('#dolphin_inner a').css('border-bottom-color');
	
	if ( (!$.browser.msie && !$.browser.mozilla) || compat ) {
		$(document).ready(function() {
			$('#dolphinnav a').removeClass('current');
			$('#dolphinnav a[rel=' + mainelement + ']').addClass('current');
			$('#dolphinnav a.current').animate({ borderTopColor: bordertopto }, 500);
			$('#dolphin_inner div').hide();
			$('#dolphin_inner div#' + mainelement).fadeIn(500);
			$('#dolphincontainer').hide();
			$('#dolphin_inner').hide();
		});
		
		$(window).load(function() {
			$('#dolphincontainer').fadeIn(200);
			$('#dolphin_inner').delay(500).fadeIn(500);
		});
		
		
		/*the dolphintabs jquery version*/
		$('#dolphinnav a').bind('mouseenter', function() {
			var getvalue = $(this).attr('rel');
				
			if($('#dolphin_inner div#' + getvalue).is(":hidden")) {
				/*reset values*/
				$('#dolphinnav a').removeClass('current');
				$('#dolphinnav a').animate({ borderTopColor: bordertopfrom }, 5);
				
				/*current parent animation*/
				$(this).addClass('current');
				$(this).animate({ borderTopColor: bordertopto }, 500);
				
				/*actual menu animation*/
				$('#dolphin_inner div').fadeOut(100);
				$('#dolphin_inner div#' + getvalue).fadeIn(250);
			}
		});
		
		$('#dolphin_inner a').bind('mouseenter', function() {
			$(this).animate({ borderBottomColor: borderbottomto }, 500);
		});
		
		$('#dolphin_inner a').bind('mouseleave', function() {
			$(this).animate({ borderBottomColor: borderbottomfrom }, 500);
		});
	} else {
		$(document).ready(function() {
			$('#dolphinnav a').removeClass('current');
			$('#dolphinnav a[rel=' + mainelement + ']').addClass('current');
			$('#dolphinnav a').css({ 'border-top-color': bordertopto });
			$('#dolphin_inner div').hide();
			$('#dolphin_inner div#' + mainelement).show();
		});
		
		
		/*the dolphintabs jquery version*/
		$('#dolphinnav a').bind('mouseenter', function() {
			var getvalue = $(this).attr('rel');
				
			if($('#dolphin_inner div#' + getvalue).is(":hidden")) {
				/*reset values*/
				$('#dolphinnav a').removeClass('current');
				$('#dolphinnav a').css({ 'border-top-color': bordertopfrom });
				
				/*current parent animation*/
				$(this).addClass('current');
				/*$(this).animate({ borderTopColor: bordertopto }, 500);*/
				$('#dolphinnav a').css({ 'border-top-color': bordertopfrom });
				
				/*actual menu animation*/
				$('#dolphin_inner div').hide();
				$('#dolphin_inner div#' + getvalue).show();
			}
		});
		
		$('#dolphin_inner a').bind('mouseenter', function() {
			$(this).css({ 'border-bottom-color': borderbottomto });
		});
		
		$('#dolphin_inner a').bind('mouseleave', function() {
			$(this).css({ 'border-bottom-color': borderbottomfrom });
		});
	}
}

function taskbar(to, ineasing, outeasing, waittime, container, direction, stopper) {
	/*taskbar*/
	taskbarto=to;
	taskbarfrom=0;
	t=null;
	if(typeof stopper=='undefined') { stopper = true; }
	if ( (!$.browser.msie && !$.browser.mozilla) || compat ) {
		if(stopper) {
			switch(direction) {
				case 'top':
					$(document).ready(function() { $(container).animate({ top: -$(container).height() }, outeasing); });
					$(window).load(function() { $(container).delay(waittime*2).animate({ top: -taskbarto }, outeasing*2); });
					$(container)
						.mouseenter(function() { clearTimeout(t); $(this).animate({ top: taskbarfrom }, ineasing); })
						.mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).animate({ top: -taskbarto }, outeasing); }, waittime); });
					break;
				case 'right':
					$(document).ready(function() { $(container).animate({ right: -$(container).width() }, outeasing); });
					$(window).load(function() { $(container).delay(waittime*2).animate({ right: -taskbarto }, outeasing*2); });
					$(container)
						.mouseenter(function() { clearTimeout(t); $(this).animate({ right: taskbarfrom }, ineasing); })
						.mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).animate({ right: -taskbarto }, outeasing); }, waittime); });
					break;
				case 'bottom':
					$(document).ready(function() { $(container).animate({ bottom: -$(container).height() }, outeasing); });
					$(window).load(function() { $(container).delay(waittime*2).animate({ bottom: -taskbarto }, outeasing*2); });
					$(container)
						.mouseenter(function() { clearTimeout(t); $(this).animate({ bottom: taskbarfrom }, ineasing); })
						.mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).animate({ bottom: -taskbarto }, outeasing); }, waittime); });
					break;
				default:
					$(document).ready(function() { $(container).animate({ left: -$(container).width() }, outeasing); });
					$(window).load(function() { $(container).delay(waittime*2).animate({ left: -taskbarto }, outeasing*2); });
					$(container)
						.mouseenter(function() { clearTimeout(t); $(this).animate({ left: taskbarfrom }, ineasing); })
						.mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).animate({ left: -taskbarto }, outeasing); }, waittime); });
			}
		}
	} else {
		if(stopper) {
			switch(direction) {
				case 'top':
					$(document).ready(function() { $(container).css({ 'top': -taskbarto }); });
					$(container).mouseenter(function() { clearTimeout(t); $(this).css({ 'top': taskbarfrom }); });
					$(container).mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).css({ 'top': -taskbarto }); }, waittime); });
					break;
				case 'right':
					$(document).ready(function() { $(container).css({ 'right': -taskbarto }); });
					$(container).mouseenter(function() { clearTimeout(t); $(this).css({ 'right': taskbarfrom }); });
					$(container).mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).css({ 'right': -taskbarto }); }, waittime); });
					break;
				case 'bottom':
					$(document).ready(function() { $(container).css({ 'bottom': -taskbarto }); });
					$(container).mouseenter(function() { clearTimeout(t); $(this).css({ 'bottom': taskbarfrom }); });
					$(container).mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).css({ 'bottom': -taskbarto }); }, waittime); });
					break;
				default:
					$(document).ready(function() { $(container).css({ 'left': -taskbarto }); });
					$(container).mouseenter(function() { clearTimeout(t); $(this).css({ 'left': taskbarfrom }); });
					$(container).mouseleave(function() { clearTimeout(t); t=setTimeout(function() { $(container).css({ 'left': -taskbarto }); }, waittime); });
			}
		}
	}
}

function menumove(from, to) {
	if(!$.browser.msie) {
		/*load to var*/
		code=$(from).html();
		/*cleanup*/
		$(from).html('');
		/*load to another place*/
		$(to).hide();
		$(to).html(code);
		
		menu('author', '#cccccc', '#cccccc');
		$('div#dolphincontainer').animate({ opacity: 1 }, 50);
		$('a.navigation_link').bind('mouseup', function() {
			if ($(to).is(':visible')) {
				$(to).animate({ height: 'toggle' }, 200);
				$('div.taskbar').animate({ height: 38 }, 200);
			} else {
				$(to).animate({ height: 'toggle' }, 500);
				$('div.taskbar').animate({ height: 230 }, 200);
			}
		}).bind('touchend', function() {
			if ($(to).is(':visible')) {
				$(to).animate({ height: 'toggle' }, 200);
				$('div.taskbar').animate({ height: 38 }, 200);
			} else {
				$(to).animate({ height: 'toggle' }, 500);
				$('div.taskbar').animate({ height: 230 }, 200);
			}
		});
		
		$('a.navigation_link').after('<div class="feature"><strong style="padding: 0 5px 0 7px; font-weight: bold;">&dArr;</strong><sup>Navigációs menü</sup></div>');
		
		pos=$('a.navigation_link').offset();
		
		if(!$.browser.msie) {
			$('.feature').
				css('position', 'absolute').
				offset({ top: pos.top-$('a.navigation_link').height()-10, left: pos.left+($('a.navigation_link').width()/2)});
		}
		
		blinking('.feature', '#999999', '#ffffff', 500, 500);
		
		loadscreen();
	}
}

function blinking(what, from, to, blinktime, interval) {
	window.blinker = setInterval(function() {
       if ( (!$.browser.msie && !$.browser.mozilla) || compat ) {
			if(window.blink) {
			   $(what).animate({ color: from }, blinktime);
			   window.blink=false;
			} else {
				$(what).animate({ color: to }, blinktime);
				window.blink = true;
			}
	   } else {
		   if(window.blink) {
			   $(what).css({ 'color': from });
			   window.blink=false;
			} else {
				$(what).css({ 'color': to });
				window.blink = true;
			}
	   }
    }, interval);
}

function loadscreen(filename, lclass, fadetime, delaytime) {
	if(typeof (filename)=='undefined') { filename='php/load.php'; }
	if(typeof (lclass)=='undefined') { lclass='loadscreen'; }
	if(typeof (fadetime)=='undefined') { fadetime=500; }
	if(typeof (delaytime)=='undefined') { delaytime=0; }
	
	/*$(document).ready(function() {*/
	$("body").append('<div class="' + lclass + '"></div>');
	$.get(filename, function(data) {
		$('.' + lclass).html(data);
	});
	if(!$.browser.msie) {
		$('.' + lclass).show().
			width($(document).width()).
			height($(document).height()).
			css({
				'z.index'	: '1000',
				'position'	: 'absolute',
				'top'		: '0',
				'left'		: '0'
				});
	}
	/*});*/
	$(window).load(function() {
		if ( (!$.browser.msie && !$.browser.mozilla) || compat ) {
			if(delaytime>0) {
				setTimeout(function() { $('.' + lclass).fadeOut(fadetime); }, delaytime);
			} else {
				$('.' + lclass).fadeOut(fadetime);
			}
		} else {
			if(delaytime>0) {
				setTimeout(function() { $('.' + lclass).hide(); }, delaytime);
			} else {
				$('.' + lclass).hide();
			}
		}
	});
}

function loginpanel(holder, panelpage, styling) {
	$(holder).hide();
	$.ajax({
		url: "php/getdata.php?page="+panelpage+"&amp;override",
		timeout: 2000,
		success: function(html) {
			$(holder).html(html);
		}
	});
	$(holder).css(styling);
	$(holder).show();
	$(holder).hide();
}

function mainchanger(textto, to, fadetime) {
	if(typeof (fadetime)==="undefined") { fadetime=parseInt(250, 10); }
	if ( (!$.browser.msie && !$.browser.mozilla) || compat ) {
		$(textto+"").fadeOut(parseInt(fadetime, 10), function() {
			$(textto+"").html(to).fadeIn(parseInt(fadetime, 10));
		});
	} else {
		$(textto+"").hide(parseInt(fadetime, 10), function() {
			$(textto+"").html(to).show(parseInt(fadetime, 10));
		});
	}
}

function mainslideshow(ids, contents, parentcontainer, delay, fadetimes, slideshowerid, aclass) {
	if(typeof (fadetimes)==="undefined") { fadetimes=250; }
	if(typeof (delay)==="undefined") { delay=1000; }
	if(typeof (slideshowerid)==="undefined") { slideshowerid="#szoveg"; }
	if(typeof (aclass)==="undefined") { aclass="selected"; }
	if(typeof (parentcontainer)==="undefined") { parentcontainer=".ChangeMenu"; }
	var h=0;
	var i=0;
	var j=0;
	var t=0;
	var arLen=ids.length-1;
	$(document).ready(function() {
		t=setInterval(function() {
				if(i>0) { h=i-1; } else { h=ids.length-1; }
				$(ids[h]).removeClass(aclass);
				if(!$(ids[i]).hasClass(aclass)) {
					mainchanger(slideshowerid, contents[i], fadetimes);
					/*
					if($(ids[i] + ' a').attr('href').length>0) {
						$(slideshowerid).append('</a>').prepend('<a href="' + $(ids[i] + ' a').attr('href') + '" target="_blank">');
					}
					*/
					$(ids[i]).addClass(aclass);
				}
				if(i==arLen) {
					i=0;
				} else {
					i++;
				}
		}, delay);
	});
	$(parentcontainer).mouseleave(function() {
		t=setInterval(function() {
				if(i>0) { h=i-1; } else { h=ids.length-1; }
				$(ids[h]).removeClass(aclass);
				if(!$(ids[i]).hasClass(aclass)) {
					mainchanger(slideshowerid, contents[i], fadetimes);
					/*
					if($(ids[i] + ' a').attr('href').length>0) {
						$(slideshowerid).append('</a>').prepend('<a href="' + $(ids[i] + ' a').attr('href') + '" target="_blank">');
					}
					*/
					$(ids[i]).addClass(aclass);
				}
				if(i==arLen) {
					i=0;
				} else {
					i++;
				}
		}, delay);
	}).mouseenter(function() {
		clearInterval(t);
		$.each(ids, function(i, val) {
			$(val).mouseenter(function() {
				if(!$(val).hasClass(aclass)) {
					mainchanger(slideshowerid, contents[i], fadetimes);
					$(parentcontainer+" *").removeClass(aclass);
					$(val).addClass(aclass);
					/*
					if($(val + ' a').attr('href').length>0) {
						$(slideshowerid).append('</a>').prepend('<a href="' + $(val + ' a').attr('href') + '" target="_blank">');
					}
					*/
				}
			});
		});
	});
}

function tooltip(txt, container, cllr, type, durations, tooltipid, customvars) {
	if(typeof (txt)==="undefined") { txt='Nincs megadott érték.'; }
	if(typeof (container)==="undefined") { container='#content_wrapper'; }
	if(typeof (type)==="undefined") { type='info'; }
	if(typeof (tooltipid)==="undefined") { tooltipid='tooltip'; }
	if(typeof (durations)==="undefined") { durations=500; }
	
	xOffset = 0;
	yOffset = 20;
	
		if(!$('#' + tooltipid).length) {
			$(container).append('<div id="' + tooltipid + '"></div>');
		}
		$('#' + tooltipid).hide().html(txt).addClass(type);
		if(typeof (customvars)==="object") {
			$('#' + tooltipid).css(customvars)
		}
		var os=$(cllr).position();
		return $("#"+tooltipid).
			css("position", "absolute").
			css("top", (os.top - yOffset) + "px").
			css("left", (os.left + xOffset) + "px").
			fadeIn(durations);
}

function hidetooltip(durations, tooltipid) {
	if(typeof (durations)==="undefined") { durations=250; }
	if(typeof (tooltipid)==="undefined") { tooltipid='tooltip'; }
	
	return $('#'+tooltipid).fadeOut(durations).removeClass();
}

function menuhover(mainelement, bordertopto, borderbottomto, extlinks) {
	if (mainelement === null) {
		mainelement= 'main'; /*the name of the shown  element on load*/
	}
	
	$('body a').filter(function() {
			 return this.hostname && this.hostname !== location.hostname;
        }).addClass('externalLink').attr('target', '_blank');
	
	if (typeof (bordertopto) === "undefined") { bordertopto= "#cccccc"; }
	if (typeof (borderbottomto) === "undefined") { borderbottomto= "#cccccc"; }
	
	bordertopfrom=$('.navigation li').css('border-top-color');
	borderbottomfrom=$('.navigation li ul li').css('border-bottom-color');
	$('.navigation a').animate({ borderTopColor: bordertopfrom }, 500);
	//menu hover effects
	var t=null;
	$(".navigation li ul").hide();
$('.navigation li:first-child').addClass('sfhover').animate({ borderTopColor: bordertopto}, 500).find("ul").fadeIn(500);
	$(".navigation li").mouseenter(function(){
		var el = this;
		$(el).siblings().removeClass('sfhover').find("ul").fadeOut(100);
		$(el).animate({ borderTopColor: bordertopto, borderBottomColor: borderbottomto }, 500).addClass('sfhover').find("ul").fadeIn(500);
		$(el).find("ul").css('left', 'auto');
	}).mouseleave(function(){
		var el = this;
	//$(el).removeClass('sfhover').find("ul").fadeOut(100);
	$(el).animate({ borderTopColor: bordertopfrom, borderBottomColor: borderbottomfrom }, 300);
	});
}
