

         function tapHalo(gFile)
            {		
			document.getElementById(gFile).src="images/focus_ico.png";
			
				setTimeout(function()
				{
					document.getElementById(gFile).src="images/"+gFile+".png";					
				}, 200);  		
			
			
			}
			
			
         function scrolldown()
            {			
			
				setTimeout(function()
				{
					window.scrollTo(0, 1);
				}, 400);  		
			
			
			}
			
			/*
			function showImg(iURL) {
				document.getElementById("fullscreen").style.display = "block";
				document.getElementById("fullimg").innerHTML = "<img onclick='hideImg();' width='100%' src='"+iURL+"'/>"; 	
			}
			
			function hideImg() {
				document.getElementById("fullscreen").style.display = "none"; 
			}
			*/
			
			function showImg (iMode, iUrl) {
			
			var imgheight="90";
			
				if (iMode=="display") {
				document.getElementById("diapo").innerHTML = "<img width='100%' src='"+iUrl+"'/>";
				}
				if (iMode=="fullscreen") {
				
					if (document.getElementById("diapo").style.height ==imgheight+"px") {
					document.getElementById("diapo").style.height ="auto";
					}
					else {
					document.getElementById("diapo").style.height =imgheight+"px";	
					}
				
				}
					
			}
			
			
			function switchmode(mID, vSource, vPosition, vKeyword, vMax1, vMax2, vMax3, vTheme) {

				var unedate = new Date(2010,12,24);
				
				
								
				if (mID== 1) {
				document.getElementById("theme").className = "focus1_off"; 
				document.getElementById("titre").className = "focus3_on"; 
				document.getElementById("source").className = "focus2_off"; 
				document.getElementById("fleche_next").style.top = "91px"; 
				document.getElementById("fleche_prev").style.top = "91px"; 
				
				var suivant=parseInt(vPosition)+1;
				var precedent=parseInt(vPosition)-1;
				
					if (precedent<0) {
					document.getElementById("previous").src="images/vide.gif";
					document.getElementById("previous").setAttribute("onclick", "", false);
					}
					else {
					document.getElementById("previous").src="images/arrow_l.png";
					document.getElementById("previous").setAttribute("onclick", "ajax_getContent('"+vSource+"','"+precedent+"','"+vKeyword+"','"+vTheme+"');", false)
					}
					if (suivant>vMax1) {
					document.getElementById("next").src="images/vide.gif";
					document.getElementById("next").setAttribute("onclick", "", false);
					}
					else {
					document.getElementById("next").src="images/arrow_r.png";
					document.getElementById("next").setAttribute("onclick", "ajax_getContent('"+vSource+"','"+suivant+"','"+vKeyword+"','"+vTheme+"');", false);
					}
					
				document.cookie ="fxds_reader_nav=mode1;expires="+unedate.toUTCString();

				}
				else if (mID== 2) {
				document.getElementById("theme").className = "focus1_off"; 
				document.getElementById("titre").className = "focus3_off"; 
				document.getElementById("source").className = "focus2_on"; 
				document.getElementById("fleche_next").style.top = "54px"; 
				document.getElementById("fleche_prev").style.top = "54px"; 

				var suivant=parseInt(vSource)+1;
				var precedent=parseInt(vSource)-1;

					if (precedent<1) {
					document.getElementById("previous").src="images/vide.gif";
					document.getElementById("previous").setAttribute("onclick", "", false);
					}
					else {		
					document.getElementById("previous").src="images/arrow_l.png";
					document.getElementById("previous").setAttribute("onclick", "ajax_getContent('"+precedent+"','0','','"+vTheme+"');", false);
					}
					if (suivant>vMax2) {
					document.getElementById("next").src="images/vide.gif";
					document.getElementById("next").setAttribute("onclick", "", false);
					}
					else {
					document.getElementById("next").src="images/arrow_r.png";
					document.getElementById("next").setAttribute("onclick", "ajax_getContent('"+suivant+"','0','','"+vTheme+"' );", false);
					}
		
				document.cookie ="fxds_reader_nav=mode2;expires="+unedate.toUTCString();
				
				}
				else if (mID== 3) {
				document.getElementById("theme").className = "focus1_on"; 
				document.getElementById("titre").className = "focus3_off"; 
				document.getElementById("source").className = "focus2_off"; 
				document.getElementById("fleche_next").style.top = "17px"; 
				document.getElementById("fleche_prev").style.top = "17px"; 
				
				var suivant=parseInt(vPosition)+1;
				var precedent=parseInt(vPosition)-1;
				

					if (precedent<0) {
					document.getElementById("previous").src="images/vide.gif";
					document.getElementById("previous").setAttribute("onclick", "", false);
					}
					else {		
					document.getElementById("previous").src="images/arrow_l.png";
					document.getElementById("previous").setAttribute("onclick", "ajax_getContent('1','0','','"+precedent+"');", false);
					}
					if (suivant==vMax3) {
					document.getElementById("next").src="images/vide.gif";
					document.getElementById("next").setAttribute("onclick", "", false);
					}
					else {
					document.getElementById("next").src="images/arrow_r.png";
					document.getElementById("next").setAttribute("onclick", "ajax_getContent('1','0','','"+suivant+"' );", false);
					}
				
					if (vTheme=="search") {
					document.getElementById("next").src="images/arrow_r.png";
					document.getElementById("next").setAttribute("onclick", "ajax_getContent('1','0','','all' );", false);	
					}
					
				document.cookie ="fxds_reader_nav=mode3;expires="+unedate.toUTCString();
				}
			}
			
	 function readerSearch(gType) {
       var saisie = prompt("FXDS.reader / search for:", "")
	   
       if (saisie!=null) {
		   	document.getElementById("page").innerHTML="<div class=\"news\"><div class=\"notfound\"><span class=\"oups\">Loading in progress...</span><br/>We are gathering data from our pipes... please be patient!</div></div>";
          ajax_getContent('all','0', saisie.toLowerCase(), 'all');
		  var unedate = new Date(2010,12,24);
		  document.cookie ="fxds_reader_nav=mode1;expires="+unedate.toUTCString();
		  scrolldown();
       }
	   
   }		
   function createAccount(gType) {
	   
	if (gType=="login") {
	document.getElementById("msgalert").innerHTML="<span class=\"oups\">Please sign-in<br/></span><div onclick=\"createAccount('register');\">Not member? Tap here to register!</div>";	
	document.getElementById("invdiv").innerHTML="";
	document.getElementById("loginbutton").value="Login";	
	}
	else if (gType=="register") {
	document.getElementById("msgalert").innerHTML="<span class=\"oups\">Create an account<br/></span><div onclick=\"createAccount('login');\">Already member? Tap here to login!</div>";	
	document.getElementById("invdiv").innerHTML="<input type=hidden name='status' value='register'>";
	document.getElementById("loginbutton").value="Register";
	}
	
   }		
   

function VerifForm(formulaire)
	{
	adresse = formulaire.login.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1) && formulaire.password.value!="")
		{
		formulaire.submit();
		return(true);
		}
	else
		{
		alert('Please enter valid information...');
		return(false);
		}
	}


function showText(gMode) {
	
	if (gMode=="big") {
	document.getElementById("smallpost").style.height = "auto"; 
	document.getElementById("smallpost").style.overflow = "visible"; 
	document.getElementById("smallpost").setAttribute("onclick", "showText();", false);
	
	}
	else {
	document.getElementById("smallpost").style.height = "176px"; 
	document.getElementById("smallpost").style.overflow = "hidden"; 
	document.getElementById("smallpost").setAttribute("onclick", "showText('big');", false);
	}

}

