       //important Url pour les iframes
	   
	   //Prod
	   //var urlSite=""; 
	   //DEV
	   var urlSite="http://partenaires.ricoh.fr";
		
		
(function($) {
		  var cache = [];
		  // Arguments are image paths relative to the current page.
		  $.preLoadImages = function() {
			var args_len = arguments.length;
			for (var i = args_len; i--;) {
			  var cacheImage = document.createElement('img');
			  cacheImage.src = arguments[i];
			  cache.push(cacheImage);
			}
		  }
		})(jQuery)
		jQuery.preLoadImages("img/fr_on.png", "img/bt_connexion_on.png","img/bt_suivie_de_dossier_on.png","img/bt_ensavoirplus_on.png");

		function formatText(index, panel) {
		  return index + "";
	    }
   		function openIns() {
			$("div#panelSuiv").slideUp("slow", function() {
 					$("div#panelIns").slideDown("slow");
					$("#openIns").addClass('current');
					$("#openSuiv").removeClass('current');
		  			$("#close a").css('display', 'block');
					if(!$("#o00C4_Frame").attr('src') ){
						$("#o00C4_Frame").attr('src', urlSite+'/EnregistrementDirectWeb/pages/CreerCompteInit.jsp');
					}
					if(!$("#frame_loginIns").attr('src') ){
						$("#frame_loginIns").attr('src', urlSite+'/Portal_Web/pages/login_pebus_v2.jsp');
					}
			});
	    }
   		function openSuiv() {
		  $("div#panelIns").slideUp("slow", function() {
 					$("#openIns").removeClass('current');
		  			$("div#panelSuiv").slideDown("slow");
					$("#openSuiv").addClass('current');
		  			$("#close a").css('display', 'block');
					if(!$("#frame_SuiviDossier").attr('src') ){
						$("#frame_SuiviDossier").attr('src', urlSite+'/SuiviDossier/pages/index.jsp');
					}
					

					
			});
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "swing",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 6000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 500,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
			$(".button").fancybox({
				'width'				: '90%',
				'height'			: '90%',
			    'padding'           : 0,
		        'autoScale'     	: true,
		        'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
            
        });
		$(document).ready(function() {
	
			// Expand Panel
			$("#openIns").click(function () {openIns()});	
			$("#openSuiv").click(function () {openSuiv()});		
			$("#inslink").click(function () {openIns()});		
			$("#subscribelink").click(function () {openIns()});		
			$("a.bt_register").click(function () {parent.$.fancybox.close();openIns();});	
			// Collapse Panel
			$("#close").click(function(){
				$("div#panelIns").slideUp("slow");
				$("div#panelSuiv").slideUp("slow");
				$("#close a").css('display', 'none');
				$("#openIns").removeClass('current');
		  		$("#openSuiv").removeClass('current');
		  				
			});		
			
			// Switch buttons from "Log In | Register" to "Close Panel" on click
			$("#toggle a").click(function () {
				$("#toggle a").toggle();
			});	

			$("#mdpoublier").click(function(){
				
				$("#mdpspan").slideToggle("slow");
				$("#o7148_Frame").attr('src', urlSite+'/Admin_ConsoleWeb/pages/LostPWDInit.jsp');
				
			});	
		
		});
