$(document).ready(function() {
	
	/* Fix for IE */
    	if (jQuery.browser.msie && jQuery.browser.version >= 9) {
		 jQuery.support.noCloneEvent = true;
		}
	/* End fix for IE */
	
	/* Load scripts */
		if ($('.tweet').length) {
				$(".tweet").tweet({
					join_text: "auto",
					username: "nixdanish",
					count: 3,
					auto_join_text_default: "we said,",
					auto_join_text_ed: "we",
					auto_join_text_ing: "we were",
					auto_join_text_reply: "we replied",
					auto_join_text_url: "we were checking out",
					loading_text: "loading tweets..."
				  });
			}
		if ($('#flickrImages').length) {
				$('#flickrImages').jflickrfeed({
					limit: 4,
					qstrings: {
						id: '90933305@N00'
					},
					itemTemplate: '<a href="{{image_b}}"><img src="{{image_s}}" alt="{{title}}" /></a>'
				});
			}
		if ($('ul.sf-menu').length) {
				$('ul.sf-menu').superfish({
					hoverClass:    'sfHover',
					autoArrows:    false
				});
			}
		if ($('ul#myRoundabout').length) {
				$('ul#myRoundabout').roundabout({
					btnNext: '#next',
					btnPrev: '#previous',
					startingChild: 2,
					duration: 1000,
					easing: 'easeInOutBack'
				});
			}
		if ($('#carousel').length) {
				$(function(){
					$("#carousel").carousel({
						loop:true,
						pagination: true,
						autoSlide:true,
						delayAutoSlide:5000,
						autoSlideInterval:5000,
						animSpeed:1000,
						slideEasing:'easeInOutBack'
					});
				});
			}
		if ($('#carousel-small').length) {
				$(function(){
					$("#carousel-small").carousel({
							dispItems: 3
						});
				});
			}
		if ($("a[rel^='prettyPhoto']").length) {
				$("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'light_rounded',slideshow:2000, autoplay_slideshow: true});
			}
	
		if ($("#slogan").length) {
				$("#slogan ul").rotate();
			}
			
	/* End load scripts*/
	
	// Form
	$('input[type="text"],textarea').focus(function() {
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	$('form.inner input[type="text"], form.inner textarea').blur(function() {
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
	// End Form
	
	/* Hover */
	$('.hover').hover(function(){
			$(this).stop().addClass ('active')
		}, function(){
				$(this).stop().removeClass('active')
			})
	/* End hover */
	
	/* Image Caption Animate */
	$('.img-caption').hover(function(){
			$(this).find('span').animate({'bottom':-2}, 600, 'easeInOutSine')
		}, function(){
				$(this).find('span').stop(true, true).animate({'bottom':-100}, 600, 'easeInOutSine')
			})
	/* End image Caption Animate */
	
	/* Portfolio hover */
	
	$(".img-rollover").prepend("<span></span>")
	$(".img-rollover span").stop().animate({opacity:0},0)
		
	$(".img-rollover").hover(function(){
		$(this).find("span").stop().animate({opacity:0.65},300)
	}, function(){
		$(this).find("span").stop().animate({opacity:0},100)
	});
	
	/* End portfolio hover */
	
	
	// List animation
	/*$('.block-categories ul li').hover (function(){
			$(this).stop().animate({backgroundPosition:'0 0'}, 300)
		})*/
	// End list animation
});
