$(document).ready(function(){
    $(document).pngFix();

    //transitions
		//for more transition, goto http://gsgd.co.uk/sandbox/jquery/easing/
		var style = 'easeOutCubic';

		//Retrieve the selected item position and width
		var default_left = Math.round($('#lava li.selected').offset().left - $('#lava').offset().left);
		var default_width = $('#lava li.selected').width();

		//Set the floating bar position and width
		$('#box').css({left: default_left});
		$('#box .head').css({width: default_width});

		//if mouseover the menu item
		$('#lava li').hover(function () {

			//Get the position and width of the menu item
			left = Math.round($(this).offset().left - $('#lava').offset().left);
			width = $(this).width();

			//Set the floating bar position, width and transition
			$('#box').stop(false, true).animate({left: left},{duration:400, easing: style});
			$('#box .head').stop(false, true).animate({width:width},{duration:400, easing: style});

		//if user click on the menu
		}).click(function () {

			//reset the selected item
			$('#lava li').removeClass('selected');

			//select the current item
			$(this).addClass('selected');

		});

		//If the mouse leave the menu, reset the floating bar to the selected item
		$('#lava').mouseleave(function () {

			//Retrieve the selected item position and width
			default_left = Math.round($('#lava li.selected').offset().left - $('#lava').offset().left);
			default_width = $('#lava li.selected').width();

			//Set the floating bar position, width and transition
			$('#box').stop(false, true).animate({left: default_left},{duration:400, easing: style});
			$('#box .head').stop(false, true).animate({width:default_width},{duration:400, easing: style});

		});

        $("#slider").easySlider({
            continuous: true,
            numeric: true
        });
        $("#slider1").easySlider({
            continuous: true,
            numeric: true,
            numericId: 'control2'
        });

});



$(function () {
    $('.gotolinks').hide();
    $('#navbg').addClass("lava-off");
    $('#Header1_action').toggle( function (){
        $('.gotolinks').fadeIn("slow");
        $('#navbg').removeClass("lava-off");
        $('#navbg').addClass("lava-on");
    },
    function(){
        $('.gotolinks').fadeOut("slow");

        $('#navbg').removeClass("lava-on");
        $('#navbg').addClass("lava-off");
    });
});

$(function () {
    var lmContainers = $('div.locationmap > div.locationinfoholder');

    $('div.indiamap a').click(function () {
        lmContainers.hide().filter(this.hash).show();

        $('div.indiamap a').removeClass('selected');
        $(this).addClass('selected');

        return false;
    }).filter(':first').click();

});







