

window.onload = function () {
		if (self.dispCO) {
			dispCO();
			window.onresize = dispCO;
			/*jQuery(function()
			{
				setJScrollPane();
			});*/
		}
}

function setJScrollPane()
{
  jQuery('.scroll-pane').jScrollPane({showArrows:true, scrollbarWidth: 12, arrowSize: 16, dragMinHeight: 50 });
}

// JavaScript Document
function preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function hideContent(id) {
  if (document.getElementById(id)) document.getElementById(id).style.display='none'; return null;
}

function displayContent(id) {
  if (document.getElementById(id)) document.getElementById(id).style.display='block'; return null;
}

function dispCO()
{
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth;
	  winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  winH = document.body.offsetHeight;
	 }
	}
	if (winW<1000 || winH<600) hideContent('comocean');
	else displayContent('comocean');
	//alert(winW+' x '+winH);
	if (winW<=1030) //1165
	{
	  document.body.style.backgroundPosition="0 0";
	  document.body.style.textAlign="left";
	  document.getElementById('container').style.marginLeft = "35px";
	  document.getElementById('container').style.marginRight = "0";
	}
	else
	{
	  document.body.style.backgroundPosition="top center";
	  document.body.style.textAlign="center";
	  document.getElementById('container').style.marginRight = "auto";
	  document.getElementById('container').style.marginLeft = "auto";
	}
}

function putFrame() {
		if (navigator.appName.indexOf("Microsoft")!=-1) {	
			var d    = document.getElementById('produit-commande');
      f    = document.createElement("iframe");
      f.id = "theFrame";
      with(f.style) {
          position    = "absolute";
          width        = "125px";
          height        = "25px";
          top            = "20px";
          left        = "2px";
          zIndex        = "1";
          overflow   = "hidden";
      }
      d.appendChild(f);
    }
  }
  
function removeFrame() {
	if (navigator.appName.indexOf("Microsoft")!=-1) {	
		var f = document.getElementById("theFrame");
    if (f) f.parentNode.removeChild(f);
    }
  }
  
function switch_livraison()
{
if (document.getElementById('livraison_state').checked) document.getElementById('livraison-edit').style.display='block';
else document.getElementById('livraison-edit').style.display='none';
}