var preUrl = "";
var mediaUrl = "";

try {
  if(top.location.href!=location.href) {
    top.location.href = location.href;
  }
} catch(e) {
  top.location = location.href;
}


function setPreUrl(url) {
    preUrl=url;
}

function setMediaUrl(url) {
    mediaUrl=url;
}


function workInProgress() {
    if (readCookie('workInProgress') != '1') {
        createCookie('workInProgress',1,14400);
        makeWindow();
    }
}


function createCookie(name,value,minutes) {
    var minutes = minutes;
    if (minutes) {
        var date = new Date();
        date.setTime(date.getTime()+(minutes*60*1000));
        var expires = "; expires="+date.toGMTString();
    } else {
        var expires = "";
    }
    document.cookie = name+"="+value+expires+"; path=/";
}


function readCookie(the_name) {
    var nameEQ = the_name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}


function makeWindow() {
    bit = '';
    bit+= '<div id="wipDiv" style="text-align:center;height:600px;left:50%;margin-left:-475px;position:absolute;top:0px;width:950px;background:url(http://media.ysl-parfums.com/layout.white/_img/workinprogress.jpg) no-repeat center top transparent;">&nbsp;';
    //bit+='<h1 style="color:white;background:black">Work in progress<\/h1>'
    //bit+='<h2 style="color:white;background:black">www.ysl-parfums.com is currently being updated<\/h2>'
    //bit+='<h2 style="color:white;background:black">'
    //bit+='The site might look ugly or broken during a short period, proceed anyway ?<\/h2>'
    bit+='<center><a href="'+top.location+'"><img style="position:relative;top:520px;" border=0 src=http://media.ysl-parfums.com/layout.white/_img/proceed.jpg \/><\/a><\/center>';
    bit+='<\/div>'
    document.write(bit);
    //document.getElementById("main").style.display = 'none';
}



