/*!
 * scripts.js
 */
// Create the tooltips only on document load
$(document).ready(function() 
{
	$.fn.qtip.styles.tools = { // style for tools
      padding: '2px 5px',
      background: '#333',
			width : 100,
      color: '#fff',
      textAlign: 'center',
      border: {
         width: 0,
         radius: 3,
         color: '#333'
      },
      tip: { // define speach arrow
         corner: 'bottomMiddle', // position of the arrow
         color: '#333',
         size: {
            x: 15, 
            y : 5 
         }
      }
	}
	$.fn.qtip.styles.map = { // style for tools
      padding: '2px 5px',
      background: '#00ccff',
      color: '#000',
      textAlign: 'center',
      border: {
         width: 0,
         radius: 3,
         color: '#00ccff'
      },
      tip: { // define speach arrow
         corner: 'bottomLeft', // position of the arrow
         color: '#00ccff',
         size: {
            x: 15, 
            y : 5 
         }
      }
	}
   // By suppling no content attribute, the library uses each elements title attribute by default
   $('.tools a[href] img').qtip({
      content: {
         text: $(this).attr('alt') // Use each elements title attribute
      },
			position: {
				corner: {
					 target: 'topMiddle',
					 tooltip: 'bottomMiddle'
				}
			},
			style: 'tools'
   });
   
});

// Create the tooltips only when document ready
$(document).ready(function()
{
	
	$(".cs_blocs .blocs_titre a").click(function () {
		$(this).parent().parent().find('.blocs_destination').toggle("slow");
	});   

   // Use the each() method to gain access to each elements attributes
   $('#europamap area').each(function()
   {
      $(this).qtip(
      {
         content: $(this).attr('alt'),
			position: {
				corner: {
					 target: 'topRight',
					 tooltip: 'bottomLeft'
				},
				adjust: { x: -5, y: -5 }
			}, // Use the ALT attribute of the area map
         style: 'map'
      });
   });
});

// digital clock in jquery
function updateClock ( )
 	{
 	var currentTime = new Date ( );
  	var currentTimeString = currentTime.f("E. MMM dd, yyyy HH:mm:ss");
   	$("#clock").html(currentTimeString);
   	  	
 }

$(document).ready(function()
{
   setInterval('updateClock()', 1000);
});


$(function() {
    $('#login').hover(
        function () {
            $(this).stop(true,true).animate({
                    'top':'0'
                }, 300).removeClass('off');
        },
        function () {
            $(this).stop(true,true).animate({
                    'top':'-100px'
                }, 300).addClass('off');
        }
    );
});
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

