//jQuery.noConflict();
try{
		jQuery(document).ready(function(){
					
			if(jQuery().fancybox && !jQuery(document.body).hasClass("loggedIn")){ 
				jQuery("#mod_pukkaPictures .picture a").fancybox({
					'zoomSpeedIn': 500,
					'zoomSpeedOut': 500,
					'zoomOpacity': true
				});
				jQuery("#mod_pukkaGalleries .picture a,#mod_pukkaActivities ul.mediaAttachmentList li.mediaSimpleListItem a, #mod_pukkaPackages ul.mediaAttachmentList li a, .moduleOutput.viewList .itemPreviewImageSection a").fancybox({
					'zoomSpeedIn': 500,
					'zoomSpeedOut': 500,
					'zoomOpacity': true
				});
				jQuery("div#video-tours a.controls").fancybox({ 
					'zoomSpeedIn': 500,
					'zoomSpeedOut': 500,
					'zoomOpacity':true,
					'frameWidth':640,
					'frameHeight':480,
					'autoscaling': false,
					'hideOnContentClick': false,
					'callbackOnClose':function(){
						jQuery('#fancy_content').empty();
					}
				});
			}	
			/**ACCORDIAN**/
				jQuery("#mod_pukkaActivities .moduleBody, #mod_pukkaPackages.viewList .moduleBody, #mod_pukkaEvents .moduleBody").accordion({
					active: 0,
					header: 'h3',
					event: 'click',
					autoHeight:false
				});
				
				jQuery(".moduleBody").bind( "accordionchange", function(event, ui) {
					jQuery(".moduleBody h3").css('zoom',0)
					jQuery(".moduleBody h3").css('zoom',1)
				});
			/**END OF ACCORDIAN**/
			
			//*!+ TEXT mainContent readMoreTxt htmlStrip +!*//
			var readMore=jQuery('<p id="toggle-content">'+__readmore+'</p>');
			jQuery("#page_home #holder").append(readMore);
			var mainContent=jQuery("#page_home #main-content");
			jQuery("#page_home #toggle-content").click(function(){
				if(mainContent.is(":visible")){
						jQuery("#page_home #main-content").animate({height:'toggle'},800,function(){
							jQuery('h1').css('zoom','');
							jQuery('h1').css('zoom',1);
							jQuery('#page_home #menu-panel').css('margin-top','629px');
							jQuery('#page_home #footer').css('margin-top','2px');							
							jQuery("#page_home #toggle-content").text(__readmore);
						});
				}else if(mainContent.is(":hidden")){
						jQuery("#page_home #main-content").animate({height:'toggle'},800,function(){
							jQuery('h1').css('zoom','');
							jQuery('h1').css('zoom',1);
							jQuery('#page_home #menu-panel').css('margin-top','2px');
							jQuery('#page_home #footer').css('margin-top','2px');							
							jQuery("#page_home #toggle-content").text(__close);	
						});						
				}
				return false;
			});	
			jQuery("#footer ul li.terms a").click(function(){
				var link=this.href;
				popPage(link,'_blank',550,400);
				return false;
			});
				
			function popPage(url, windowType, windowWidth, windowHeight) {
				var win=jQuery(window);
				var left=(win.width()-windowWidth)/2;
				var top=(win.height()-windowHeight)/2;
				window.open(url, windowType, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width='+windowWidth+', height='+windowHeight+', left='+left+', top='+top+'');
			}
			
			jQuery('#controls #pager a').append('<span></span>');
			
			jQuery("#page_home #toggle-content").click();
			
			$('#special-offers .widget-content').append('<div id="prv-next-ctrls"><a class="prev"></a><a class="next"></a></div>');			
			
			if(jQuery().cycle){
				jQuery('#special-offers .carousel').after('<div id="controls"><div id="pager">').cycle({ 
						fx:     'fade', 
						speed:  'slow', 
						timeout: 4000,
						pause:   1,
						cleartype:  1,
						cleartypeNoBg:true,
						pager:  '#special-offers #controls #pager',
						next:   '#special-offers #prv-next-ctrls a.next', 
						prev:   '#special-offers #prv-next-ctrls a.prev' 
				});
				jQuery('#page_home div#main-visual ul').cycle({ 
					fx: 'fade', 
					speed: 3000, 
					timeout: 3000,
					cleartype:  1,
					cleartypeNoBg:true
				});
			}				
			
			jQuery("#email-address").focus(function(srcc)
			{
				if (jQuery(this).val() == $(this)[0].title)
				{
					jQuery(this).removeClass("defaultTextActive");
					jQuery(this).val("");
				}
			});
			
			jQuery("#email-address").blur(function()
			{
				if (jQuery(this).val() == "")
				{
					jQuery(this).addClass("defaultTextActive");
					jQuery(this).val($(this)[0].title);
				}
			});
			
			jQuery("#email-address").blur(); 

			jQuery('#page_contactsdefault #flexForm_element_comments').attr({
			  rows: '6',
			  cols: '45'
			});		
			
			
			jQuery('#mod_pukkaEvents .itemPreview .accordion-content .moduleContent > ul').addClass('events');			
			jQuery('ul.events li:first-child').addClass('organization');
			jQuery('ul.events li:nth-child(2)').addClass('local');
			jQuery('ul.events li:nth-child(3)').addClass('contact');
			jQuery('ul.events li:nth-child(4)').addClass('euro');
			
			
		});
}catch(error){

}

function createPlayer(theFile) {
    var flashvars = {
            file:theFile, 
            autostart:"true",
			controlbar: "over",
			backcolor: "#000000",
			frontcolor: "#FFFFFF"
    }
    var params = {
            allowfullscreen:"true", 
            allowscriptaccess:"always"
    }
    var attributes = {
            id:"player1",  
            name:"player1"
    }
    swfobject.embedSWF("/templates/main/libs/player.swf", "videoHolder", "640", "480", "9.0.115", false, flashvars, params, attributes);
}
