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];}}
}

function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
    var actualWidth=typeof optWidth!="undefined" ? optWidth : "770px"; //set 600px to default width
    var actualHeight=typeof optHeight!="undefined" ? optHeight : "550px"; //set 500px to  default height
    var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes";
    var msgWindow = window.open("","Image", winattributes);
    var head  = '<html><head><title>Image</title></head>';
    var body1 = '<body bgcolor="#FFFFFF" style="margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;">';
    var image = '<center><a href="javascript:self.close()"><img src="'+path+'" border="0"></a></center>';
    var body2 = '</body></html>';
    msgWindow.document.write(head + body1 + image + body2);
    msgWindow.document.close();
}



function mapimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
    var actualWidth=typeof optWidth!="undefined" ? optWidth : "870px"; //set 600px to default width
    var actualHeight=typeof optHeight!="undefined" ? optHeight : "670px"; //set 500px to  default height
    var winattributes="width="+actualWidth+",height="+actualHeight+", resizable=yes, scrollbars=yes";
    var msgWindow = window.open("","Térkép", winattributes);
    var head  = '<html><head><title>Image</title></head>';
    var body1 = '<body bgcolor="#FFFFFF" style="margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;">';
    
    var script = '<script>'+
                 'var path = \''+ path +'\';'+
                 'var click = 0;'+
                 'function myOnclick( image, path )'+
                 '{'+
                 'if (click == 0)'+
                 '  {'+
                 '  image.width=850;'+
                 '  image.height=650;'+
                 '  }'+
                 'if (click == 1)'+
                 '  {'+
                 '  image.src=path+\'_k.gif\';'+
                 '  }'+
                 'if (click == 2)'+
                 '  {'+
                 '  window.close();'+
                 '  }'+
                 'click++;'+
                 '}'+
                 '</script>';
    
    
//    var image = '<center><img src="'+path+'.gif" onClick="this.src=\''+path+'_k.gif\';this.width=\'850\';this.height=\'650\';this.onclick=function(){window.close()}"></center>';
    var image = '<center><img src="'+path+'.gif" onClick="myOnclick(this, path)"></center>';
    var body2 = '</body></html>';
    msgWindow.document.write(head + body1 +script+ image + body2);
    msgWindow.document.close();
}
