/*
	--------------------------------------------------------------------------
	Version: 1.00
	Release date: 03/01/2009
	Last update: 06/01/2009

	(c) 2009 CopyImageContents

	This program is distributed under the terms of the GNU General Public
	Licence version 2, available at http://www.gnu.org/licenses/gpl.txt
	--------------------------------------------------------------------------
*/



function onImageOver(cur, idanchor, active, actlnk) {
    var targetanchor = document.getElementById(idanchor);
    if (targetanchor == null) return;
    var targetimage  = targetanchor.getElementsByTagName('img')[0];
    var curimage     = cur.getElementsByTagName('img')[0];
    if (curimage == null || cur == null || targetimage == null ) return; //not found, then do nothing
    targetanchor.href = cur.href; // set the new anchor
    targetimage.src = curimage.src; // set the new image

    var oldimage = document.getElementById(active);

    if (oldimage != null) {
      oldimage.removeAttribute("id");
    }
    curimage.id = active;

    var l = document.getElementById(actlnk);

    if (l != null) {
      l.href = cur.href;
    }
}

