﻿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);




var popup=0;
function newWindow(newURL,left,top,width,height)
{
	popup = window.open(newURL,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}



function viewFotos(img, name, wid, hi){

 features = 
    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
    "scrollbars=no,resizable=no,width=" + wid + ",height=" + hi;
 dlg = window.open ("","Details",features);
 dlg.document.write("<html><head><title>" + name + " Zoom</title></head>");
 dlg.document.write("<body bgcolor=white><center>");
 dlg.document.write("<table width=100% height=100%>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<b><font size=4 face=Arial>" + name + "</font></b><br><br>");
 dlg.document.write("<img src=" + img + ">");
 dlg.document.write("</td></tr>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<a href=# onClick=window.close();>");
 dlg.document.write("<font size=1 face=Arial>Click to close</font></a>");
 dlg.document.write("</td></tr>");
 dlg.document.write("</table></body></html>");
}


function CaricaFoto(img, name, wid, hi){
  foto1= new Image();
  foto1.src=(img);
  viewFotos(img, name, wid, hi);
}


/*
 * GAddress
 * This hack was written by
 *   John Resig <jeresig@gmail.com>
 * More info can be found here:
 *   http://ejohn.org/projects/gaddress/
 */

function GAddress( a, c ) {
  var xmlhttp = false;
  try {
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) {
    xmlhttp = false;
   }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }

  var l = new Array();
  xmlhttp.open("GET", "http://www.vanguardtrailer.com/cgi-bin/gaddress.cgi?a=" + escape(a), true);
  xmlhttp.onreadystatechange=function() {
   if (xmlhttp.readyState==4) {
    l = xmlhttp.responseText.split(',');
    if ( l[0] == '' )
      c( null, a );
    else
      c( new GPoint( l[0] - 0, l[1] - 0 ), a );
   }
  }
  xmlhttp.send(null)
}
