/*#############################################################
Name: Niceforms
Version: 0.9
Author: Lucian Slatineanu
URL: http://www.badboy.ro/

Feel free to use and modify but please provide credits.
#############################################################*/

//global variables that can be used by all the functions on this page.
var preloaded = new Array();

//this function runs when the page is loaded so put all your other onload stuff in here too.
function init() {
	preload_images()
	hoverEffects();
}


function preload_images() {
    for (var i = 0; i < arguments.length; i++){
        preloaded[i] = document.createElement('img');
        preloaded[i].setAttribute('src',arguments[i]);
    };
};
preload_images(
          "img/primaria.png" ,
          "img/cluj.png" ,
          "img/dsp.png" ,
          "img/frb.png" ,
          "img/ucj.png" ,
		  "img/ratuc.png" ,
		  "img/teleyimex.png" ,
		  "img/tea.png", 
          "img/foaia.png" ,
          "img/paprika.png" ,
          "img/szabadsag.png" ,
          "img/faclia.png", 
          "img/informatia.png" ,
		  "img/monitorul.png" 
);



function hoverEffects() {
	//get all elements (text inputs, passwords inputs, textareas)
	var main = document.getElementById('partners');
	var elements = main.getElementsByTagName('img');
	var j = 0;
	for (var j = 0; j < elements.length; j++) {
		
		elements[j].onmouseover = function() {
			var s = this.src.toString();
			//alert(s);
			this.setAttribute('src',s.replace(/_h.png/g, ".png"));
			;}
		elements[j].onmouseout = function() {
			var s = this.src.toString();
		
			this.setAttribute('src', s.replace(/.png/g, "_h.png"));
			;}
	}
	
}

window.onload = init;