/*
if(navigator.appName == "Netscape") {

function prepareMouseOverImage(image, originalURL)
{
image.mouseOverImage=originalURL;
image.onload=function(){return true;};
image.normalImage=grayscale(image, false);

image.onmouseover=function()
{
//alert("a");
this.src=this.mouseOverImage;
}

image.onmouseout=function()
{
//	alert(this.normalImage.src);
this.src=this.normalImage;
}
image.src=image.normalImage;
}


function grayscale(image, bPlaceImage)
{
var myCanvas=document.createElement("canvas");
var myCanvasContext=myCanvas.getContext("2d");

var imgWidth=image.width;
var imgHeight=image.height;
// You'll get some string error if you fail to specify the dimensions
myCanvas.width= imgWidth;
myCanvas.height=imgHeight;
//  alert(imgWidth);
myCanvasContext.drawImage(image,0,0);
// this function cannot be called if the image is not rom the same domain.  You'll get security error
var imageData=myCanvasContext.getImageData(0,0, imgWidth, imgHeight);
for (i=0; i<imageData.height; i++)
{
for (j=0; j<imageData.width; j++)
{
var index=(i*4)*imageData.width+(j*4);
var red=imageData.data[index];
var green=imageData.data[index+1];
var blue=imageData.data[index+2];
var alpha=imageData.data[index+3];
var average=(red+green+blue)/3;
imageData.data[index]=average;
imageData.data[index+1]=average;
imageData.data[index+2]=average;
imageData.data[index+3]=alpha;
}
}
myCanvasContext.putImageData(imageData,0,0,0,0, imageData.width, imageData.height);
// myCanvasContext.drawIMage(imageData,0,0);//,0,0, imageData.width, imageData.height);

if (bPlaceImage)
{
var myDiv=document.createElement("div");
myDiv.appendChild(myCanvas);
image.parentNode.appendChild(myCanvas);//, image);
}
return myCanvas.toDataURL();
}


$(document).ready(function(){

$(".img").each(function (i) {
grayscale(this, true);
prepareMouseOverImage(this, this.src);
});

});

}
*/


function ellenoriz(form) {

	$("#hibadiv").html("");

	if($("#name_req").val() == "") {
		$("#hibadiv").append("Nem adta meg a nevét! <br />");
		return false;
	}

	if($("#cim_req").val() == "") {
		$("#hibadiv").append("Nem adta meg a címét! <br />");
		return false;
	}

	if($("#email_req").val() == "") {
		$("#hibadiv").append("Nem adta meg az email címét! <br />");
		return false;
	}

	if($("#kep_req").val() == "") {
		$("#hibadiv").append("Nem választott ki képet! <br />");
		return false;
	}

	if(!$("input[name='tipus_req']")[0].checked && !$("input[name='tipus_req']")[1].checked) {
		$("#hibadiv").append("Nem választott ki szervezeti formát! <br />");
		return false;
	}

	if($("#text_req").val() == "") {
		$("#hibadiv").append("Nem adott meg bemutatkozó szöveget! <br />");
		return false;
	}

	return true;
}

$(document).ready(function() {

	$("body").append('<div id="header_tooltip">vissza a főoldalra</div>');

	$("#logo").mouseover(function(e){
		
		$("#header_tooltip").animate({
			opacity: 0.8
		});
		
	}).mousemove(function(e) {
		$("#header_tooltip").css("left", e.pageX + 20 +'px');
		$("#header_tooltip").css("top", e.pageY + 20 +'px');
	}).mouseout(function(e) {
		
		$("#header_tooltip").animate({
			top: $("#header_tooltip").css("top").replace("px", "")*1 - 10 + "px",
			left: $("#header_tooltip").css("left").replace("px", "")*1 + 10 + "px",
			opacity: 0
		});
	})
	/* 
	$("#cop15_toggle").click(function() {
		
		eraseCookie("cop15");
		
		if($("#cop15_container").css("display") == 'none') {
			createCookie("cop15","opened",7);
			$(this).html("Bezárás");
		}
		else {
			createCookie("cop15","closed",7);
			$(this).html("Bővebben");
			window.location.hash="cop15_start";
		}
		
		$('#cop15_container').toggle();
		
	});
	
	if(readCookie("cop15") == "opened") {
		$('#cop15_container').show();
	} else {
		$("#cop15_toggle").html("Bővebben");
	}
	 */
	
	
	
	jQuery("#scroll-left").click(function() {
		
		var left = (jQuery("#scroll-content").css("left")).replace("px", "");
		
		if( left >= -200)  {
			jQuery("#scroll-content").animate({
				left: "0px"
			}, 500);
			return;
		}
		
		jQuery("#scroll-content").animate({
			left: (left*1) + 200 + "px"
		}, 500);
		
		
	});
	
	jQuery("#scroll-right").click(function() {
		
		var left = (jQuery("#scroll-content").css("left")).replace("px", "");
		var maxWidth = -1 * ((jQuery("#tamogatok_table").width()) - 630);
		
		if( left < maxWidth) return;

		jQuery("#scroll-content").animate({
			left: left - 200 + "px"
		}, 500);
		
		
	});


	// lightboxos popup
	if(readCookie("lightbox_overlay") == null) {
		jQuery("#overlay, #popup_content").show();
		jQuery("#overlay").height(jQuery(document).height() +"px");
	}

	//	jQuery("#popup_close, #overlay, #popup_content").click(function() {
	//		jQuery("#overlay, #popup_content").hide();
	//	});

	jQuery("#popup_close, #overlay").click(function () {
		jQuery("#overlay, #popup_content").hide();
		createCookie("lightbox_overlay", "closed", 1);
	})


	$('a[@rel*=lightbox], .galeria_cikk_kep, .indexkep').lightBox();
//$('body').pngFix();
	
});

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}





function update(){
	xajax_call_update();
	window.setTimeout("update()",10*60*1000+1000); //kicsit több mint 10 percenkent frissit
}

update();








