preload=Array("images/prodlistoverbgr.png");
i=Array();

for(x=0;x<preload.length;x++){
	
	i[x] = new Image(1,1);
	i[x].src = preload[x];
	
}

function ini_prodpopup(x){
	
	p=document.getElementById("prodpopup"+x);
	h=document.getElementById("prod"+x);
	
	if(p.style.display=="block"){
		p.style.display="none";
		h.style.position="static";
	}else{
		p.style.display="block";
		h.style.position="relative";
	}
	
}


function load() {
  if (GBrowserIsCompatible()) {
	
			var map = new GMap2(document.getElementById("map"));
			var center = new GLatLng(53.57369962688086, -1.6530051827430725);
			map.setCenter(center, 14);
			map.addControl(new GLargeMapControl());
			//map.addControl(new GMapTypeControl());
	
			var blueIcon = new GIcon(G_DEFAULT_ICON); 
			blueIcon.image = "http://www.google.com/mapfiles/marker_orange.png"; 
			blueIcon.iconSize = new GSize(20, 34);
			blueIcon.iconAnchor = new GPoint(10, 34); 
			blueIcon.shadowSize = new GSize(37, 34); 
			markerOptions = { icon:blueIcon }; 
	
			var marker = new GMarker(center,markerOptions);
			
			GEvent.addListener(marker, "click", function() {
			  marker.openInfoWindowHtml("<div style='width:250px;font-size:10px;color:#000000;'><b>Denby Dale Stoves</b><br/>301-303 Wakefield Rd<br/>Denby Dale<br/>Huddersfield<br/>West Yorkshire<br/>HD8 8RX</div>");
			});
	
			
	 

			map.addOverlay(marker);
			
			marker.openInfoWindowHtml("<div style='width:250px;font-size:10px;color:#000000;'><b>Denby Dale Stoves</b><br/>301-303 Wakefield Rd<br/>Denby Dale<br/>Huddersfield<br/>West Yorkshire<br/>HD8 8RX</div>");
			
			
			// Create our "tiny" marker icon 
			var blueIcon = new GIcon(G_DEFAULT_ICON); 
			blueIcon.image = "http://www.google.com/mapfiles/marker_purple.png"; 
			blueIcon.iconSize = new GSize(20, 34);
			blueIcon.iconAnchor = new GPoint(10, 34); 
			blueIcon.shadowSize = new GSize(37, 34); 
			markerOptions = { icon:blueIcon }; 
			var center2 = new GLatLng(53.5718998779065, -1.657036542892456);
			var marker2 = new GMarker(center2,markerOptions);
			
			GEvent.addListener(marker2, "click", function() {
			  marker2.openInfoWindowHtml("<div style='width:250px;font-size:10px;color:#000000;'><b>Showroom &amp; Workshop</b><br/>Unit 8, Springfield Mill<br/>Norman RoadDenby Dale<br/>Huddersfield<br/>West Yorkshire<br/>HD8 8RX</div>");
			});
			
			map.addOverlay(marker2);
	
	}
}


function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      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
         }
      }
   }    
}

function printflash(swf,w,h,div){
		var so = new SWFObject(swf, "flash-animations", w, h, "8", "#ffffff");
		so.addParam("wmode", "transparent");
		so.write(div);	
}

function prodlistover(x){
	document.getElementById("prod"+x).style.backgroundImage="url(images/prodlistoverbgr.png)";
}
function prodlistout(x){
	document.getElementById("prod"+x).style.backgroundImage="url(images/prodlistbgr.png)";
}

i=Array();
ci=0;

function nextimage(){
	
	ci++;
	if(ci==i.length) ci=0;
	document.getElementById("prodimgsrc").src=i[ci].src;
	document.getElementById("imgcount").innerHTML=ci+1;
}

