﻿	// ------ Image functions
	
	function cacheImages(imgList, path) {
		if (path == null) path = '';
		var images = new Array();
		for (var i=0; i<imgList.length; i++) {
			images[i] = new Image();
			images[i].src = path + imgList[i];
		}
	}	

	// ------ Other functions
	
	function element(id) {
		e = document.getElementById(id);
		return e; 
	}
	
	function pass(func) {
		eval(func);
	}
	
    function changeClass(objectId, className) {
    
        if ( ( element(objectId) != null )&&( element(objectId) != undefined ) )
        {
		    element(objectId).className  = className;
	    }
	}
	
	// ---------- popup windows
	// modual 
	 function modalWin(pageUrl, windowName, dialogWidth, dialogHeight) {
	    if (window.showModalDialog) {
            window.showModalDialog(pageUrl, windowName, 'dialogWidth:' + dialogWidth + 'px;dialogHeight:' + dialogHeight + 'px;edge:raised;help:no;scroll=no;status:no;resizable:no;center:yes;');
        }
        else
        {
           window.open(pageUrl, windowName, 'width=' + dialogWidth + ',height=' + dialogHeight + ', ,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
        }
    }

    //----------- onload functie
//   	function addOnloadEvent(fnc){
//		if ( typeof window.addEventListener != "undefined" )
//			window.addEventListener( "load", fnc, false );
//			else if ( typeof window.attachEvent != "undefined" ) {
//			window.attachEvent( "onload", fnc );
//		}
//		else {
//			if ( window.onload != null ) {
//				var oldOnload = window.onload;
//				window.onload = function ( e ) {
//				oldOnload( e );
//				window[fnc]();
//			};
//		}
//		else
//			window.onload = fnc;
//		}
//	}