<!--

/****************************************************************************
**
** Copyright (C) 2005-2006 Intuisphere. All rights reserved.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/


function IS_onresize()
{
	var lx_page=document.is_global_object.width_page;
	var ly_page=document.is_global_object.height_page;
	var v_layer=getElementByKey('global-flash-page');
	var v_html_layer=getElementByKey('is-global-layer');

	var lx_window=getWindowWidth()
	var ly_window=getWindowHeight()	
	var x = 0;
	var y = 0;
	var lx="100%";
	var ly="100%";
	if (document.m_fullpage_resizing_policy)
	{
		lx = "100%";
		ly = "100%";
	}
	else
	{
		
		if (lx>lx_page)
		{
				lx =  ""+lx_page+"px";
		}
		else
		{
				lx =  ""+lx_page+"px";
		}
		if (ly>ly_page)
		{
			ly =  "100%";
		}
		else
		{
			ly =  ""+(ly_page+10)+"px";
		}		
	}
	
	if (document.m_fullpage_resizing_policy)
	{
		v_html_layer.style.display="none";
	}
	else
	{
		v_html_layer.style.display="block";
	}	
	
	if (ly=="100%")
	{
		ly =(ly_window-document.is_global_object.banner_height)+"px";	
	}
	
	displayElement(v_layer,false);
	if (document.is_global_object.page_is_centered)
	{
		var v_layer_centered=getElementByKey('global-flash-page-centered');
		v_layer_centered.style.width = "100%";
		v_layer_centered.style.height = ly;		
	}	
	
	v_layer.style.width = lx;
	v_layer.style.height = ly;	

	displayElement(v_layer,true);
	
	lx_window=getWindowWidth();
	ly_window=getWindowHeight()	;
	
	if (document.is_global_object.page_is_centered)
	{
		var bg_offsetX = 0;
		var bg_offsetY =document.is_global_object.banner_height;
		if (lx_window>lx_page)
		{
			bg_offsetX=(lx_window-lx_page)/2;
		}
		document.body.style.backgroundPosition=bg_offsetX+"px "+bg_offsetY+"px";
  }
}


function IsEnableFullView(b)
{
	document.m_fullpage_resizing_policy = b;
	var v_layer=getElementByKey('is-global-layer');
	if (b)
	{
		v_layer.style.display="none";
	}
	else
	{
		v_layer.style.display="block";
	}
	IS_onresize();
	
}

///////
function IsLayerManager() 
{
	document.is_layer_manager=this;
	this.mouse=new Object();
}

IsLayerManager.prototype.int_getByKey = function(key)
{
	if (document.all)
	{
		// IE code
		return document.all[key];
	}
	else 
	if(document.layers)
	{
		// NN4.x code
		return document.getElementById(key);	
	}
	if (document.getElementById) 
	{
		return document.getElementById(key);	
	}
} ;


IsLayerManager.prototype.setVisible = function(o,b)
{
	if (o)
	{
	o.style.visibility=(b)?"visible":"hidden";	
	}	
} ;


IsLayerManager.prototype.setSize = function(o,lx,ly)
{
	if (o)
	{	
		o.style.width = ""+lx+"px";
		o.style.height = ""+ly+"px";
	}	
} ;

IsLayerManager.prototype.move = function(o,x,y)
{
	if (o)
	{	
		o.style.left = ""+x+"px";
		o.style.top = ""+y+"px";
	}	
} 

IsLayerManager.prototype.write = function(o,txt)
{
	if (o)
	{
		if (document.layers) 
		{
			
		o.document.open()
		o.document.write(txt)
		o.document.close()
		}
		else
		{
		
			o.innerHTML = '';
			o.innerHTML = txt
		}	
	}	
} ;

IsLayerManager.prototype.getWidth = function(o)
{
	if (o)
	{	
		return extractNum(o.style.width);
	}
	return 0;	
}

IsLayerManager.prototype.getHeight = function(o)
{
	if (o)
	{	
		return extractNum(o.style.height);
	}
	return 0;	
}

IsLayerManager.prototype.setOpacity = function(l,opacity)
{
	if (l)
	{
		try
		{
			if(l.filters)
			{
				l.style.filter="Alpha(opacity="+opacity+")";
			}
			else
			{
				l.style.setProperty("-moz-opacity", opacity/100, "");
				l.style.setProperty("-khtml-opacity", opacity/100, "");
				l.style.setProperty("opacity", opacity/100, "");
			}
		}
		catch (e){}
	}
}

/////////

function IsRect(x,y,lx,ly) 
{
	this.x=x;
	this.y=y;
	this.lx=lx;
	this.ly=ly;
}
////
function IsLayer(id) 
{
	if (!document.is_layer_manager)
	{
		document.is_layer_manager=new IsLayerManager();
	}
	this.layer_manager = document.is_layer_manager;
	this.layer = this.layer_manager.int_getByKey(id);
	
}

IsLayer.prototype.setVisible = function(b)
{
	this.layer_manager.setVisible(this.layer,b)
	this.b_is_visible=b;		
} ;

IsLayer.prototype.setSize = function(lx,ly)
{
	this.layer_manager.setSize(this.layer,lx,ly)	
} ;


IsLayer.prototype.move = function(x,y)
{
	this.layer_manager.move(this.layer,x,y)	
} ;

IsLayer.prototype.write = function(txt)
{
	this.layer_manager.write(this.layer,txt)	
} ;

IsLayer.prototype.getWidth = function()
{
	return this.layer_manager.getWidth(this.layer)	
} ;

IsLayer.prototype.getHeight = function()
{
	return this.layer_manager.getHeight(this.layer)	
};

IsLayer.prototype.relativePoxY = function()
{
	var intern_obj=this.layer
	var intern_curtop = 0;
	if (intern_obj.offsetParent)
	{
		while (intern_obj.offsetParent)
		{
			intern_curtop += intern_obj.offsetTop
			intern_obj = intern_obj.offsetParent;
		}
	}
	else if (intern_obj.y)
		intern_curtop += intern_obj.y;
	return intern_curtop;
};

IsLayer.prototype.setOpacity = function(opacity)
{
	this.layer_manager.setOpacity(this.layer,opacity)	
}



/**********************************************************
(c) 2003-2005, Intuisphere
http://www.intuisphere.fr
**********************************************************/



