//header-slider toggle

$(document).ready(function () {
		$(".expand-btn").click(function () {
			$("#content-wrapper").slideToggle(150);
		});
		$(document).ready(function () {

           $(".open").click(function () {
               $("#content-wrapper").slideToggle(150);
           });
       });
});

//Accordian

$(document).ready( function() {
	// Setup HoverAccordion for Example 2 with some custom options
	$('#accordion').hoverAccordion({
		keepHeight:true,
		activateItem: 2,
		speed: 200
            });
            $('#accordion').children('li:first').addClass('firstitem');
            $('#accordion').children('li:last').addClass('lastitem');
});

//Map Switcher

$(".imagebox").idTabs("!mouseover");

//Image fade gallery

$(document).ready(
                function(){
                    	$('#image_rotate').innerfade({
                        speed: 500,
                        timeout: 6000,
                        type: 'sequence',
                        containerheight: 	'300px',
                        slide_timer_on: 	'yes',
                        slide_ui_parent: 	'image_rotate',
                        slide_ui_text:		'portfolio-desc',
                       	pause_button_id: 	'pause_button',
                       	slide_nav_id:		'slide_nav'
                    	});
                    	$.setOptionsButtonEvent();
                    
                        
                   		$("#pause_button").click(function() {
                   			$.pause();
                        });
                        $("#next_button").click(function() {
                    		$.next();
                        });
                        
                        $("#prev_button").click(function() {
                        	$.prev();
                        });
                        
                    	$("#first_button").click(function() {
                        	$.first();
                        });
                        
                    	$("#last_button").click(function() {
                        	$.last();
                        });
				
			});

//Scroll

$(document).ready(function(){
	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();

		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;

		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];

		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;

		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
});

