function setCookie( name, value, expires, path, domain, secure )
{
if(!expires) expires=365;
if(!path) path='/';
if(!domain) domain='';
if(!secure) secure='';
var today = new Date();
today.setTime( today.getTime() );
if ( expires )
expires = expires * 1000 * 60 * 60 * 24;
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function getCookie( name ) {
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 )
return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
function deleteCookie( name, path, domain ) {
if(!path) path='/';
if(!domain) domain='';
if ( getCookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function makeActive(framenr) {
if(framenr!='' && framenr!='[ kies hier een configuratie ]')
getScript('/page.php','?pageid=scripts&setframe='+framenr);
}
function deleteFav(favnr) {
if(favnr!='' && favnr!='[ kies hier een configuratie ]') {
deleteCookie('fav-'+favnr);
alert('De configuratie is verwijderd.');
}
}
function showBannertop() {
getContent('/page.php','?pageid=bannertop','div-bannertop',slideBannertop);
document.getElementById('div-bannertop').style.display='block';
document.getElementById('div-menu').style.display='none';
document.getElementById('div-approved').style.display='none';
}
var bannertopimages=10;
var currentimg=1;
var bannertopslider;
function slideBannertop() {
var newimg=currentimg+1;
if(newimg>bannertopimages) newimg=1;
newimgurl='/images/hd'+newimg+'.jpg';
if(document.all) document.getElementById('bannertopimg').filters[0].apply();
document.getElementById('bannertopimg').src=newimgurl;
if(document.all) document.getElementById('bannertopimg').filters[0].play();
if(document.getElementById('div-bannertop').style.display=='block') {
currentimg=newimg;
bannertopslider = setTimeout('slideBannertop()',3000);
} else {
clearTimeout(bannertopslider);
}
}
window.onbeforeunload = askExit;
function askExit(){
var message = "You are leaving the Home Cinema Designer website.";
return message;
}
function pausecomp(millis) {
var date = new Date();
var curDate = null;
do { curDate = new Date(); }
while(curDate-date < millis);
}
function preloadStaus(current,total) {
totalwidth=200;
completedwidth=Math.round(current*totalwidth/total);
if(completedwidth>totalwidth) completedwidth=totalwidth;
percrounded=Math.round(current*100/total);
if(percrounded>100) percrounded=100;
html='
';
html+='
'+percrounded+'%';
document.getElementById('preloadcounter').innerHTML=html;
}