inicio=0

function initPage(){
	inicio = 1;
}

function rollover(imgName,st,imgSrc,alt){
	if(inicio!=0){
		if(!imgSrc){imgSrc = imgName}
		if(idioma == ""){
			document.images[imgName].src = "../images/bt_" + imgSrc + "_" + st + ".gif"
		}else{
			document.images[imgName].src = "images/esp/bt_" + imgSrc + "_" + st + ".gif"
		}
		
		if(alt){
			if(st == "ov"){Alt.write('<img src="images/pix_trans.gif" width=9 height=9><br><span class=alt>' + alt + '<br></span>');Box.show();}else{Box.hide();}
		}
	}
}

var fwindow;

function openPicture(foto){
	fwindow = window.open('../blank.htm','fwindow','width=10,height=10')
	wSize = new Image()
	wSize.src = '../images/prods/' + foto + '_b.jpg'
	download(wSize)
}

function download(img){
	tImg = img
	if(tImg.complete){
		fwindow.resizeTo(img.width,img.height)
		fwindow.document.write(generatePic(tImg))
	}
	else{
		setTimeout('download(tImg)',100);
	}
}

function generatePic(img) {
	fotoGran = '<html><head><title>Mitsubishi Electric</title><script>window.focus();<' + '/' +'script></head><body bgcolor=white background="' + img.src + '">'
				+''
				+'</body></html>'
	return fotoGran;
}


function canvia(obj,estat){
	if(inicio!=0){
		if(idioma != ""){
			document.images[obj].src = "images/" + idioma + "/bt_" + obj + "_" + estat + ".gif";
		}else{
			document.images[obj].src = "../images/bt_" + obj + "_" + estat + ".gif";
		}
	}
}

function generateHeader(tip){
	if(idioma != ""){
		carpeta = "images/esp/"
	}else{
		carpeta = "../images/";
	}
	header = '<table border=0 cellpadding=0 cellspacing=0 width=100% bgcolor="#00309F">'
			+ '<tr>'
			if(tip == 0){
				header += '<td><a href="news.asp" onMouseOver="canvia(\'op10\',\'on\');" onMouseOut="canvia(\'op10\',\'off\')"><img src="' + carpeta + 'bt_op10_off.gif" border="0" name="op10"></a></td>'
				+ '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				+ '<td><a href="support.asp" onMouseOver="canvia(\'op11\',\'on\');" onMouseOut="canvia(\'op11\',\'off\')"><img src="' + carpeta + 'bt_op11_off.gif" border="0" name="op11"></a></td>'
				+ '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				+ '<td><a href="links.asp" onMouseOver="canvia(\'op12\',\'on\');" onMouseOut="canvia(\'op12\',\'off\')"><img src="' + carpeta + 'bt_op12_off.gif" border="0" name="op12"></a></td>'
				+ '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				+ '<td><a href="distribuidores.asp" onMouseOver="canvia(\'op13\',\'on\');" onMouseOut="canvia(\'op13\',\'off\')"><img src="' + carpeta + 'bt_op13_off.gif" border="0" name="op13"></a></td>'
				+ '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				+ '<td><a href="serviciotecnico.asp" onMouseOver="canvia(\'op14\',\'on\');" onMouseOut="canvia(\'op14\',\'off\')"><img src="' + carpeta + 'bt_op14_off.gif" border="0" name="op14"></a></td>'
			}else{
				if(tip == 1){
					header += '<td><img src="' + carpeta + 'bt_op10_on.gif" border="0" name="op10"></td>'
				}else{
					header += '<td><a href="news.asp" onMouseOver="canvia(\'op10\',\'on\');" onMouseOut="canvia(\'op10\',\'off\')"><img src="' + carpeta + 'bt_op10_off.gif" border="0" name="op10"></a></td>'
				}
				header += '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				if(tip == 2){
					header += '<td><img src="' + carpeta + 'bt_op11_on.gif" border="0" name="op11"></td>'
				}else{
					header += '<td><a href="support.asp" onMouseOver="canvia(\'op11\',\'on\');" onMouseOut="canvia(\'op11\',\'off\')"><img src="' + carpeta + 'bt_op11_off.gif" border="0" name="op11"></a></td>'
				}
				header += '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				if(tip == 3){
					header += '<td><img src="' + carpeta + 'bt_op12_on.gif" border="0" name="op12"></td>'
				}else{
					header += '<td><a href="links.asp" onMouseOver="canvia(\'op12\',\'on\');" onMouseOut="canvia(\'op12\',\'off\')"><img src="' + carpeta + 'bt_op12_off.gif" border="0" name="op12"></a></td>'
				}
				header += '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				if(tip == 4){
					header += '<td><img src="' + carpeta + 'bt_op13_on.gif" border="0" name="op13"></td>'
				}else{
					header += '<td><a href="distribuidores.asp" onMouseOver="canvia(\'op13\',\'on\');" onMouseOut="canvia(\'op13\',\'off\')"><img src="' + carpeta + 'bt_op13_off.gif" border="0" name="op13"></a></td>'
				}
				header += '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				if(tip == 5){
					header += '<td><img src="' + carpeta + 'bt_op14_on.gif" border="0" name="op14"></td>'
				}else{
					header += '<td><a href="serviciotecnico.asp" onMouseOver="canvia(\'op14\',\'on\');" onMouseOut="canvia(\'op14\',\'off\')"><img src="' + carpeta + 'bt_op14_off.gif" border="0" name="op14"></a></td>'
				}
			}
				header += '<td bgcolor="white"><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
				+ '<td width=100%><img src="' + carpeta + 'pix_trans.gif" border=0 width=1 height=1></td>'
			+ '</tr>'
			+ '</table>'
	return header;
}
