﻿var im1 = new Image();
im1.src = "images/hpon.gif";
var im2 = new Image();
im2.src = "images/hpoff.gif";
var need_hp_on;

swimage = new Array;
		swimage[1] = im1.src;
		swimage[2] = im2.src;
		
function lang_switch_en()
{
	//parent.frames[0].change_lang(location.pathname,'en');
	alert('Available soon ! Please take a look at our french pages for the moment, thank you');
	return false;
}

function lang_switch_fr()
{
	parent.frames[0].change_lang(location.pathname,'fr');
	return false;
}

var mail_encoded='&#105;&#110;&#102;&#111;&#064;&#099;&#114;&#101;&#097;&#116;&#111;&#110;&#097;&#108;&#046;&#099;&#104;';

var mail_subject='Demande d&#39;informations';

function writemail() {
  document.write("<a href=\"mailto:"+mail_encoded+"?subject="+mail_subject+"\">"+mail_encoded+"</a>");
}
				
function img_switch1()
{
	if (parent.frames[0].zindex==1) {
		parent.frames[0].hpoff();
		parent.frames[0].zindex=2;
		need_hp_on = 0;
	} else {
		parent.frames[0].hpon();
		parent.frames[0].zindex=1;
		need_hp_on = 1;
	}
	document.image22.src = swimage[parent.frames[0].zindex];
}

function check_frame()
{
	if ( parent.frames.length == 0 ) {
		var fichier = location.pathname.substring(location.pathname.lastIndexOf('/')+1);
		document.location="http://www.creatonal.ch/main.html?"+fichier;
	}
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 20);
	}
	return el;
}


