// Copyright (c) 2001 Peter Gehrig and Urs Dudli. All rights reserved.
// Additional scripts can be found at http://www.24fun.com.
// info@24fun.com
////////////////////////////////////////////////////////////////////////////
// CONFIGURATION STARTS HERE
////////////////////////////////////////////////////////////////////////////

// URL of the image
var urlimage="../pics_chateaux/carte_list_chat.jpg"

// number of dots that create the dotted lines
var dotnumber=60

// color of pointing lines
var dotcolor="blue"

// width of each dot (pixels)
var dotwidth=4

// height of each dot (pixels)
var dotheight=4

// horizontal distance of the image to the left margin of the webpage (pixels)
var img_left=50

// vertical distance of the image to the top margin of the webpage (pixels)
var img_top=140

////////////////////////////////////////////////////////////////////////////
// CONFIGURATION ENDS HERE
//////////////////////////////////////////////////////////////////////////

// Do not edit the code below
var ns6=document.getElementById&&!document.all?1:0
var imgzonex
var imgzoney
var linkx
var linky
var vorzeichenx=1
var vorzeicheny=1
var notinitiated=true

function createline(thislink,thisx,thisy) {
    if (document.all) {
	    imgzonex=thisx+img_left
        imgzoney=thisy+img_top
        if (imgzonex>linkx) {vorzeichenx=-1} 
        else{vorzeichenx=1}
        if (imgzoney>linky) {vorzeicheny=-1}
        else{vorzeicheny=1}
        var thisdot=eval("document.all.dot1.style")
        thisdot.posLeft=img_left+thisx
        thisdot.posTop=img_top+thisy
	    for (i=2;i<=dotnumber;i++) {
            var thisdot=eval("document.all.dot"+i+".style")
            thisdot.posLeft=img_left+thisx+vorzeichenx*(((Math.abs(imgzonex-linkx))/(dotnumber)*(i-1)))
            thisdot.posTop=img_top+thisy+vorzeicheny*(((Math.abs(imgzoney-linky))/(dotnumber)*(i-1)))
	    }
    }
    if (ns6) {
        imgzonex=thisx+img_left
        imgzoney=thisy+img_top
        if (imgzonex>linkx) {vorzeichenx=-1} 
        else{vorzeichenx=1}
        if (imgzoney>linky) {vorzeicheny=-1}
        else{vorzeicheny=1}
        document.getElementById('dot1').style.left=img_left+thisx
        document.getElementById('dot1').style.top=img_top+thisy
	    for (i=2;i<=dotnumber;i++) {           document.getElementById("dot"+i).style.left=img_left+thisx+vorzeichenx*(((Math.abs(imgzonex-linkx))/(dotnumber)*(i-1)))
            document.getElementById("dot"+i).style.top=img_top+thisy+vorzeicheny*(((Math.abs(imgzoney-linky))/(dotnumber)*(i-1)))
	    }
    }
    if (document.layers) {
        if (notinitiated) {
            for (i=1;i<=dotnumber;i++) {
                var thisdot=eval("document.dot"+i)
                thisdot.zIndex=i+1000
	        }
            notinitiated=false
        }
        imgzonex=thisx+img_left
        imgzoney=thisy+img_top
        if (imgzonex>linkx) {vorzeichenx=-1} 
        else{vorzeichenx=1}
        if (imgzoney>linky) {vorzeicheny=-1}
        else{vorzeicheny=1}
        var thisdot=eval("document.dot1")
        thisdot.left=img_left+thisx
        thisdot.top=img_top+thisy
	    for (i=2;i<=dotnumber;i++) {
            var thisdot=eval("document.dot"+i)
            thisdot.left=img_left+thisx+vorzeichenx*(((Math.abs(imgzonex-linkx))/(dotnumber)*(i-1)))
            thisdot.top=img_top+thisy+vorzeicheny*(((Math.abs(imgzoney-linky))/(dotnumber)*(i-1)))
	    }
    }
}

if (document.all || ns6) {
    for (i=1;i<=dotnumber;i++) {
        var zindexcount=1000+i
        document.write("<span id='dot"+i+"' style='position:absolute;left:-10px;top:100px;z-index:"+zindexcount+"'><table cellpadding=0 cellspacing=0 border=0 bgcolor='"+dotcolor+"'><tr><td><img src='emptydot.gif' width='"+dotwidth+"' height='"+dotheight+"' border=0></td></tr></table></span>")
	}
    document.write("<span id='imgcontainer' style='position:absolute;left:"+img_left+"px;top:"+img_top+"px'>")
    document.write("<img src='"+urlimage+"'>")
    document.write("</span>")
}
if (document.layers) {
    for (i=1;i<=dotnumber;i++) {
        document.write("<layer name='dot"+i+"' left=-100 top=-100><table cellpadding=0 cellspacing=0 border=0 bgcolor='"+dotcolor+"'><tr><td><img src='emptydot.gif' width='"+dotwidth+"' height='"+dotheight+"' border=0></td></tr></table></layer>")
	}
    document.write("<layer name='imgcontainer' left="+img_left+" top="+img_top+">")
 document.write("<img src='"+urlimage+"'>")
    document.write("</layer>")
    document.close()
}

function handlerMM(e) {
	linkx = (document.layers || ns6) ? e.pageX : document.body.scrollLeft+event.clientX
	linky = (document.layers || ns6) ? e.pageY : document.body.scrollTop+event.clientY
}

if (document.layers){
	document.captureEvents(Event.MOUSEMOVE);
}

if (document.layers || document.all || ns6) {
    document.onmousemove=handlerMM;
}