var cryptedmailarray;
cryptedmailarray= new Array(119,101,98,109,101,115,116,114,101,64,114,101,97,108,99,114,111,99,104,101,46,99,111,109);
var cryptedmailwebmestre='';
for (i=0;i<cryptedmailarray.length;i++)
cryptedmailwebmestre+=String.fromCharCode(cryptedmailarray[i]);

cryptedmailarray= new Array(105,110,102,111,64,114,101,97,108,99,114,111,99,104,101,46,99,111,109);
var cryptedmailinfo='';
for (i=0;i<cryptedmailarray.length;i++)
cryptedmailinfo+=String.fromCharCode(cryptedmailarray[i]);

cryptedmailarray= new Array(99,111,110,116,97,99,116,64,114,101,97,108,99,114,111,99,104,101,46,99,111,109);
var cryptedmailcontact='';
for (i=0;i<cryptedmailarray.length;i++)
cryptedmailcontact+=String.fromCharCode(cryptedmailarray[i]);

cryptedmailarray= new Array(100,106,105,109,115,56,49,64,102,114,101,101,46,102,114);
var cryptedmaildesign='';
for (i=0;i<cryptedmailarray.length;i++)
cryptedmaildesign+=String.fromCharCode(cryptedmailarray[i]);

//if (parent.frames['principal'] == undefined) parent.location.href='http://www.realcroche.com/debut.html';

function createMailLink (name, domain) {
document.write('<a href="mailto:'+name+'@'+domain+'">');	
}

function envoisur(name, domain, text, aclass) {
	if (text == 'undefined') {
		text = 'Contact';
	}
	if (aclass == 'undefined') {
		document.write('<a href="javascript:void(0)" onclick="window.location=\'mail\u0074o\u003a'+name+'@'+domain+'\'">'+text+'</a>');
	} else {
		document.write('<a class="'+ aclass + '" href="javascript:void(0)" onclick="window.location=\'mail\u0074o\u003a'+name+'@'+domain+'\'">'+text+'</a>');
	}
}


function ieCompatTest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}


function PopupImageAutoSize(imgPath, imgTitle) {
	if (! imgTitle||imgTitle == undefined) {
		imgTitle="";
	}
	w=open('','image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');	
	w.document.write('<HTML><HEAD><TITLE>'+imgTitle+'<\/TITLE><\/HEAD>');
	w.document.write('<SCRIPT type="text/javascript">function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width + 25,document.images[0].height + 50); window.focus();} else { setTimeout(check(),100) } }<\/SCRIPT>');
	w.document.write('<BODY onload="checksize();" leftMargin="0" topMargin="0" marginwidth="0" marginheight="0"><IMG src="' + imgPath + '" border="0" title="' + imgTitle + '">');
	w.document.write('<\/BODY><\/HTML>');
	w.document.close();
}

function checksize()  {
	if (document.images["photo"].complete) {
		with (document.getElementById("popuptable")) {
		window.resizeTo(clientWidth+10,clientHeight+60);
		window.focus();
		}
	} else {
		setTimeout("checksize()",100);
	}
}



function getPagedim() {
   if (window.innerWidth || window.opera){
   pageScrollH=window.pageXOffset;
   pageScrollV=window.pageYOffset;
   pageWidth=window.innerWidth;
   pageHeight=window.innerHeight;
   }
   else if (document.body){
   pageScrollH=ieCompatTest().scrollLeft;
   pageScrollV=ieCompatTest().scrollTop;
   pageWidth=ieCompatTest().offsetWidth;
   pageHeight=ieCompatTest().offsetHeight;
   } 
}


function bookmark() {
var bookmarkurl="http://www.realcroche.com/",
	bookmarktitle="Ré'Al Croche Festival";

	if(navigator.userAgent.indexOf("Firefox") != -1)
	{
		window.sidebar.addPanel(bookmarktitle, bookmarkurl,"");
	}
	else if(navigator.userAgent.indexOf("MSIE") != -1)
	{
		window.external.AddFavorite(bookmarkurl,bookmarktitle);
	}
	else
	{
		alert('Pour votre navigateur il faut le faire manuellement, désolé...');
	}
}

function autoUpdateFrame() {
	if (parent.firstload == true) {
		window.location.href = unescape(window.location.pathname);
	}
	parent.firstload = false;
}


function hideObj(objId) {
  obj = document.getElementById(objId);
  obj.style.visibility='hidden';
}

function showObj(objId,x,y) {
  obj = document.getElementById(objId);
  obj.style.left=x+'px';
  obj.style.top=y+'px';
  obj.style.visibility='visible';
}

function initFade(imageId,step,speed,delay,pos) {
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility='visible';
  window.setTimeout("fadeIn('"+imageId+"',0,"+step+","+speed+","+pos+");", delay, "Javascript");
}

function initUnfade(imageId,step,speed,delay) {
  window.setTimeout("fadeOut('"+imageId+"',99.99,"+step+","+speed+");", delay, "Javascript");
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity,step,speed,pos) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    obj.style.top=pos+'px'; 
	if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += step;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+","+step+","+speed+","+pos+")",speed, "Javascript");
	}
  }
}

function fadeOut(objId,opacity,step,speed) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
	if (opacity >= 0) {
      setOpacity(obj, opacity);
      opacity -= step;
      window.setTimeout("fadeOut('"+objId+"',"+opacity+","+step+","+speed+")",speed, "Javascript");
	} else {
		obj.style.visibility='hidden';
		obj.style.top='-1000px';
	}
  }
}

function initScroll(objId,maxpos,step,speed,delay) {
  window.setTimeout("scrollObj('"+objId+"',"+maxpos+","+step+","+speed+")",delay, "Javascript");
}

function setPosition(obj,x,y) {
  obj.style.left=x;
  obj.style.top=y;
}

function scrollObj(objId,maxpos,step,speed) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    curpos = parseInt(obj.style.top);
	if (curpos > maxpos) {
      curpos -= step;
      setPosition(obj,0,curpos);
      window.setTimeout("scrollObj('"+objId+"',"+maxpos+","+step+","+speed+")",speed, "Javascript");
	}
  }
}

