// ==========================================================
// DETECTION NAVIGATEURS
// ==========================================================
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
		&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1));

var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
			(agt.indexOf("; nav") != -1)) );
var is_nav6 = (is_nav && (is_major == 5));
var is_nav6up = (is_nav && (is_major >= 5));
var is_gecko = (agt.indexOf('gecko') != -1);


var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up  = (is_ie && (is_major >= 4));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
var mac  = (agt.indexOf('mac') != -1);



function loadbg()
{
	document.body.className = 'bg';
}


//Debut script buffer
function loadBuffer(urlFile,bufferId){
 document.getElementById(bufferId).src = urlFile;
 //window.frames['buffer'].location = urlFile;//make trouble with NN6 7
}


function displayBuffer(HTMLDocument,DivID){
 document.getElementById(DivID).innerHTML = getBuffer(HTMLDocument);
}
function getBuffer(HTMLDocument){
 return  HTMLDocument.innerHTML;
}

function loadContentGenericMembership(p_content)
{
	loadBuffer('/krups/Membership/generic_iframe.aspx'+p_content,'buffer_generic');
}

// FIXED
function loadContentDossier(p_currentGuid)
{
loadBuffer('Iframe_Membership.aspx?'+p_currentGuid,'buffer_dossier');
}

function loadContentDossierWorldOfCoffee(p_currentGuid)
{
loadBuffer('Iframe_WorldOfCoffee.aspx?'+p_currentGuid,'buffer_dossier');
}

// FIXED
function loadContentQuickFinder(p_currentChannelGuid)
{
	loadBuffer('quickfinder_iframe.aspx?currChan='+p_currentChannelGuid,'buffer');
}

// FIXED
function loadContentGeneric(p_content)
{
	loadBuffer('/krups/Tools/generic_iframe.aspx'+p_content,'buffer_generic');
}
//Fin script buffer

//Debut script buffer_products
function loadBuffer(urlFile,bufferId){
 document.getElementById(bufferId).src = urlFile;
 //window.frames['buffer_products'].location = urlFile;//make trouble with NN6 7
}
 
function displayBuffer(HTMLDocument,DivID){
 document.getElementById(DivID).innerHTML = getBuffer(HTMLDocument);
}
function getBuffer(HTMLDocument){
 return  HTMLDocument.innerHTML;
}

// FIXED
function loadContentProducts(p_content)
{
loadBuffer('product_iframe.aspx'+p_content,'buffer_products');
}

function loadContentContactProductSheet(p_data)
{
	loadBuffer('i_frameContactList_ProductSheet.aspx'+p_data,'buffer_products');
}
//Fin script buffer_products

//Debut script buffer_shop
function loadBuffer(urlFile,bufferId){
 document.getElementById(bufferId).src = urlFile;
 //window.frames['buffer_shop'].location = urlFile;//make trouble with NN6 7
}
 
function displayBuffer(HTMLDocument,DivID){
 document.getElementById(DivID).innerHTML = getBuffer(HTMLDocument);
}
function getBuffer(HTMLDocument){
 return  HTMLDocument.innerHTML;
}

// FIXED
function loadContentRetailers(p_content)
{
loadBuffer('retailers_iframe.aspx'+p_content,'buffer_shop');
}

function loadContentRetailersPl(p_content)
{
loadBuffer('retailers_iframe_pl.aspx'+p_content,'buffer_shop');
}
//HPR 16/06/2008
function loadContentRetailersZipCode(p_content)
{
loadBuffer('retailers_iframe_ZipCode.aspx'+p_content,'buffer_shop');
}


function loadContentRetailersEasternEurope(p_content)
{
loadBuffer('retailers_iframe_eastern_europe.aspx'+p_content,'buffer_shop_eastern');
}
//Fin script buffer_shop

//Debut script buffer_download
function loadBuffer(urlFile,bufferId){
 document.getElementById(bufferId).src = urlFile;
 //window.frames['buffer_download'].location = urlFile;//make trouble with NN6 7
}
 
function displayBuffer(HTMLDocument,DivID){
 document.getElementById(DivID).innerHTML = getBuffer(HTMLDocument);
}
function getBuffer(HTMLDocument){
 return  HTMLDocument.innerHTML;
}

// FIXED
function loadContentProductSupport(p_currentGuid)
{
loadBuffer('result_iframe.aspx'+p_currentGuid,'buffer_download');
}
//Fin script buffer_download

// FIXED
function loadContentServicesCenters(p_data)
{
	loadBuffer('/krups/Consumer_service/Service_Centers/centers_iframe.aspx'+p_data,'buffer_shop');
}

function loadContentServicesCentersPl(p_data)
{
	loadBuffer('/krups/Consumer_service/Service_Centers/centers_iframe_pl.aspx'+p_data,'buffer_shop');
}

// FIXED
function loadContentContactList(p_data)
{
	loadBuffer('i_frameContactList.aspx'+p_data,'buffer_contactList');
}

// FIXED
function loadContentHistory(p_data)
{
	loadBuffer('AllDate/i_frameHistory.aspx'+p_data,'buffer_histoire');
}

// FIXED
function loadContentMember2(p_data)
{
loadBuffer('EventIFrame.aspx'+p_data,'buffer_member2');
}

// FIXED
function loadContentGallery(p_data)
{
	loadBuffer('i_frameGallery.aspx'+p_data,'buffer_galerie');
}

// FIXED
function loadContentAccessories(p_data)
{
	loadBuffer('accessories_iframe.aspx'+p_data,'buffer_download');
}
//Fin script buffer

//Script Evite bug affichage sur moteur Gecko
function hidescroll(){
	if (is_gecko){
		document.getElementById('scrollbox').style.overflow = 'hidden';
	}
	
}

function showscroll(){
	if (is_gecko){
		document.getElementById('scrollbox').style.overflow = 'auto';
	}
	
}
//Fin script bug affichage sur moteur Gecko

// FIX ME
function loadContentDemo(p_reference, p_id)
{
	loadBuffer('view_demo_details_iframe.aspx?Reference='+ p_reference + "&Id=" + p_id, 'buffer_details');
}

//Script used in new contactus page to hide show Faulty Espresso section.
function setDisplay(objectID,state)
{
    	var object = document.getElementById(objectID);
    	object.style.display = state;
}
