/* Copyright (c) 2008 Affno (Pvt) Ltd, . All rights reserved.

 This software is the confidential and proprietary information of        
 Affno  ("Confidential Information").  You shall not disclose such 
 Confidential Information and shall use it only in accordance with
 the terms of the license agreement you entered into with Affno.

Module Name		: PERWEB1
File Name		: phonie.js
Description		: Pership values slideshow
Created By		: Bjorn de Lima
Created Date	: 22-August-2007
Modified By		: Bjorn (for Pership redone with jquery  - www.jquery.com)
Modified Date	: 22-May-2008
Version			: 2.00.000

*/
// JavaScript Document


var basepath = '../images/values/';
var slides = [ {src : "cust.jpg" , head: "Customer Centricity" , para: "Measuring our success by that of our Customers... always driven by quality and a spirit of innovation resulting in service excellence" }
			  , {src : "merit.jpg" , head : "Meritocracy " , para : "Creating opportunities for the best people from around us to grow and live their dreams"}
			  , {src : "global_or.jpg" , head : "Global Orientation" , para : "Growing our people, markets and businesses around the world" }
			  , {src : "integrity.jpg" , head : "Integrity" , para : "Honesty, and strong moral principles  " }
			   , {src : "every.jpg" , head : "Every person every idea counts" , para : "Respecting the individual and valuing contributions of each Associate " }
			    , {src : "risk.jpg" , head : "Risk taking" , para : "Using the advantage of size to take risks and try new things...never allowing size to be a disadvantage " }
				, {src : "speed.jpg" , head : "Speed of action" , para : "Using the benefits of a digital age to accelerate our success and build a faster and smarter Pership. " }
				, {src : "leadership.jpg" , head : "Inspirational and visionary leadership" , para : "Passion for learning and sharing ideas committed to delivering results in every environment and the ability to energize and inspire our diverse teams connected to workplace. " }
			  ];

 var randomNum = Math.random() * (7); 
	
var current = Math.round(randomNum);
var loading = false;
var slide;
var count = 0;

$(document).ready(function(){
	  

	
	updateSlide();
		
		$(".slide a:last").click(function(){
		current++;
		if (current==slides.length){ current=0;}
		updateSlide();
		return false;
		});
		
		$(".slide a:first").click(function(){
		current--;
		if (current<0){ current=slides.length-1;}
		updateSlide();
		return false;
		});
		
		}); // ready end



// loads whatever the current image into page through xhr
function updateSlide(){
	$("#slideshow").empty();
	obj = $("#slideshow").append("<img src='../images/"+slides[current].src+"'/>");
	$("#slideshow img").css({opacity : 0, height: 210, width: 350 });
	$("#slideshow img").animate({ opacity : 1, paddingBottom : 10 , height: 190 , width: 330},1000);
	$(".quote2 h3").text(slides[current].head);
	//$(".quote2 p").text(slides[current].para);
}
	
