function lien(l, pop) {
    u = "ht"+"tp"+"://"+l;
    if (!pop) {
        document.location.href=u;
    } else {
        window.open(u);
    }
}

function hiddenLink ( url, param ) {
	u = "ht"+"tp"+"://"+ location.host +"/"+ url + param;
	document.location.href=u;
}

function setWS(s){
    window.status=s;
    return true;
}
function clearWS(){
    window.status='';
}

//Interdiction caractères speciaux mot de passe
function validPass(evt) {
var keyCode = evt.which ? evt.which : evt.keyCode;
if (keyCode==8 || keyCode==9 || keyCode==46 || keyCode==35 || keyCode==36 || keyCode==37 || keyCode==39) return true;

var interdit = 'àâäãçéèêëìîïòôöõùûüñ &*?!:;,\t#~"^¨%$£?²¤§%*()[]{}<>-_@°+=µ?.|\\/`\'';

if (interdit.indexOf(String.fromCharCode(keyCode)) >=0) {
	alert("Merci de ne pas saisir de caractères spéciaux");
return false;
}
}

//START Bluray functions
function hideBluRaypopUp(type, expiredays, itemId, sb) {
    var doc = document.getElementById("bluray_popup");
    doc.style.display = 'none';
    if (type == 1) {
        var ck = document.getElementById("ckBluRay");
        if (ck.checked) {
            var exdate=new Date();
            exdate.setDate(exdate.getDate()+expiredays);
            document.cookie="blurayaccept=" +escape("accepted")+
            ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
        }
        addToWishListDVDBlock(itemId, sb);
    }
    var iBoxBackD = document.getElementById("iBoxBack");
    iBoxBackD.style.display = 'none';
}

function getScreenW() {
  var windW = 0;
  if( window.innerWidth ) {
      //Netscape compliant
    windW = window.innerWidth;
  } else if( document.documentElement && document.documentElement.clientWidth ) {
    //IE6 standards compliant mode
    windW = document.documentElement.clientWidth;
  } else if( document.body && document.body.clientWidth ) {
    //DOM compliant
    windW = document.body.clientWidth;
  }
  return windW;
}

function getScreenH() {
  var windH = 0;
  if( window.innerHeight ) {
      //Netscape compliant
    windH = window.innerHeight;
  } else if( document.documentElement && document.documentElement.clientHeight ) {
    //IE6 standards compliant mode
    windH = document.documentElement.clientHeight;
  } else if( document.body && document.body.clientHeight ) {
    //DOM compliant
    windH = document.body.clientHeight;
  }
  return windH;
}

function getScrollY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  }
  return scrOfY;
}

function showBluRayPopup(itemId, sb) {
    if (isInItemsWishedDVDBlock(itemId)) {
        return;
    }
    if (document.cookie.indexOf("blurayaccept=") < 0) {
        initIBox('iBoxBack');
        var doc = document.getElementById("bluray_popup");
        var WindowH = getScreenH() + getScrollY();
        var WindowW = getScreenW();
        doc.style.top = getScrollY() + 100;
        doc.style.left = (WindowW - 445)/2;
        doc.style.display = 'block';
        doc.style.visibility = 'hidden';
        doc.style.visibility = 'visible';
        document.getElementById('blurayDoIt').onclick = function (){ hideBluRaypopUp(1, 365, itemId, sb); };
    } else {
        addToWishListDVDBlock(itemId, sb);
    }
}

function showBluRayPopup2() {
    initIBox('iBoxBack2');
    var doc = document.getElementById("bluray_popup2");
    var WindowH = getScreenH() + getScrollY();
    var WindowW = getScreenW();
    doc.style.top = WindowH/2  - 100;
    doc.style.left = (WindowW - 445)/2 - 5;
    doc.style.display = '';
}

function hideBluRaypopUp2() {
    var doc = document.getElementById("bluray_popup2");
    doc.style.display = 'none';
    var iBoxBackD = document.getElementById("iBoxBack2");
    iBoxBackD.style.display = 'none';
}

// making the popup
var iboxback;
function maximize(obj){
    obj.style.width = window.document.width || window.document.body.clientWidth + 'px';
    obj.style.height = window.document.height || window.document.body.scrollHeight + 'px';
}
function initIBox(iBoxBackName){
    iboxback = document.getElementById(iBoxBackName);
    if(!iboxback)return;
    maximize(iboxback);
    iboxback.style.display = 'block';
}
//END Bluray functions
/*ZOOM*/
/*
    Get a css property for a DOM object
    prop1 - the JS like naming (backgroundImage)
    prop2 - the CSS like naming (background-image)
*/
function getStyleProp(obj, prop1, prop2) {
	if (obj.currentStyle)
		return obj.currentStyle[prop1];
	if (window.getComputedStyle)
		return document.defaultView.getComputedStyle(obj,null).getPropertyValue(prop2);
	return obj.style[prop1];
}
function fadeIn(/*String*/ objId) {
    var rate = 0.2;
    var current = 1;
    var obj = document.getElementById(objId);
    if (!obj) return;
    if (obj.filters && obj.filters.alpha) {
        obj.filters.alpha.opacity += (rate*100);
        current = obj.filters.alpha.opacity/100;
    } else
    if (current = getStyleProp(obj, 'opacity', 'opacity')) {
        obj.style.opacity = Math.min(parseFloat(current) + rate, 1.0);
        current = getStyleProp(obj, 'opacity', 'opacity');
    } else
    if (current = getStyleProp(obj, 'MozOpacity', '-moz-opacity')) {
        obj.style.MozOpacity = Math.min(parseFloat(current) + rate, 1.0);
        current = getStyleProp(obj, 'MozOpacity', '-moz-opacity');
    }
    if (current < 1.0) {
        setTimeout('fadeIn("' + objId + '")', 100);
    }
}
function fadeOut(/*String*/ objId) {
    var rate = 0.2;
    var current = 1;
    var obj = document.getElementById(objId);
    if (!obj) return;
    if (obj.filters && obj.filters.alpha) {
        obj.filters.alpha.opacity -= (rate*100);
        current = obj.filters.alpha.opacity/100;
    } else
    if (current = getStyleProp(obj, 'opacity', 'opacity')) {
        obj.style.opacity = Math.min(parseFloat(current) - rate, 1.0);
        current = getStyleProp(obj, 'opacity', 'opacity');
    } else
    if (current = getStyleProp(obj, 'MozOpacity', '-moz-opacity')) {
        obj.style.MozOpacity = Math.min(parseFloat(current) - rate, 1.0);
        current = getStyleProp(obj, 'MozOpacity', '-moz-opacity');
    }
    if (current > 0.0) {
        setTimeout('fadeOut("' + objId + '")', 100);
    } else {
        obj.style.display = 'none';
    }
}
var lastZoomedTitId = null;
function showZoom(/*DOM Object*/ objRel, /*int*/ titId) {
	if (lastZoomedTitId) {
		hideZoom(lastZoomedTitId);
	}
    var objZoom = document.getElementById("zoom_"+titId);
    if (!objZoom) return;
    lastZoomedTitId = titId;
    var relPos = PositionUtils.getObjectPosition(objRel);
    objZoom.style.top = (relPos.y - 40) + 'px';
    objZoom.style.left = (relPos.x - 40) + 'px';
    objZoom.style.display = 'block';
    //fadeIn(objZoom.id);
}
function hideZoom(titId) {
    document.getElementById("zoom_"+titId).style.display='none';
    //fadeOut("zoom_"+titId);
}