function flip(rid)
{
    current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
    document.getElementById(rid).style.display = current;
}

function popupBlank(url,PopName, width_, height_, scroll_) { 
	var proprietes;
	if (pop) {
	pop.window.close();
	}
	if(!scroll_) scroll_ = 'no';
	var top= screen.height-(screen.height/1.3);
	var left=screen.width-(screen.width/1.3);
	
	if(width_=='' || height_=='') {
		width_=screen.width;
		height_=screen.height;
		proprietes = "toolbar=yes, location=yes, directories=yes, scrollbars=yes, resizable=yes, status=yes, menubar=yes, width="+width_+", height="+height_+",  left="+left+",top="+top+"";
	} else {
		proprietes = "toolbar=no, location=no, directories=no, scrollbars="+scroll_+", resizable=no, status=no, menubar=no, width="+width_+", height="+height_+",  left="+left+",top="+top+""
	}
	var pop=window.open(url,PopName,proprietes);
	pop.focus();
}


function displayImage(url,PopName, width_, height_) { 
	var top= screen.height-(screen.height/1.3);
	var left=screen.width-(screen.width/1.3);
	pop = window.open(url, PopName, "toolbar=no, location=no, directories=no, scrollbars=no, resizable=no, status=no, menubar=no, width="+width_+", height="+height_+",  left="+left+",top="+top+"");
	//pop.document.open();
	pop.document.write("<html>");
	pop.document.write("<head><title>Hardouin - Vannerie de Touraine "+PopName+"</title></head>");
	pop.document.write("<body style='margin:0;padding:0;background-repeat:no-repeat;' background='"+url+"' onblur='top.close()'>" );
	pop.document.write("</body></html>");
	pop.document.close();

}


function InitNewsletterAbo() {
	document.getElementById('action1').checked=true;
	document.getElementById('action2').checked=false;
}

function ShowFilesLayer(id) {
    	if(id=='layervisuel2') {
		document.getElementById('layervisuel1').style.display="block";
		document.getElementById('layervisuel2').style.display="block";
	} 
    	if(id=='layervisuel1') {
		document.getElementById('layervisuel1').style.display="block";
		document.getElementById('layervisuel2').style.display="none";
	} 
  	if(id=='none') {
		document.getElementById('layervisuel1').style.display="none";
		document.getElementById('layervisuel2').style.display="none";
	} 

  	return true;
}

function completeNewsspace() {
	var heightid;
	var diff;
	var layer;
	heightid=document.getElementById("textcontain").offsetHeight;
	if(heightid<350) {
		diff=350-heightid;
		layer="<div style=\"height:"+diff+";visibility:hidden\">notdisplayed</div>";
		document.write(layer);
	}
}

function ChangeLocation(box) {
	val = box.options[box.selectedIndex].value;
	window.open (val,'_self');
	return true;
}
