
var myimages = new Array();
function preloadimages() {
    for (i = 0; i < preloadimages.arguments.length; i++) {
        //alert(preloadimages.arguments[i]);
        myimages[i] = new Image();
        myimages[i].src = preloadimages.arguments[i];
    }
}


function preloadMenuImg() {
preloadimages('../img/menu/actualites_roll.gif','../img/menu/info_generale_roll.gif','../img/menu/innovation_qualite_roll.gif','../img/menu/orange_arrow.gif','../img/img_menu/points_ventes_roll.gif','../img/menu/produits_roll.gif','../img/menu/qui_sommes_nous_roll.gif','../img/menu/references_roll.gif','../img/menu/service_spit_paslode_roll.gif','../img/menu/services_roll.gif','../img/menu/black_arrow.gif');
}

function swapImage(imgName, imgSrc) {
	document.images[imgName].src = imgSrc;
}


function insertStylesheet() {
    if (isNS4) {
		var css_filename = "stylesheet_ns4.css";
	}
	else {
		var css_filename = "stylesheet.css";
	}
	document.writeln("<link rel=\"stylesheet\" href=\"../css/" + css_filename + "\" type=\"text/css\">");
}

pop = null;

function displayCenteredPopup(url, winName, winWidth, winHeight, features) {
	var winTop = (screen.height - winHeight) / 2;
	var winLeft = (screen.width - winWidth) / 2;
	
	window.open(url, winName, features + ',width=' + winWidth + ',height=' + winHeight + ',top=' + winTop + ', left=' + winLeft);
}


function centered_popup(url, name, width, height, options)
{
	
	var top = (screen.height - height) / 2;
	var left = (screen.width - width) / 2;
	window.open(url, name, options + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left + ',screenX=' + left + ',screenY=' + top);
}


function popupPrint(printPage)
{
	var url = '../popup/popup_print.php?print=1&print_page=' + printPage;
	var name = 'print';
	var width = 580;
	var height = 400;
	var options = 'toolbar=1,resizable=1,scrollbars=1,menubar=1';
	
	centered_popup(url, name, width, height, options);
}


function popupin(product_id,specificity_id,specificity_name,lang)
{
	if (pop && pop.open && (! pop.closed)) {
		pop.close();
	}

	var wndName = specificity_name;
	
	if (isNS4) {
		var wndX = 0;
		var wndY = 0;
		var wndWidth = 150;
		var wndHeight = 100;
	}
	else if (isNS) {
		var wndX = 0;
		var wndY = 0;
		var wndWidth = 750;
		var wndHeight = 500;
	} else {
		var wndX = screen.width + 500;
		var wndY = 0;
		var wndWidth = 150;
		var wndHeight = 100;
	}
	
	var options = 'height=' + wndHeight + ',innerheight=' + wndHeight + ',width=' + wndWidth +
	',innerWidth=' + wndWidth + ',left=' + wndX + ',top=' + wndY + ',resizable=1,scrollbars=1';

    if (lang=="fr") rep = "../produits/";
	else rep = "../producten/";
	var url = rep + 'popup.php?langue=' + lang + '&prod=' + product_id + '&spec=' + specificity_id + '&title=' + escape(specificity_name);
//	pop = window.open(url, wndName, options);

    pop = window.open(url,'',options);
}


function popup_img(mdp_img_url, mdp_img_width, mdp_img_height, wnd_title, lang) {
	if (pop && pop.open && (! pop.closed))
	{
		pop.close();
	}
	
	widthImg = mdp_img_width;
	heightImg = mdp_img_height;
	
	var str = "height=" + heightImg + ",innerHeight=" + heightImg;
	str += ",width=" + widthImg + ",innerWidth=" + widthImg;
 	
	if (window.screen) 
	{
    	var ah = screen.availHeight - 30;
    	var aw = screen.availWidth - 10;
	}
	
	var xc = (aw - widthImg) / 2;
	var yc = (ah - heightImg) / 2;

    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;

    if (lang=="fr") rep = "../produits/";
	else rep = "../producten/";
	var url = rep + 'popup_img.php?page=' + mdp_img_url + '&titre=' + escape(wnd_title) + '&w=' + widthImg + '&h=' + heightImg;
	
    pop = window.open(url,'',str);
}


function popupCorporate(format,imgSrc) {
	if (format == 0) {
		widthF = 360;
		heightF = 270;
	}
	else {
		if (format == 1) {
			widthF = 270;
			heightF  = 360;
		}
		else {
			widthF  = 270;
			heightF  = 270;
		} 
	}
	var str = "height=" + heightF + ",innerHeight=" + heightF;
  	str += ",width=" + widthF + ",innerWidth=" + widthF;
	 if (window.screen) {
    	var ah = screen.availHeight - 30;
	    var aw = screen.availWidth - 10;

    	var xc = (aw - widthF) / 2;
    	var yc = (ah - heightF) / 2;

    	str += ",left=" + xc + ",screenX=" + xc;
    	str += ",top=" + yc + ",screenY=" + yc;
  	}
	url = '../zoom.php?image='+imgSrc;
	pop = window.open(url, '_blank', str);

}

