﻿

img_dir = "img/";

if (document.images) js=1; else js=0;

function stopError() { return true; }
window.onerror = stopError;

function pic(img_name,ext,width,height) {
        if (js) {
                this.off = new Image(width,height);
                this.off.src = img_dir + img_name + "_off." + ext;
                this.on = new Image(width,height);
                this.on.src = img_dir + img_name + "_on." + ext;
        }
}

function new_pic(img_name,ext,width,height) {
        if (js) { pic[img_name] = new pic(img_name,ext,width,height); }
}

if (js) {

// menu top
new_pic("cars",   "gif", 10, 10);
new_pic("industrial",   "gif", 10, 10);
new_pic("market",   "gif", 10, 10);
new_pic("motorcycles",   "gif", 10, 10);
new_pic("performance",   "gif", 10, 10);
new_pic("racing",   "gif", 10, 10);

// menu sinistra
new_pic("bullet_menu_sx",  "gif", 6, 6);
/*
new_pic("industrial",   "gif", 10, 10);
new_pic("market",   "gif", 10, 10);
new_pic("motorcycles",   "gif", 10, 10);
new_pic("performance",   "gif", 10, 10);
new_pic("racing",   "gif", 10, 10);
*/
}

function hilite(pic_name) {
        if (js) { document[pic_name].src = pic[pic_name].on.src; }
}

function unlite(pic_name) {
        if (js) { document[pic_name].src = pic[pic_name].off.src; }
}

function popup(str) {
window.open(str,'nome','scrollbars=yes,resizable=no,width=467,height=350,status=no,location=no,toolbar=no');
}

function popup2(str) {

    var width = 600;
    var height = 300;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ",scrollbars=yes,resizable=no,status=no,location=no,toolbar=no";
    myWindow = window.open(str, "nome", windowFeatures);
}

function popupCatalogue(str) {
window.open(str,'nome','scrollbars=yes,resizable=no,width=518,height=450,status=no,location=no,toolbar=no');
}

function popcircuiti(str) {
	window.open(str,'nome','scrollbars=no,resizable=no,width=800,height=675,status=no,location=no,toolbar=no');
}

function popvideo(str) {

    var width = 450;
    var height = 380;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ",scrollbars=no,resizable=no,status=no,location=no,toolbar=no";
    myWindow = window.open(str, "nome", windowFeatures);
}

function popticker(str) {

    var width = 275;
    var height = 540;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ",scrollbars=no,resizable=no,status=no,location=no,toolbar=no";
    myWindow = window.open(str, "nome", windowFeatures);
}

function popslideshow(str) {

    var width = 720;
    var height = 760;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ",scrollbars=yes,resizable=no,status=no,location=no,toolbar=no";
    myWindow = window.open(str, "nome", windowFeatures);
}

function popf1(str) {

    var width = 450;
    var height = 580;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ",scrollbars=yes,resizable=no,status=no,location=no,toolbar=no";
    myWindow = window.open(str, "nome", windowFeatures);
}

function popcircuiti05(str) {
	window.open(str,'nome','scrollbars=no,resizable=no,width=760,height=500,status=no,location=no,toolbar=no');
}

function popBNApresentation(str) {
	window.open(str,'nome','scrollbars=no,resizable=no,width=760,height=440,status=no,location=no,toolbar=no');
}

function popBNA(str) {
	window.open(str,'nome','scrollbars=no,resizable=no,width=950,height=550,status=no,location=no,toolbar=no');
}

function showlist(country) {
	window.open('/distributors/list.aspx?country='+country,'distributors','scrollbars=yes,resizable=no,width=518,height=450,status=no,location=no,toolbar=no');
}

function showlist_racing(country) {
	window.open('/distributors/listRacing.aspx?country='+country,'distributorsRacing','scrollbars=yes,resizable=no,width=518,height=450,status=no,location=no,toolbar=no');
}

function popupsize(str,w,h) {
	window.open(str,'nome','scrollbars=yes,resizable=no,width='+w+',height='+h+',status=no,location=no,toolbar=no');
}

function popupimage(strPicURL) {
	window.open('/brembo/templates/imagepopup.htm?'+strPicURL,'nome','scrollbars=yes,resizable=yes,width=200,height=200,status=no,location=no,toolbar=no');
}
function cambiaEuro()
{
	//cambia il carattere errato di euro 
	//alert('pippo');
	//MenuSezioni1_lblMarqueeScript.innerHTML = MenuSezioni1_lblMarqueeScript.innerHTML.replace(/Last Price * ,"€") ;
	MenuSezioni1_lblMarqueeScript.innerHTML = MenuSezioni1_lblMarqueeScript.innerHTML.replace(/B> . /g,"/B> &euro; ");
}
