﻿function Increment(obj){
    $get(obj).value ++ ;}
function Decrement(obj){
    if ($get(obj).value > 0) {
        $get(obj).value -- ;}}
function aprivar(str) {
    searchWin = window.open(str,'ordine','scrollbars=yes,resizable=yes,width=700,height=420,status=yes,location=no,toolbar=no');
    searchWin.focus();}    
function Stampa() { 
    self.print()}
function Chiudi() { 
    self.close();}

var OP = (navigator.userAgent.indexOf('Opera') != -1) ? true : false;
var IE = (navigator.userAgent.indexOf('MSIE') != -1 && !OP) ? true : false;
var GK = (navigator.userAgent.indexOf('Gecko') != -1) ? true : false;
var NN4 = document.layers;
var DOM = document.getElementById;
function DizTOOLTIP() {
this.width = 350; 
this.bgColor = "#ffffff";
this.textColor = "#7d7e7f";
this.borderColor = "#00496E";
this.opacity = "100";this.cursorDistance = 7;this.text = '';
this.obj = 0;this.sobj = 0;this.active = false;
this.create = function() {
if(!this.sobj) this.init();
var t = '<font face="Verdana" size="1"><table border=0 cellspacing=0 cellpadding=0 width=' + this.width + ' bgColor=' + this.textColor + ' style=\'\'><tr style=\'\'>' +
'<td style=\'background-color:' + this.borderColor + ';\'><font size="1" color=' + this.bgColor + '>BusinessLunch.it</font></td></tr></table>' +
'<table border=0 cellspacing=0 cellpadding=4 width=' + this.width + ' bgcolor=' + this.bgColor + ' style=\'\'><tr style=\'\'>' +
'<td style=\'background-color:' + this.bgColor + ';\'><font size="1" color=' + this.textColor + '>' + this.text + '</font></td></tr></table></font>';
if(NN4) {
t = '<table border=0 cellspacing=0 cellpadding=1><tr><td style=\'background-color:' + this.textColor + ';\' bgcolor=' + this.borderColor + '>' + t + '</td></tr></table>';
this.sobj.document.write(t);
this.sobj.document.close();}
else {
this.sobj.border = '1px solid ' + this.borderColor;
this.setOpacity();
if(document.getElementById) document.getElementById('DizToolTip').innerHTML = t;
else document.all.DizToolTip.innerHTML = t;}
if(DOM) this.height = this.obj.offsetHeight;
else if(IE) this.height = this.sobj.pixelHeight;
else if(NN4) this.height = this.obj.clip.bottom;
this.show();}
this.init = function() {
if(DOM) {this.obj = document.getElementById('DizToolTip');
this.sobj = this.obj.style;}
else if(IE) {this.obj = document.all.DizToolTip;
this.sobj = this.obj.style;}
else if(NN4) {
this.obj = document.DizToolTip;
this.sobj = this.obj;}}
this.show = function() {
var ext = (document.layers ? '' : 'px');
var left = mouseX;
var top = mouseY;
if(left + this.width + this.cursorDistance > winX) left -= this.width + this.cursorDistance;
else left += this.cursorDistance;
if(top + this.height + this.cursorDistance > winY) top -= this.height;
else top += this.cursorDistance;
this.sobj.left = left + ext;
this.sobj.top = top + ext;
if(!this.active) {
this.sobj.visibility = 'visible';
this.active = true;}}
this.hide = function() {if(this.sobj) this.sobj.visibility = 'hidden';
this.active = false;}
this.setOpacity = function() {
this.sobj.filter = 'alpha(opacity=' + this.opacity + ')';
this.sobj.mozOpacity = '.1';
if(this.obj.filters) this.obj.filters.alpha.opacity = this.opacity;
if(!document.all && this.sobj.setProperty) this.sobj.setProperty('-moz-opacity', this.opacity / 100, '');}}
var Diztooltip = mouseX = mouseY = winX = winY = 0;
if(document.layers) {document.write('<layer id="DizToolTip"></layer>');
document.captureEvents(Event.MOUSEMOVE);}
else document.write('<div id="DizToolTip" style="position:absolute; z-index:99;padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;"></div>');
document.onmousemove = getMouseXY;
function getMouseXY(e) {if(IE) {
mouseX = event.clientX + document.body.scrollLeft;
if (document.documentElement && document.documentElement.scrollTop)
{mouseY = event.clientY + document.documentElement.scrollTop;}
else {mouseY  = event.clientY +document.body.scrollTop;}}
else {mouseX = e.pageX;mouseY = e.pageY;}
if(mouseX < 0) mouseX = 0;if(mouseY < 0) mouseY = 0;
else if(GK || NN4) {winX = window.innerWidth - 25;winY = window.innerHeight;}
else if(DOM) {winX = document.body.offsetWidth - 25;winY = document.body.offsetHeight;}
else {winX = screen.width - 25;winY = screen.height;}
if(Diztooltip && Diztooltip.active) Diztooltip.show();}
function DiztoolTip(text, width, opacity) {
if(text!='-1' && text!=''){
Diztooltip = new DizTOOLTIP();
Diztooltip.text = text;
if(width) Diztooltip.width = width;
if(opacity) Diztooltip.opacity = opacity;
Diztooltip.create();}
else if(text=='-1' && (Diztooltip)) Diztooltip.hide();}