function getScrollXY() 
{
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ eval(""+scrOfX), eval(""+scrOfY) ];
}

function qMin(a,b) 
{
	return (a>b)?b:a;
}
function qMax(a,b) 
{
	return (a<b)?b:a;
}


function getWindowWidth() 
{
	var myWidth = 0;
	if( document.body && ( document.body.clientWidth) ) 
	{
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	}
	else
	if( document.documentElement && (document.documentElement.clientWidth) ) 
	{
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	} 
	else
	if( typeof( window.innerWidth ) == 'number' ) 
	{
	//Non-IE
	myWidth = window.innerWidth;
	} 
	return myWidth;
}

function getWindowHeight() 
{
  var myHeight = 0;
  if( document.body && (document.body.clientHeight ) ) 
  {
    //IE 4 compatible
    myHeight = qMax(myHeight,document.body.clientHeight);
  }

  if( document.documentElement && ( document.documentElement.clientHeight ) ) 
  {
    //IE 6+ in 'standards compliant mode'
    myHeight = qMax(myHeight,document.documentElement.clientHeight);
  } 

  if( typeof( window.innerHeight ) == 'number' ) 
  {
    //Non-IE
    myHeight = qMax(myHeight,window.innerHeight);
  } 
   return myHeight;
}

function getWindowScrollX() 
{
	var array = getScrollXY() ;
	return array[0];
}

function getWindowScrollY() 
{
	var array = getScrollXY() ;
	return array[1];
}

function IS_submitPagePassword(pwd)
{
	if (IS_MD5("#"+document.forms['is-password-form'].is_page_password.value+"#")==pwd)
	{
		IS_successPagePassword(pwd);
	}
	else
	{
		IS_writeLayer(getElementByKey("is-password-form-layer-label"),document.is_global_object.messages.page_password_is_wrong);
	}
	return false;
}



function IS_successPagePassword(pwd)
{
	var l0 =getElementByKey("is-global-layer");
	l0.style.display="block"
	displayElement(l0,true);
	
	var l =getElementByKey("is-password-form-layer");
	displayElement(l,false);
	l.style.display="none";
	IS_SetCookie("cariboost-password",pwd);
	IS_onload();
	IS_put_main_flash_animation();
}

