/*
 * SimpleModal Basic Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2008 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: basic.js 164 2008-12-02 23:31:54Z emartin24 $
 *
 */

$(document).ready(function () {
	$('#basicModal input.basic, #basicModal a.basic , a.basic').click(function (e) {
		e.preventDefault();
		$('#basicModalContent').modal();
	});
	


	
});





$(document).ready(function(){
var newsoption1 = {
  firstname: "mynews",
  secondname: "showhere",
  thirdname:"news_display",
  fourthname:"news_button",
  effectis: '0',
  effectspeed:'200',
  isauto:'false'
}

$.init_news(newsoption1);


var newsoption2 = {
  firstname: "mynews2",
  secondname: "showhere2",
  thirdname:"news_display",
  fourthname:"news_button2",
  effectis: '0',
  effectspeed:'200',
  isauto:'false'
}

$.init_news(newsoption2);


var newsoption3 = {
  firstname: "mynews3",
  secondname: "showhere3",
  thirdname:"news_display",
  fourthname:"news_button3",
  effectis: '0',
  effectspeed:'200',
  isauto:'false'
}

$.init_news(newsoption3);
});


function openscreen(screen,width,height)
{
	window.open(screen, "screen", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width="+width+", height="+height+", top=50, left=50");
}



var RESULTAT=new Array() //PORTPRO
RESULTAT[0]='<div class="menuitems"><a href="<?=$NewLangRoot;?>ppro_results.php#strategy">Stratégie & portefeuilles</a></div>'
RESULTAT[0]+='<div class="menuitems"><a href="<?=$NewLangRoot;?>ppro_results.php#historic">Historiques</a></div>'
RESULTAT[1]=870
RESULTAT[2]=216
RESULTAT[3]=160

function openrefer()
{
	var largeur=520;
	var hauteur=270;
	var left=(screen.width-largeur)/2;
	var top=(screen.height-hauteur)/2;
	window.open("<?=$NewLangRoot;?>swingreferafriend.php?target=WHSMAIN", "Referafriend", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width="+largeur+", height="+hauteur+", left="+left+", top="+top);
}

function openscreen(screen,width,height)
{
	window.open(screen, "screen", "toolbar=no, location=no, directories=no, status=yes, scrollbars=no, resizable=no, copyhistory=no, width="+width+", height="+height);
}

function register(produit,width,height)
{
	var left=(screen.width-width)/2;
	var top=(screen.height-height)/2;
	window.open("<?=$NewLangRoot;?>gids.php?prod="+produit, "Feedback", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width="+width+", height="+height+", left="+left+", top="+top);
}

function FormValidation_open_ma_fr() {
	var msg = "";
	
	if (document.MyForm.FName.value == "") msg += "\n   - Prénom";
	if (document.MyForm.LName.value == "") msg += "\n   - Nom";
	if (document.MyForm.Country.value == "") msg += "\n   - Pays";
	if (document.MyForm.Phoneday.value == "") msg += "\n   - Téléphone";
	if ((document.MyForm.Email.value == "")
			|| (document.MyForm.Email.value.indexOf('@') == -1)
			|| (document.MyForm.Email.value.indexOf('.') == -1))
		msg += "\n   - E-mail";
	if (document.MyForm.language.value == "") msg += "\n   - Langue";
	if (msg != "")
	{
		msg =	"Les champs suivants ne sont pas correctement remplis:\n" + 
		msg + "\n\nCorrigez et validez à nouveau!";
		alert(msg);
		return false;
	}
	else
	{
		MM_showHideLayers('Sablier','','show');
		MM_showHideLayers('DisplayButton','','hide');
		return true;
	}
}


function FormValidation_open_ma_nl() {
	var msg = "";
	
	if (document.MyForm.FName.value == "") msg += "\n   - Voornaam";
	if (document.MyForm.LName.value == "") msg += "\n   - Familienaam";
	//if (document.MyForm.Zip.value == "") msg += "\n   - Postcode ";
	if (document.MyForm.Country.value == "") msg += "\n   - Land";
	if (document.MyForm.Phoneday.value == "") msg += "\n   - Telefoon";
	if ((document.MyForm.Email.value == "")
			|| (document.MyForm.Email.value.indexOf('@') == -1)
			|| (document.MyForm.Email.value.indexOf('.') == -1))
		msg += "\n   - E-mail";
	if (document.MyForm.language.value == "") msg += "\n   - Taal";
	if (msg != "")
	{
		msg =	"De volgende velden werden niet correct ingevuld:\n" + 
		msg + "\n\nVerbeter deze aub en klik nogmaals op submit!";
		alert(msg);
		return false;
	}
	else
	{
		MM_showHideLayers('Sablier','','show');
		MM_showHideLayers('DisplayButton','','hide');
		return true;
	}
}


function FormValidation_open_ma_de() {
	var msg = "";
	
	if (document.MyForm.FName.value == "") msg += "\n   - Vorname";
	if (document.MyForm.LName.value == "") msg += "\n   - Name";
	//if (document.MyForm.Zip.value == "") msg += "\n   - Postleitzahl";
	if (document.MyForm.Country.value == "") msg += "\n   - Land";
	if (document.MyForm.Phoneday.value == "") msg += "\n   - Telefonnummer";
	if ((document.MyForm.Email.value == "")
			|| (document.MyForm.Email.value.indexOf('@') == -1)
			|| (document.MyForm.Email.value.indexOf('.') == -1))
		msg += "\n   - Email";
	if (document.MyForm.language.value == "") msg += "\n   - Sprache";
	if (msg != "") {
		msg =	"Folgende Auskünfte wurden nicht richtig ausgefüllt:\n" +
		msg + "\n\nKorrigieren und bestätigen noch einmal!";
		alert(msg);
		return false;
	}
	else 
	{
	
		MM_showHideLayers('Sablier','','show');
		MM_showHideLayers('DisplayButton','','hide');
		return true;	
	}
} 


function LoadMovie(URL,SizeX,SizeY)
{
	var W=SizeX+8
	var H=SizeY+35
	var left=(screen.width-W)/2;
	var top=(screen.height-H)/2;
	window.open(URL, "ScreenShot", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width="+W+", height="+H+", left="+left+", top="+top);
}



function openscreen(screen,width,height)
{
	window.open(screen, "screen", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width="+width+", height="+height+", top=50, left=50");
}


//POP-UP

function js_popup(w, h, path) {

	
    var win = window.open(path, '', 'toolbars=no,scrollbars=yes,width=' + w + ',height=' + h + ',resizable=yes');
	win.focus();

	var posX = (window.screen.width/2) - (w/2);
	var posY = (window.screen.height/2) - (h/2);

	win.moveTo(posX,posY);
}
/*------------------------------------------------------------------------*/
/*ZOOM IMAGE ajouter un div en fin de page pour inserer l'image à afficger*/
/*------------------------------------------------------------------------*/
function show_image(nom,top1,left1) { 

   var floatimg = document.getElementById("imaage");
   floatimg.setAttribute("src", "../images/"+nom); 
   elem = document.getElementById('IMB');
   elem .setAttribute("position","absolute");

   elem.style.visibility = 'visible';
   elem.style.top = top1+"px";
   elem.style.left = left1+"px";
   
 }
 
 function MM_showHideLayers() { //v6.0
   elem = document.getElementById('IMB');
 
   elem.style.visibility = 'hidden';
}
/*------------------------------------------------------------------------*/
/*----------------ONGLET SUR LA PAGE D4ACCUEIL----------------------------*/
/*------------------------------------------------------------------------*/

function ChangeOnglet_2(active, nombre, tab_prefix, contenu_prefix) 
{   
    for (var i=1; i < nombre + 1; i++) 
    {
        document.getElementById(contenu_prefix + i).style.display = 'none';
        document.getElementById(tab_prefix + i).className = '';
    }  
    
    document.getElementById(contenu_prefix+active).style.display = 'block';
    document.getElementById(tab_prefix+active).className = 'active';   
}    

/*------------------------------------------------------------------------*/


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;
  
 
}


/*------------------------------------------------------------------------*/
/*----------------------------------------LOAD MOVIE ----------------------*/
/*------------------------------------------------------------------------*/

function LoadMovie(URL,SizeX,SizeY)
{
	var W=SizeX+8
	var H=SizeY+35
	var left=(screen.width-W)/2;
	var top=(screen.height-H)/2;
	window.open(URL, "ScreenShot", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width="+W+", height="+H+", left="+left+", top="+top);
}


/*------------------------------------------------------------------------*/
/*----------------------------------------LOAD GIF  ---------------------*/
/*------------------------------------------------------------------------*/
function LoadGIF(URL,SizeX,SizeY)
{
	var W=SizeX+8
	var H=SizeY+35
	var left=(screen.width-W)/2;
	var top=(screen.height-H)/2;
	window.open(URL, "ScreenShot", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width="+W+", height="+H+", left="+left+", top="+top);
}