// JavaScript Document

/*----------Raj------------*/

jQuery(document).ready(function() {
	$(function() {
		var myheight = 100;
		var mycurrentheight = $(".right_graphic").height();
		var mycount = Math.floor(mycurrentheight/myheight);
		var mynewcount = mycount+1;
		var mynewheight = mynewcount*myheight;
		$(".right_graphic").css({'height' : mynewheight});
	});
});

jQuery(document).ready(function() {
	$(function() {
		var myheight = 100;
		var mycurrentheight = $(".blog_border").height();
		var mycount = Math.floor(mycurrentheight/myheight);
		var mynewcount = mycount+1;
		var mynewheight = (mynewcount*myheight)-13;
		$(".blog_border").css({'height' : mynewheight});
	});
});


$(function() {
	var totalHeightfor5 = 0;
	var totalHeightfor15 = 0;
	var myheight = 0;
	var mylistlenght = $('.page_titles').children().length + 1;
	var iflistlength = mylistlenght-1;
	
	for(var i = 0; i < 5; i++)
	{
		myheight = $(".page_titles li").eq(i).height();
		myheightandmargin = myheight + 5;
		totalHeightfor5 = totalHeightfor5 + myheightandmargin;
	}
	var mytotalheight = $(".page_titles").height();
	//alert(totalHeightfor5);
	/*for(var i = 1; i < iflistlength; i++)
	{
		var myheight = $(".page_titles li").eq(i).height();
		var myheightandmargin = myheight+5;
		//alert(myheightandmargin);
		totalHeightfor15 = totalHeightfor15 + myheightandmargin;
	}*/

	if (iflistlength>5)
	{
		$(".page_titles").animate({height:totalHeightfor5}, 500);
	}
	
	if (iflistlength<6)
	{
		$(".show_hide_button").css('display', 'none');
	}
	

	$(".show_hide_button").toggle(
		function() {
			$(".page_titles").animate({height:mytotalheight}, 500);
			$(".show_hide_button").html("Hide");
			//$(".show_hide_button").css({'background':'url(images/collapse_btn.gif) no-repeat center'});
		},
		function() {
			$(".page_titles").animate({height:totalHeightfor5}, 500);
			$(".show_hide_button").html("Show All");
			//$(".show_hide_button").css({'background':'url(images/expand_btn.gif) no-repeat center'});
		}
	);
	
});

$(document).ready(function(){
  $('a[href*=#]').click(function() {
 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
 && location.hostname == this.hostname) {
   var $target = $(this.hash);
   $target = $target.length && $target
   || $('[name=' + this.hash.slice(1) +']');
   if ($target.length) {
  var targetOffset = $target.offset().top;
  $('html,body')
  .animate({scrollTop: targetOffset}, 1000);
    return false;
   }
 }
  });
});
