

	function normalFont(){
		$('.rtf').css('font-size', 12);
		$('.column').css('font-size', 12);
		$('.news-holder').css('font-size', 12);
		return false;
	}

	function increaseFont(){
		$('.rtf').css('font-size', 16);
		$('.column').css('font-size', 16);
		$('.news-holder').css('font-size', 16);
		return false;
	}
    
	function decreaseFont(){
    	$('.rtf').css('font-size', 10);
    	$('.column').css('font-size', 10);
    	$('.news-holder').css('font-size', 10);
		return false;
	}

$(document).ready(function(){
   
	if ($("#slider-holder").length>0) {
		$('#slider-holder').show();
	}

	if ($(".slide-holder").length>0) {
		$('.slide-holder')
		.before('<div id="page-nav">')
		.cycle({
			fx:      'fade',
    		timeout: 5000,
    		pager: '#page-nav'
		});
	}

	if ($('.prefilled').length>0) {
		$('.prefilled').example(function() {
			return $(this).attr('title');
		});
	}

	if ($('.sub-nav ul li').length>0) {
		$('.sub-nav ul li:last').css('background', 'none');
	}
	
	if ($('.hrz-accordion').length>0) {
		$(".hrz-accordion").hrzAccordion({
			handlePosition:"right",
			openOnLoad: "1",
			containerClass: "container",
			listItemClass: "listItem",
			contentWrapper: "contentWrapper",
			contentInnerWrapper: "content",
			handleClass: "handle",
			handleClassOver: "handleOver",
			handleClassSelected: "handleSelected",
			eventTrigger:"click",
			closeSpeed: 1000,
			cycle: true,
			cycleInterval: 5000
		});
	}
	// 2011/4/25 jCarousel handler function for pausing bottom slideshow on mouseenter
	function mycarousel_initCallback(carousel){
    /* Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
    });
    carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
    });
	*/
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
	};
	
	if ($('#slider').length>0) {
		$('#slider-list').jcarousel({
			scroll: 1,
			wrap: 'circular',
			auto: 3,
			initCallback: mycarousel_initCallback
		});
	}

	if ($('#slider-list').length>0) {
        $('#slider-list li').mouseover(function(){
            $(this).addClass('active-list');
        });
        $('#slider-list li').mouseout(function(){
            $(this).removeClass('active-list');
        });
    }
	
	if ($('ul.sf-menu').length>0) {
		$('ul.sf-menu').superfish({ 
			animation: {height:'show'},
			delay: 500
		});
	}
	
	if ($(".side-news-pagina-1").length>0) {
		$('.side-news-pagina-1').pajinate({
			items_per_page : 5,
			num_page_links_to_display : 3,
			item_container_id : '.paginator-content',
			nav_panel_id : '.paginator',
			nav_label_first : '<<',
			nav_label_last : '>>',
			nav_label_prev : '<',
			nav_label_next : '>'
		});
	}
	
	if ($(".side-news-pagina-2").length>0) {
		$('.side-news-pagina-2').pajinate({
			items_per_page : 5,
			num_page_links_to_display : 3,
			item_container_id : '.paginator-content',
			nav_panel_id : '.paginator',
			nav_label_first : '<<',
			nav_label_last : '>>',
			nav_label_prev : '<',
			nav_label_next : '>'
		});
	}
	
	if ($(".breadcrumb ul li").length>0) {
		$('.breadcrumb ul li:last a').each(function(i){
			$(this).replaceWith("<span>" + $(this).text() + "</span>");
		});
	}
	
	if ($(".calendar-holder ul li").length>0) {
		$('.calendar-holder ul li:last').css('background', 'none');
	}
	
	if ($(".main-table-holder").length>0) {
		$('.main-table-holder table tr:odd').css('background', '#d0d8e8');
	}

		if ($(".gallery-content").length>0) {
		$('div.gallery-content').css('display', 'block');
	}
	
	if ($("#thumbs").length>0) {
		$('#thumbs').galleriffic({
			imageContainerSel: '#slideshow',
			controlsContainerSel: '#controls',
			numThumbs: 100
		});
		
		var onMouseOutOpacity = 0.80;
		$('#thumbs ul.thumbs li').opacityrollover({
			mouseOutOpacity:   onMouseOutOpacity,
			mouseOverOpacity:  1.0,
			fadeSpeed:         'fast',
			exemptionSelector: '.selected'
		});
	}

	$('#small').click(function(){
		decreaseFont();
		return false;
	});

	$('#normal').click(function(){
		normalFont();
		return false;
	});

	$('#large').click(function(){
		increaseFont();
		return false;
	});

	    if ( $("#gmapg").length > 0 )  {
            var mapdiv = document.getElementById('gmapg')
            var myInfo = mapdiv.innerHTML;
            var map = new GMap2(document.getElementById('gmapg'));
            map.setCenter(new GLatLng(44.812478,20.464211), 16);
//            var myInfo = "<p>Welcome to<br/>Serbia Investment and Export Promotion Agency<br/>Vlajkoviceva 3, 5th floor<br/>11000 Belgrade, Serbia</p>";
            map.openInfoWindowHtml(map.getCenter(), myInfo);

              function createMarker(latlng, number, myMsg) {
                var marker = new GMarker(latlng);
                marker.value = number;
                var myHtml = "<p>Welcome to<br/>Serbia Investment and Export Promotion Agency<br/>Vlajkoviceva 3, 5th floor<br/>11000 Belgrade, Serbia</p>";
                GEvent.addListener(marker,"click", function() {
                  map.openInfoWindowHtml(latlng, myMsg);
                });
                return marker;
          	}

            var point = new GLatLng(44.812478,20.464211);
//http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=108825136909050616630.00046783e70e83c1b466d&ll=44.812572,20.463772&spn=0.00101,0.002009&t=h&z=19
//http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=108825136909050616630.00046783e70e83c1b466d&ll=44.812572,20.463772&spn=0.00101,0.002009&t=h&z=19
//http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=108825136909050616630.00046783e70e83c1b466d&ll=44.812473,20.463839&spn=0.00101,0.002009&z=19
//http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=108825136909050616630.00046783e70e83c1b466d&t=h&ll=44.812524,20.464214&spn=0.001402,0.0032&z=19
//http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=108825136909050616630.00046783e70e83c1b466d&t=h&ll=44.812478,20.464211&spn=0.001402,0.0032&z=19
//http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=108825136909050616630.00046783e70e83c1b466d&t=h&ll=44.812522,20.464206&spn=0.001402,0.0032&z=19
            map.addOverlay(new createMarker(point,1, myInfo));
            map.setUIToDefault();
    }
	
});

