var path="http://www.jezioro.com.pl/pics/";

function preloadImages(the_images_array){
   for(var loop = 0; loop < the_images_array.length; loop++){
	var an_image = new Image();
	an_image.src = path+the_images_array[loop];
   }
}

function doPreload() {
	var the_images = new Array('noclegi_on.png','noclegi_off.png', 'forum_on.gif','forum_off.gif', 'ogloszenia_on.png', 'ogloszenia_off.png', 'poczta_on.png', 'poczta_off.png', 'linki_on.png', 'linki_off.png', 'szukaj_napis.png', 'szukaj.png');
	preloadImages(the_images);
}

doPreload();

function imgSwap(daImage, pos, layer) {
	if (document.images) {
		if (layer != null && document.layers) {
			objStr = 'document.layers[layer].document.layers[0].document.' + daImage;
		} else {
			objStr = 'document.' + daImage;
		}
		obj = eval(objStr);

		if (daImage != 'forum') {
		obj.src = path+daImage+(pos == 0 ? "_off" : "_on")+".png";
		} else {
		obj.src = path+daImage+(pos == 0 ? "_off" : "_on")+".gif";
		}

	}
}
function pokaz_zdjecie(url) {
        var Win = window.open(url,"pokaz_zdjecie",'width=820,height=570,resizable=0,scrollbars=no,menubar=no, top=0, left=0');
}

function setPointer(theRow, theAction)
	{
    var theCells = null;
	var theDefaultColor = '#FFFFFF';
	var thePointerColor = '#E4EEEE';
	
    if (typeof(document.getElementsByTagName) != 'undefined') 
		{
        theCells = theRow.getElementsByTagName('td');
	    }
    else if (typeof(theRow.cells) != 'undefined') 
		{
        theCells = theRow.cells;
    	}
    else 
		{
        return false;
	    }

    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;

    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') 
		{
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    	}

    else 
		{
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
	    }

    if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) 
		{
        if (theAction == 'over' && thePointerColor != '') 
			{
            newColor = thePointerColor;
        	}
   		 }
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) 
		{
        if (theAction == 'out')
			{
	        newColor = theDefaultColor;
    	    }
	    }

    if (newColor) 
		{
        var c = null;

        if (domDetect) 
			{
            for (c = 0; c < rowCellsCnt; c++) 
				{
                theCells[c].setAttribute('bgcolor', newColor, 0);
	            } // end for
    	    }
        else 
			{
            for (c = 0; c < rowCellsCnt; c++) 
				{
                theCells[c].style.backgroundColor = newColor;
	            }
	        }
    	}
	
    return true;
	}

function displayWindow(url) {
        var Win = window.open(url,"displayWindow",'width=200,height=200,resizable=0,scrollbars=no,menubar=no');
}

function formsubmit() {
    alertmsg = "";
    if (document.msgform.author.value == "") { alertmsg = "Wpisz swoje imię"; }
    if (document.msgform.subj.value == "") { alertmsg = "Wpisz temat wiadomości"; }
    if (alertmsg == "") {
        return true;
    } else {
        window. alert (alertmsg);
        return false;
    }
}