$(function() {
    $.simpleWeather({
        location: 'New Delhi, India',
        unit: 'c',
        success: function(weather) {
        $("#weather").append('<h2>'+weather.city+', '+weather.region+' '+weather.country+'</h2>');
        $("#weather").append('<p>Current: '+weather.temp+'&deg; '+weather.units.temp+'</p>');
        $("#weather").append('<p><img src="'+weather.image+'"></p>');
        $("#weather").append('<p>High: '+weather.high+'&deg; '+weather.units.temp+' Low: '+weather.low+'&deg; '+weather.units.temp+'</p>');
        $("#weather").append('<p><strong>Forecast: </strong> '+weather.forecast+'</p>');

        $("#weather").append('<p class="clr"></p>');
        },
    error: function(error) {
        $("#weather").html('<p>'+error+'</p>');
        }
    });

    $.simpleWeather({
        location: 'Bangalore, India',
        unit: 'c',
        success: function(weather) {
        $("#weather1").append('<h2>'+weather.city+', '+weather.region+' '+weather.country+'</h2>');
        $("#weather1").append('<p>Current: '+weather.temp+'&deg; '+weather.units.temp+'</p>');
        $("#weather1").append('<p><img src="'+weather.image+'"></p>');
        $("#weather1").append('<p>High: '+weather.high+'&deg; '+weather.units.temp+' Low: '+weather.low+'&deg; '+weather.units.temp+'</p>');
        $("#weather1").append('<p><strong>Forecast: </strong> '+weather.forecast+'</p>');

        $("#weather1").append('<p class="clr"></p>');
        },
    error: function(error) {
        $("#weather1").html('<p>'+error+'</p>');
        }
    });

    $.simpleWeather({
        location: 'Amritsar, India',
        unit: 'c',
        success: function(weather) {
        $("#weather2").append('<h2>'+weather.city+', '+weather.region+' '+weather.country+'</h2>');
        $("#weather2").append('<p>Current: '+weather.temp+'&deg; '+weather.units.temp+'</p>');
        $("#weather2").append('<p><img src="'+weather.image+'"></p>');
        $("#weather2").append('<p>High: '+weather.high+'&deg; '+weather.units.temp+' Low: '+weather.low+'&deg; '+weather.units.temp+'</p>');
        $("#weather2").append('<p><strong>Forecast: </strong> '+weather.forecast+'</p>');

        $("#weather2").append('<p class="clr"></p>');
        },
    error: function(error) {
        $("#weather2").html('<p>'+error+'</p>');
        }
    });

    $.simpleWeather({
        location: 'Hyderabad, India',
        unit: 'c',
        success: function(weather) {
        $("#weather3").append('<h2>'+weather.city+', '+weather.region+' '+weather.country+'</h2>');
        $("#weather3").append('<p>Current: '+weather.temp+'&deg; '+weather.units.temp+'</p>');
        $("#weather3").append('<p><img src="'+weather.image+'"></p>');
        $("#weather3").append('<p>High: '+weather.high+'&deg; '+weather.units.temp+' Low: '+weather.low+'&deg; '+weather.units.temp+'</p>');
        $("#weather3").append('<p><strong>Forecast: </strong> '+weather.forecast+'</p>');

        $("#weather3").append('<p class="clr"></p>');
        },
    error: function(error) {
        $("#weather3").html('<p>'+error+'</p>');
        }
    });

    $.simpleWeather({
        location: 'Pune, India',
        unit: 'c',
        success: function(weather) {
        $("#weather4").append('<h2>'+weather.city+', '+weather.region+' '+weather.country+'</h2>');
        $("#weather4").append('<p>Current: '+weather.temp+'&deg; '+weather.units.temp+'</p>');
        $("#weather4").append('<p><img src="'+weather.image+'"></p>');
        $("#weather4").append('<p>High: '+weather.high+'&deg; '+weather.units.temp+' Low: '+weather.low+'&deg; '+weather.units.temp+'</p>');
        $("#weather4").append('<p><strong>Forecast: </strong> '+weather.forecast+'</p>');

        $("#weather4").append('<p class="clr"></p>');
        },
    error: function(error) {
        $("#weather4").html('<p>'+error+'</p>');
        }
    });

    $.simpleWeather({
        location: 'Ahmedabad, India',
        unit: 'c',
        success: function(weather) {
        $("#weather5").append('<h2>'+weather.city+', '+weather.region+' '+weather.country+'</h2>');
        $("#weather5").append('<p>Current: '+weather.temp+'&deg; '+weather.units.temp+'</p>');
        $("#weather5").append('<p><img src="'+weather.image+'"></p>');
        $("#weather5").append('<p>High: '+weather.high+'&deg; '+weather.units.temp+' Low: '+weather.low+'&deg; '+weather.units.temp+'</p>');
        $("#weather5").append('<p><strong>Forecast: </strong> '+weather.forecast+'</p>');

        $("#weather5").append('<p class="clr"></p>');
        },
    error: function(error) {
        $("#weather5").html('<p>'+error+'</p>');
        }
    });

});

$(window).load(function() {
	$('#slider2').nivoSlider({
		effect:'random', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:500,
		pauseTime:5000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.7, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});


/* Site Tabs */

$(function () {
    var tabContainers = $('div.tabs > div.mslide');

    $('div.tabs ul.mtabNavi a').click(function () {
        tabContainers.hide().filter(this.hash).show();

        $('div.tabs ul.mtabNavi a').removeClass('selected');
        $(this).addClass('selected');

        return false;
    }).filter(':first').click();
});

/* Blink Images */

$(function () {
    $('.blink').hover(function() {
	$(this).fadeTo("fast", 0.5);
	}, function() {
	$(this).fadeTo("fast", 1);
    });

});
