/* 
	Main declarations and variables (DON'T add trailing slash)
	Script by Net Media Planet ( xavi@netmediaplanet.com )
*/	
website = new Array ();
//website["url"] = "http://192.168.21.3/webdev/201044/netmediaplanet.com";
website["url"] = "http://www.netmediaplanet.com";
//website["template_url"] = "http://192.168.21.3/webdev/201044/netmediaplanet.com/wp-content/themes/netmediaplanet";
website["template_url"] = "http://www.netmediaplanet.com/wp-content/themes/netmediaplanet";


/* Start jQuery stuff */
$(document).ready(function() {

	/* Hover menu for IE6 */
																		// Javascript originally by Patrick Griffiths and Dan Webb.
																		// http://htmldog.com/articles/suckerfish/dropdowns/
																		/*sfHover = function() {
																			var sfEls = document.getElementById("navbar").getElementsByTagName("li");
																			for (var i=0; i<sfEls.length; i++) {
																				sfEls[i].onmouseover=function() {
																					this.className+=" hover";
																				}
																				sfEls[i].onmouseout=function() {
																					this.className=this.className.replace(new RegExp(" hover\\b"), "");
																				}
																			}
																		}
																		if (window.attachEvent) window.attachEvent("onload", sfHover);*/
																		/*$('#navbar>li>ul').each(
																			function (intIndex) {
																				$(this).bind('mouseenter mouseleave', function() {
																					$(this).toggleClass('hover');
																				});
																			}
																		);*/
	$('#navbar>li').bind('mouseenter mouseleave', function() {
  		$(this).toggleClass('hover');
	});
	
	/* Keep current submenu displaying when mouse leave */
	$('.current_page_ancestor,.current_page_item')
		.addClass("hover")
		.bind('mouseleave mouseenter', function() {
			$(this).removeClass("hover");
	});
	$('#navbar').bind('mouseleave mouseenter', function() {
		$('.current_page_ancestor,.current_page_item').toggleClass("hover");
	});
		
	/*
		Main menu subitems to start just below the main item
	*/
	$('#navbar>li>ul').each(
		function (intIndex) {
			var offsetmenu = $('#navbar').offset();
			var offsetitem = $(this).parent().offset();
			$(this).css("padding-left", offsetitem.left - offsetmenu.left);
		}
	);

	/* 
		People Slideshow by Net Media Planet 
		Last updt: 23rd March 2010
	*/
	$('#people-list>li>a').each(
		function (intIndex) {
			var person = $(this);
			person.bind("click", function(){
				$('#people-list>li>a').removeClass("active");
				$('#people-big')
					.fadeOut(200, function() {
						$('#people-big')
							.addClass("active")
							.css('backgroundImage', 'url(' +person.attr("href")+ ')')
							.attr("title", person.attr("title") )
							.fadeIn(250);
					});
				$('#people-info').html( $("#"+person.parent().attr("id")+">.info").html() );
				return false;
				
			});
		}
	);
	$('#sri-sharma>a').trigger('click');


	/*  Fix IE6 weird menu, the naughty way. but there's no way to detect ie6 through jquery.support in 1.4 */
	if (jQuery.browser.msie && jQuery.browser.version == 6) {
		$('#navbar').trigger('mouseenter').trigger('mouseleave');
	}
	
	
	
	/* Request latest feed */
	$.get(website["template_url"]+'/includes/php/ajax.php?a=tweet', function(data) {
	  $('#tweet').html(data);
	});
	
	
}); // end document ready

