function preloading(){
	for (i=0;i<arguments.length ;i++){
		if (document.getElementById){
			if (document.images){
				eval(arguments[i]+' = new Image()');
	           	eval(arguments[i]+'.src ="gfx/'+ arguments[i] +'.gif"');
			  	eval('a'+arguments[i]+' = new Image()');
        	   	eval('a'+arguments[i]+'.src ="gfx/a'+ arguments[i] +'.jpg"');
			}
		}
	}
}	    

preloading('ofirmie','kasyfisk','oprogfirm','mobilesys','sprzetkomp','dla_dealerow','rozwiazania','dladealerow','wdrozenia','kontakt','strzalka_down','strzalka_up');

function over(iObj){
	if (document.getElementById) 
		document.getElementById(iObj).style.backgroundImage =  "url('"+ eval ('a'+iObj+'.src') +"')" ;
}
function out(iObj){
	if (document.getElementById)
   		document.getElementById(iObj).style.backgroundImage =  "url('"+ eval (iObj+'.src') +"')" ;
}
function init(){
	if (document.getElementById) {
	   block = document.getElementById("logform").style;
	   	block.top = block.ypos = start_pos = -42;
		max_pos = 0;
		to_pos = 0;
		step = 3;
	}
}

function overbg(iObj){
	if (document.getElementById) 
		document.getElementById(iObj).style.backgroundColor =  "#d6d9db";
}
function outbg(iObj){
	if (document.getElementById) 
		document.getElementById(iObj).style.backgroundColor =  "#e9ecee";
}
function new_window(x,y,fileName){
	var xWin=(screen.availWidth-10);
	var yWin=(screen.availHeight-29);
	var xscrepos=((xWin-x)/2);
	var yscrepos=((yWin-y)/2);
	if (  (xWin<=x)||(yWin<=y)  ){
   	   okno = eval('window.open("' + fileName + '","galeria","menubar=no,status=no,toolbar=no,resizable=no,directories=no,scrollbars=yes,fullscreen=no,top=0,left=0,height='+yWin+',width='+xWin+'")')
	}
	else if( (xWin>x)&&(yWin>y) )
	{
	   okno = eval('window.open("' + fileName + '","galeria","menubar=no,status=no,toolbar=no,resizable=no,directories=no,scrollbars=no,fullscreen=no,top='+yscrepos+',left='+xscrepos+',height='+y+',width='+x+'")')
	}
}
var user;

function mail_write(user){
	var domena="ekspert.szczecin";
	var suffix="pl";
	document.write('<a href="' + 'mailto:' + user + '@' + domena + '.' + suffix + '" class="link">' + user + '@' + domena + '.' + suffix + '</a>');
}

function check_form()
{
	if (document.contactform.imie.value == "")
	{
		document.contactform.imie.style.background = "#5764AA";
		alert("Proszę podać imię i nazwisko.");
		return;
	}
	if (document.contactform.email.value == "")
	{
		document.contactform.email.style.background = "#5764AA";
		alert("Proszę podać adres email.");
		return;
	}
	else 
	{
		if (!check_validEmail(document.contactform.email.value)) 
		{
			 document.contactform.email.style.background = "#5764AA";
			 alert("Proszę podać prawidłowy adres email.");
	 		 return;
		}
	}
	 if (document.contactform.miasto.value == "")
	{
		document.contactform.miasto.style.background = "#5764AA";
		alert("Proszę wpisać miasto.");
		return;
	}
	if (document.contactform.nazwa.value == "")
	{
		document.contactform.nazwa.style.background = "#5764AA";
		alert("Proszę wpisać nazwę firmy.");
		return;
	}
	if (document.contactform.telefon.value == "")
	{
		document.contactform.telefon.style.background = "#5764AA";
		alert("Proszę wpisać numer telefonu.");
		return;
	}
	else 
	{
		validtel = /^[0-9 \(\)]+$/;
		if ( !validtel.exec(document.contactform.telefon.value) )
		{
			document.contactform.telefon.style.background = "#5764AA";
			alert("Proszę wpisać poprawny numer telefonu.");
			return;
		}
	}
	document.contactform.sprawdz.value = "wyslij";
	document.contactform.submit();
}

function check_validEmail(adres_email)
{
 	validemail = /^[-^!#$%&'*+\/=?`{|}~.\w]+@[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])*)+$/  
	if (validemail.exec(adres_email) )
		return true;
	else
		return false;
}
function mail_write(user){
	var domena="smycze";
	var suffix="biz";
	document.write('<a href="' + 'mailto:' + user + '@' + domena + '.' + suffix + '" >' + user + '@' + domena + '.' + suffix + '</a>');
}