function IS_checkPagePassword(pwd)
{
	if (IS_GetCookie('cariboost-password')==pwd)
	{
		IS_successPagePassword(pwd);
		return true;
	}
	else
	{
		displayElement(getElementByKey("is-password-form-layer"),true);
		document.forms['is-password-form'].is_page_password.focus();
	}
	return false;
}

function IS_keypressPagePassword(event,pwd)
{
	if (event.keyCode==13) 
	{
		return IS_submitPagePassword(pwd);
	}
	
	return(event.keyCode);
}

function IS_SetCookie (name, value) {
	var argv=IS_SetCookie.arguments;
	var argc=IS_SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}

function getCookieVal(offset) {
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1)
      		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function IS_GetCookie (name) {
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen) {
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg)
                        return getCookieVal (j);
                i=document.cookie.indexOf(" ",i)+1;
                        if (i==0) break;}
	return null;
}

function encodeToHtml(text)
{
	var result="";
	for (n=0;n<text.length;n++)
	{
		var code = text.charCodeAt(n)
		var current_car = text.charAt(n)
		/*
		if ((code>=120)||(code == 60 )||(code == 38))
		{
			current_car="&#"+code+";";
		}
		if (code>65535)		
		{
			current_car="?";
		}	
		*/
		result+=current_car
	}
	return result;
}

function dump(o)
{
	var obj
	var desc=""
	for (obj in o)
	{
		var nam = ""+obj;
		if (nam.substring(0,2)!="on")
		desc+=" "+obj;	
	}
	alert(desc);
}

function stringStartsWidth (s,startStr) 
{
	if (s.substring(0,startStr.length)==startStr)
	{
		return true;
	}
	return false;
}


function trimString(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}



function IS_innerLayer(l)
{
	
	if (l)
	{
		if (document.layers) 
		{

		l.document.open()
		//l.document.write(txt)
		l.document.close()
		}
		else
		{
			
			return l.innerHTML
		}
	}
	
}

function IS_writeLayer(l,txt)
{
	if (l)
	{
		/*
		if (document.all)
		{
			l.innerHTML = txt
			return 
		}*/
		if (document.layers) 
		{
			
		l.document.open()
		l.document.write(txt)
		l.document.close()
		}
		else
		{
		
			l.innerHTML = '';
			l.innerHTML = txt
		}
		
		
		
		
		
	}
	
}

function getElementByKey(str)
{
	if (document.all)
	{
		// IE code
		return document.all[str];
	}
	else 
	if(document.layers)
	{
		// NN4.x code
		return document.getElementById(str);	
	}
	if (document.getElementById) 
	{
		return document.getElementById(str);	
	}
}

function displayElement(o,state)
{
	if (o)
	{
		o.style.visibility=(state)?"visible":"hidden";	
		
	}
}

function extractNum(st)
{
	var len  = st.length
	if ((len>0)&&(st.substring(len-2,len)=="px"))
	{
		return eval(st.substring(0,len-2))
	}
	return 0;

}

function getPositionX(o)
{
	if (o)
	{
		return extractNum(o.style.left);
	}
	return 0;
}

function getPositionY(o)
{
	if (o)
	{	
	return extractNum(o.style.top);
	}
	return 0;	
}

function getWidth(o)
{
	if (o)
	{	
	return extractNum(o.style.width);
	}
	return 0;	
}

function getHeight(o)
{
	if (o)
	{	
	return extractNum(o.style.height);
	}
	return 0;	
}

function setSize(o,lx,ly)
{
	if (o)
	{	
		o.style.width = ""+lx+"px";
		o.style.height = ""+ly+"px";
	}	
}

function moveElement(o,x,y)
{
	if (o)
	{
		o.style.left = ""+x+"px";
		o.style.top = ""+y+"px"
	}
}

function getZindex(o)
{
	if (o)
	{	
		return o.style.zIndex;
	}
	return -1;	
}

function setZindex(o,index)
{
	if (o)
	{	
		o.style.zIndex = index;
	}
}

function isDefined(v) 
{ 
	var undef;
	return v!=undef;
}


