function getRegistrationForm( id ){
	url = "index.php?node=json_calendar&cmd=join_course&id=" + id;
	$.get(url, function(data) {
		$("#calendar-infos").html(data);
	//	setTimeout('bindValidation', 1000);
	});
}
function bindValidation(){
	$("#join_course").validate({
		rules: [{
			vez_name: "required",
			ker_name: "required",
			agreement: "required",
			email: {
				required: true,
				email: true
			},
			again_email: {
				required: true,
				email: true,
				equalTo: "#email"
			}
		   }],
			messages: [{
				vez_name: "Kérjük, adja meg Vezetéknevét",
				ker_name: "Kérjük, adja meg Keresztnevét",
				email: {
					required: "Kérjük, adjon meg egy érvényes e-mail címet"
				},
				again_email: {
					required: "Kérjük, adjon meg egy érvényes e-mail címet",
					equalTo: "Kérjük, ismételje meg e-mail címét"
				}
			}]
	});
}
function patchLEFTSIDE(){
	var m = $("#main").height(),ex=parseFloat($("#main").css("padding-bottom")),d = 88;//backgrounds height
	var x = parseFloat(parseFloat(m - d) + ex );
	$("#left-side").css('height', x + 'px');
	if($.browser.msie){
		if($.browser.version == '7.0'){
			$("#left-side").css('margin-left', '-17px');
		}
	}
}
function initMenu_items(){
	$.preload( '#kuktanoda_balmenu img, #kuktanoda_jobbmenu img, #tanfolyamok_container img', {
	    find:'.png',
	    replace:'_hover.png'
	});
	
	$('#kuktanoda_balmenu img, #kuktanoda_jobbmenu img, #tanfolyamok_container img').hover(function(x){
		if(x.currentTarget.className != "active_menu"){
			this.src = this.src.replace('.png','_hover.png');
		}
	},function(x){
		if (x.currentTarget.className != "active_menu") {
			this.src = this.src.replace('_hover', '');
		}
	});
}
function initMenu(){
	initMenu_items();
}

function initCarousel( params ){
	//if(!$.browser.msie){
	    $("div#carousel_container").carousel({ 
			autoSlide: true,
			loop: true,
			animSpeed: "slow",
	    	delayAutoSlide: params.autoslide
	
		});
	//}
}
function initializeGMAP() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("elerhetoseg_terkep"));
	var center = new GLatLng(47.506716,19.076191);
    map.setCenter(center, 14);
	var kuktaIcon = new GIcon(G_DEFAULT_ICON);
	kuktaIcon.image = "./images/kuktanoda_small/kukta_icon.png";
	kuktaIcon.iconSize = new GSize(36, 28);
	kuktaIcon.infoWindowAnchor = new GPoint(20, 6);
	markerOptions = { icon:kuktaIcon };
	var point = new GLatLng(47.506716,19.076191);
	var marker = new GMarker(point, markerOptions);
	map.addOverlay(marker);
	marker.openInfoWindowHtml("<span style='font-size: small;'><b>KukTAnoda</b><br />Gasztrokaland Gyermekeknek!<br />1071 Budapest, Damjanich utca 11-15.</span>");
  }
}
function initRegValidate(){
	$("#reg_form").validate({
		rules: {
			reg_name: "required",
			reg_email: {
				required: true,
				email: true
			}
		   },
			messages: {
				reg_name: " ",
				reg_email: {
					required: " ",
					email: " "
				}
			}
		});
}
function toggleLead( name ){
	var elem = $( "#" + name );
	if(elem.innerHeight() != 0){
		if(elem.css("display") == "block"){
			elem.hide({duration: 300});
		}else{
			elem.show({duration: 300});
		}
	}
}

