/* Dynamic load */
function loadjscssfile(filename, filetype){
	if (filetype=="js"){
		var fileref=document.createElement('script')
		fileref.setAttribute("type","text/javascript")
		fileref.setAttribute("src", filename)
	}
	else if (filetype=="css"){
		var fileref=document.createElement("link")
		fileref.setAttribute("rel", "stylesheet")
		fileref.setAttribute("type", "text/css")
		fileref.setAttribute("href", filename)
	}
	if (typeof fileref!="undefined")
	document.getElementsByTagName("head")[0].appendChild(fileref)
}

$(document).ready(function(){

	$('ul.sf-menu').superfish({ 
        delay:       1000,                            // one second delay on mouseout 
        animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
        speed:       'fast',                          // faster animation speed 
        autoArrows:  false,                           // disable generation of arrow mark-up 
    	dropShadows: true                            // disable drop shadows 
    }); 
	
});

$(document).ready(function(){
	$("a.video").click(function() {
		$.fancybox({
				'centerOnScroll': true,
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'fade',
				'transitionOut'	: 'fade',
				'overlayColor' 	: '#000',
				'overlayOpacity': 0.7,
				'title'			: this.title,
				'width'			: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1'),
				'type'			: 'swf'

			});
	
		return false;
	});
	
	
	$("a.photo").each(function(index) {
		$(this).attr('rel', 'group');
	});
	$("a.photo").fancybox({
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic',
				'titlePosition' : 'over',
				'centerOnScroll': true,
				'overlayColor'  : '#000',
				'overlayOpacity': 0.7
	});
	

	$("a.popupvideo").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'overlayColor'  : '#000',
			'overlayOpacity': 1,
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
	});
	
	var info = 'desperado';
	var at = '@';
	var domain  = 'desperado.hu';
	$('#infomail').html('<a href="mailto:'+info+at+domain+'">'+info+at+domain+'</a>');


	var info2 = 'edit.vitelki';
	var domain2  = 'mistraliroda.hu';
	$('#szervezomail').html('<a href="mailto:'+info2+at+domain2+'">'+info2+at+domain2+'</a>');

});



