/*
*	@autorized : Richer Balázs
*
*
*
*
*
*
*
*/

$(document).ready(function() {
	$.each($(".createtextpager img"), function() {
		var url = $(this).attr('src');
		url = url.replace("//templates","/templates");
		$(this).attr("src",url);
	});
	
	$.each($("#header_menu ul li"), function() {
		$(this).mouseover( function() { 
			if( $(this).children('ul').hasClass('menulevel_3') )
			{
				$(this).children('ul').css( 'position','absolute' );
				$(this).children('ul').css( 'left','169px' );
				$(this).children('ul').css( 'top','-0px' );
				$(this).children('ul').css( 'display','block' );
			}else{
				$(this).children('ul').css( 'display','block' );
			}
		});
		$(this).mouseout( function() { 
			$(this).children('ul').css( 'display','none' );
		});
	});
	
	if( document.getElementById('active_menu1') )
	{
		$('a.last').parent().css( 'border','none' );
	}
	
	
});

function blendToGalleryMode(){
	
	$('.loginbox form').css('display','none');
	$('.loginbox .legendreg').css('display','none');


}

function checkAsk(){

	var letgo = false;
	var mail_ask = document.getElementById('mail_ask').value;
	var ask_zip = document.getElementById('ask_zip').value;
	var ask_city = document.getElementById('ask_city').value;
	var ask_street = document.getElementById('ask_street').value;
	var ask_number = document.getElementById('ask_number').value;

	
	
	if( 	mail_ask.length > 0  
		||	ask_zip.length > 0  
		||	ask_city.length > 0  
		||	ask_street.length > 0  
		||	ask_number.length > 0  
		
		)
	{
		letgo = true;
	}
	
	if (letgo == false)
	{
		alert('Az e-mailed és a címedre vonatkozó rész kitöltése kötelező!');
		return false;
	}else{
		return true;
	}

}

function helpusTest(){

	var letgo = false;

	var helpname = document.getElementById('helpname').value;
	var mail_ask = document.getElementById('mail_ask').value;

	
	
	if( 	
			helpname.length > 0  
		||	mail_ask.length > 0  
		
		)
	{
		letgo = true;
	}
	
	if (letgo == false)
	{
		alert('Az e-mailed és a címedre vonatkozó rész kitöltése kötelező!');
		return false;
	}else{
		return true;
	}

}

function checkHelp(){

	var letgo = false;
	var mail_ask = document.getElementById('mail_ask').value;

	if( mail_ask.length > 0 )
	{
		letgo = true;
	}
	
	if (letgo == false)
	{
		alert('Az e-mailed és a címedre vonatkozó rész kitöltése kötelező!');
		return false;
	}else{
		return true;
	}

}

function swapGaleri(id){
	
	//init
	var srcs=new Array();
	srcs[1] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/QZGshw8ajz4?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/QZGshw8ajz4?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[2] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/hicdmIlUW0Q?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/hicdmIlUW0Q?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[3] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/qQpiePNBpyc?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/qQpiePNBpyc?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[4] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/GRRyT8Gu2CU?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GRRyT8Gu2CU?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[5] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/aAFNm48VGgk?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/aAFNm48VGgk?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[6] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/hJWYP11QTAk?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/hJWYP11QTAk?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[7] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/Hw2dilMOrJ0?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Hw2dilMOrJ0?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[8] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/SpY1f89_tM0?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/SpY1f89_tM0?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[9] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/HkxW1kvoWCU?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HkxW1kvoWCU?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[10] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/jmyMv_WiOto?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/jmyMv_WiOto?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[11] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/TWv6svVz-bk?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/TWv6svVz-bk?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[12] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/F9roJhtr2IY?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/F9roJhtr2IY?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[13] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/5bzUWPyDh_Q?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/5bzUWPyDh_Q?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[14] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/yuBnRsLXlDE?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/yuBnRsLXlDE?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	srcs[15] = '<object width="418" height="260"><param value="transparent" name="wmode"><param name="movie" value="http://www.youtube.com/v/kQ4sE8toukQ?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/kQ4sE8toukQ?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="418" height="260"></embed></object>';
	/*********/


	var src = srcs[id];
	$('#player').html(src);
}

function galleryChange(html){
	$('#grande_vid object param#src').val('http://www.youtube.com/v/'+html+'?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01');
	$('#grande_vid object embed').attr('src','http://www.youtube.com/v/'+html+'?fs=1&amp;hl=hu_HU&amp;color1=0xe1600f&amp;color2=0xfebd01');
	var html_s = $('#video_gallery').html();
	$('#grande_vid').remove();
	$('#video_gallery').html( html_s );
	
}
