/**
 * Created by JetBrains PhpStorm.
 * User: Andy Weisner
 * Date: 15.12.11
 * Lat update : 18.01.2012 (Andy) 
 * Time: 18:15
 * To change this template use File | Settings | File Templates.
 */
 
       	
		var counterIntro=0;
	    var changeTimeOut;
	 	var changeTiming=10000;
		var introData=new Array();
		
		introData[0]={	url:'/website/static/h/jobs/intro_jobs.html',
						background:'url("http://rsk-test.i-rsk.com/website/static/i/bg_content.png") repeat-x scroll 0 0 transparent',
						duration:12000
			};
		introData[1]={	url:'/website/static/h/FBM/intro_FBM.html',
						background:'url("http://rsk-test.i-rsk.com/website/static/i/bg_content.png") repeat-x scroll 0 0 transparent',
						duration:12000
			};
		
		introData[2]={	url:'/website/static/h/nissanapp/intro_nissanapp.html',
						background:'url("http://rsk-test.i-rsk.com/website/static/i/bg_content.png") repeat-x scroll 0 0 transparent',
						duration:12000
			};	
		introData[3]={	url:'/website/static/h/stratic/intro_stratic.html',
						background:'url("http://rsk-test.i-rsk.com/website/static/i/bg_content.png") repeat-x scroll 0 0 transparent',
						duration:12000
			};
						
/* new version with transitions*/ 
	  function changeIntro(){
		  
			
		  counterIntro=counterIntro>introData.length-1?0:counterIntro;
		   $('#introframe').attr('src',introData[counterIntro].url);
		   $('#container').css('background',introData[counterIntro].background);
		   var  changeDuration=introData[counterIntro].duration;
		   $('.progressbar').css('width',0).delay(300).animate({width: '960px'},
		   														changeDuration,
																'linear',
																function(){ 
																	$('.intro-cover').fadeIn(800,
																		function(){
																			changeIntro();	
																		}
																	);
																	
																	}
																);
		  counterIntro++;
	  }
    

		
/* this function is called by the Header Intro page (inside Iframe) when ready loaded*/ 	
function showIntro(){
	//console.log("showIntro !");
	  $('.intro-cover').fadeOut(600);
}
/* start header rotator when dom ready */ 
$(document).ready(function(){
		changeIntro();
});