function replaceSubstring ( inputString, badString, goodString, caseSensitive ) {
fixedReplace = " ";
UI = inputString;
UB = badString;
if ((caseSensitive !=1) && (caseSensitive != true)) {
UI = inputString.toUpperCase();
UB = badString.toUpperCase();
}
badEnd = -1;
badLoc = UI.indexOf(UB);
if (badLoc != -1) {
for (x=1; (badLoc != -1); x++) {
fixedReplace = fixedReplace + inputString.substring((badEnd + 1), badLoc) + goodString
badEnd = badLoc + UB.length - 1;
badLoc = UI.indexOf(UB, (badLoc + 1)); }
fixedReplace = fixedReplace + inputString.substring((badEnd + 1), inputString.length); }
else { fixedReplace = inputString; }
fixedReplace = trimString(fixedReplace);
return fixedReplace;
}


function internal_IS_comp_initialize_handlers_type1(key,b_has_event_param)
{
	var on_handler = document.intuisphere_handlers[key];
	if (on_handler)
	{
		var fct_handler = function(e)
		{
			if (b_has_event_param)
			{
				if (document.all) e = window.event;
			}
		
			if (key=="onmousemove")
			{
				if (document.is_layer_manager)
				{
					document.is_layer_manager.mouse.x = e.clientX;
					document.is_layer_manager.mouse.y = e.clientY;
				}	
			}		
			var return_value = true;
			for (var i=0;i<on_handler.length;i++)
			{
				if (b_has_event_param)
				{
					if (eval("IS_handler_"+key+"_comp_"+on_handler[i]+"(e)")==false)
					{
						return_value = false; 
					}
				}
				else
				{
					if (eval("IS_handler_"+key+"_comp_"+on_handler[i]+"()")==false)
					{
						return_value = false; 
					}
				}
			}
			
			
			return return_value;
			//return true;
		}
		
		if (key=="onmousewheel")
		{
			if (window.addEventListener) 
			{
				window.addEventListener("DOMMouseScroll",fct_handler, false);
			}
			else 
			{ 
				document.onmousewheel = fct_handler; 
			}			
		}
		else
		{
			eval ("document."+key+" = fct_handler")
		}
	}	
}

function IS_comp_initialize_handlers(array)
{
	document.intuisphere_handlers = new Array();
	
	for (var i=0;i<array.length;i++)
	{
		var s = array[i];
		
		var n = s.indexOf ("@");
		if (n>-1)
		{
			id = s.substring(n+1);
			var handlers = s.substring(0,n).split("-");
			for (var h=0;h<handlers.length;h++)
			{
				if (!document.intuisphere_handlers[handlers[h]])
				{
					document.intuisphere_handlers[handlers[h]] = new Array();
				}
				var l = document.intuisphere_handlers[handlers[h]].length
				document.intuisphere_handlers[handlers[h]][l]=id;
			}
			
		}
	}	
/////onload handlers
	var onload_handler = document.intuisphere_handlers['onload'];
	if (onload_handler)
	{
		//alert('onload_handler '+onload_handler.length)
		for (var i=0;i<onload_handler.length;i++)
		{
			eval("IS_handler_onload_comp_"+onload_handler[i]+"()")
		}
		//alert('onload_handler2')
	
	}
	internal_IS_comp_initialize_handlers_type1("onkeypress",true);
	internal_IS_comp_initialize_handlers_type1("onkeydown",true);
	internal_IS_comp_initialize_handlers_type1("onmousemove",true);
	internal_IS_comp_initialize_handlers_type1("onmousewheel",true);

	internal_IS_comp_initialize_handlers_type1("onmousedown",false);
	internal_IS_comp_initialize_handlers_type1("onclick",false);
}


function IS_blockRightClick()
{
	if (window.Event) 
	document.captureEvents(Event.MOUSEUP); 
	function nocontextmenu() 
	{ 
		event.cancelBubble = true 
		event.returnValue = false; 
		return false; 
	} 
	
	function IS_blockIEContextMenu_fct()
	{
		return false;
	}
	
	function norightclick(e) 
	{ 
		if (window.Event) 
		{ 
			if (e.which == 2 || e.which == 3) 
			return false; 
		} 
		else 
		if (event.button == 2 || event.button == 3) 
		{ 
			event.cancelBubble = true 
			event.returnValue = false; 
			return false; 
		} 
	} 
	
	window.oncontextmenu=IS_blockIEContextMenu_fct
	document.oncontextmenu = nocontextmenu; 
	document.onmousedown = norightclick; 
}


//-->