/*
 * jQuery JavaScript Library
 *
 * Put description of this library here.
 *
 * Copyright (c) Shujaa Solutions, Nov 20th 2009
 *
 * Author: Martin Wachira
 * Date: June 2010
 */

function enter() {
  $(this).find('img.title').stop().animate(
									{ marginBottom: ['13','linear'] },
									100,
									function() {
												$(this).next('.arrow').attr(
												{
												  src: 'images/pic_list_inverted.gif',
												  width: 7,
												  height: 4
												}).animate(
														  {
															bottom: ['3','linear'],
															right: ['39','linear']
														  },
														  100);
									});
}

function leave() {
  $(this).find('img.title').css('margin-bottom',0);
  $(this).find('img.arrow').attr(
				  {
					src: 'images/pic_list_3.gif',
					width: 4,
					height: 7
				  }).animate(
							{
							  bottom: ['5','linear'],
							  right: ['0','linear']
							},
							100);
}

function enterServices() {
  $(this).find('img.title').stop().animate(
							{ marginBottom: ['13','linear'] },
							100,
							function() {
							  $(this).next('.arrow').attr({
								src: 'images/pic_list_inverted.gif',
								width: 7,
								height: 4
							}).animate(
									  {
										bottom: ['3','linear'],
										right: ['33','linear']
									  },
									  100);
							  $('.service-hover').css('background-image', 'url(images/m_2_3-hover.gif)');
									  });
							
}

function leaveServices() {
  $(this).find('img.title').css('margin-bottom',0);
  $(this).find('img.arrow').attr(
				  {
					src: 'images/pic_list_3.gif',
					width: 4,
					height: 7
				  }).animate(
							{
							  bottom: ['5','linear'],
							  right: ['-2','linear']
							},
							100);
  											$('.service-hover').css('background-image', 'url(images/m_2_3.jpg)');
}

function enterPartners() {
  $(this).find('img.title').stop().animate(
							{ marginBottom: ['13','linear'] },
							100,
							function() {
							  $(this).next('.arrow').attr({
								src: 'images/pic_list_inverted.gif',
								width: 7,
								height: 4
							}).animate(
									  {
										bottom: ['3','linear'],
										right: ['36','linear']
									  },
									  100);
									  $('.partners-hover').css('background-image', 'url(images/menu_3_2-hover.gif)');
									  });
}

function leavePartners() {
  $(this).find('img.title').css('margin-bottom',0);
  $(this).find('img.arrow').attr(
				  {
					src: 'images/pic_list_3.gif',
					width: 4,
					height: 7
				  }).animate(
							{
							  bottom: ['5','linear'],
							  right: ['-2','linear']
							},
							100);
				  $('.partners-hover').css('background-image', 'url(images/menu_3_2.jpg)');
}

function enterContacts() {
  $(this).find('img.title').stop().animate(
							{ marginBottom: ['13','linear'] },
							100,
							function() {
							  $(this).next('.arrow').attr({
								src: 'images/pic_list_inverted.gif',
								width: 7,
								height: 4
							}).animate(
									  {
										bottom: ['3','linear'],
										right: ['36','linear']
									  },
									  100);
							   $('.contacts-hover').attr('src', 'images/m_2_1-hover.gif');
									  });
}

function leaveContacts() {
  $(this).find('img.title').css('margin-bottom',0);
  $(this).find('img.arrow').attr(
				  {
					src: 'images/pic_list_3.gif',
					width: 4,
					height: 7
				  }).animate(
							{
							  bottom: ['5','linear'],
							  right: ['0','linear']
							},
							100);
   $('.contacts-hover').attr('src', 'images/m_2_1.gif');
}

$(document).ready(function() {
  $('#company').mouseenter(enter).mouseleave(leave);
  $('#services').mouseenter(enterServices).mouseleave(leaveServices);
  $('#partners').mouseenter(enterPartners).mouseleave(leavePartners);
  $('#contacts').mouseenter(enterContacts).mouseleave(leaveContacts);
});

