jQuery.noConflict();

function fn_explode(obj_item){
	//var check = jQuery();
	if(jQuery("#explode_" + obj_item).hasClass("explode-off")){
		jQuery("#explode_" + obj_item).removeClass("explode-off");
		jQuery("#explode_" + obj_item).addClass("explode-on");

	}else{
		jQuery("#explode_" + obj_item).removeClass("explode-on");
		jQuery("#explode_" + obj_item).addClass("explode-off");
	}
}

jQuery(function() {
	jQuery('.produto-thumbnail a').lightBox();
});

function windowOpener(windowHeight, windowWidth, windowName, windowUri){
    var centerWidth = (window.screen.width - windowWidth) / 2;
    var centerHeight = (window.screen.height - windowHeight) / 2;

    newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth + 
        ',height=' + windowHeight + 
        ',left=' + centerWidth + 
        ',top=' + centerHeight);

    newWindow.focus();
    return newWindow.name;
}

UTF8 = {
	encode: function(s){
		for(var c, i = -1, l = (s = s.split("")).length, o = String.fromCharCode; ++i < l;
			s[i] = (c = s[i].charCodeAt(0)) >= 127 ? o(0xc0 | (c >>> 6)) + o(0x80 | (c & 0x3f)) : s[i]
		);
		return s.join("");
	},
	decode: function(s){
		for(var a, b, i = -1, l = (s = s.split("")).length, o = String.fromCharCode, c = "charCodeAt"; ++i < l;
			((a = s[i][c](0)) & 0x80) &&
			(s[i] = (a & 0xfc) == 0xc0 && ((b = s[i + 1][c](0)) & 0xc0) == 0x80 ?
			o(((a & 0x03) << 6) + (b & 0x3f)) : o(128), s[++i] = "")
		);
		return s.join("");
	}
};

function addFav(){
    var url = "http://www.bosch.com.br/es/ferramentas-profissionais/";
    var title = "Bosch - Herramientas Eléctricas de profesionales para profesionales ";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}

/* FUNCAO PARA DEIXAR PNG TRANSPARENT*/
function correctPNG()
   {
   for(var i=0; i<document.images.length; i++)
      {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
         img.outerHTML = strNewHTML
         i = i-1
         }
      }
   }
window.attachEvent("onload", correctPNG);
/* FIM FUNCAO PARA DEIXAR PNG TRANSPARENT*/

// FUNÇÃO PARA ABRIR HOTSITE //
function openhot(obj_hotsite, obj_prefixo){
	if(obj_hotsite == 'ions_de_litio'){
		window.open(obj_prefixo + '/es/hotsite/ions_de_litio/espanhol/li-ionen-2008_spanien/website_folder/es/es/start');
	}else if(obj_hotsite == 'dle_50'){
		window.open(obj_prefixo + '/es/hotsite/dle_50/dle50/pt/pt/start/index.htm');
	}else if(obj_hotsite == 'dle_70'){
		window.open(obj_prefixo + '/es/hotsite/dle_70/pt/pt/start/index.htm');
	}else if(obj_hotsite == 'vibration_control'){
		window.open(obj_prefixo + '/es/hotsite/vibration-control/es/es/start/index.htm');
	}
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
