zoom="";
function okno(arg,s,x,y) {
	if (zoom == '[object]') {zoom.close()} else {}
	scr_width = screen.availWidth;
	scr_height = screen.availHeight;
	left_align = eval(scr_width/2)-eval(x/2);
	top_align = eval(scr_height/2)-eval(y/2);
	zoom=window.open(arg,'powiekszenie','toolbar=0,location=0,direction=0,status=0,resize=0,menubar=0,scrollbars='+s+',width='+x+',height='+y+',left='+left_align+',top='+top_align);
}

function ulubione(){
  window.external.addFavorite('http://www.echo.szczecin.pl',
                      'ECHO On-line Szczecin - wydarzenia, kluby, kultura, lokale, gastronomia, repertuar')
}

function valid_mail(co) {
	return (/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(co));
}

function hidediv( id ) { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById(id).style.display = 'none'; 
	} 
	else { 
		if (document.layers) { // Netscape 4 
		document(id).display = 'none'; 
		} 
		else { // IE 4 
		document.all(id).style.display = 'none'; 
		} 
	} 
} 

function showdiv( id ) { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById(id).style.display = ''; 
	} 
	else { 
		if (document.layers) { // Netscape 4 
		document(id).display = ''; 
		} 
		else { // IE 4 
		document.all(id).style.display = ''; 
		} 
	} 
} 

function show(id) { 
	document.getElementById[id].style.display = ''; 
}

function hide(id) {
    document.getElementById[id].style.display = 'none'; 
}

wydruk="";
function drukuj(arg,s,x,y) {
	if (wydruk == '[object]') {wydruk.close()} else {}
	scr_width = screen.availWidth;
	scr_height = screen.availHeight;
	left_align = eval(scr_width/2)-eval(x/2);
	top_align = eval(scr_height/2)-eval(y/2);
	wydruk=window.open(arg,'wydruk','toolbar=0,location=0,direction=0,status=0,resize=0,menubar=0,scrollbars='+s+',width='+x+',height='+y+',left='+left_align+',top='+top_align);
}


function check_comments() {
	var x=0;
	var msg='';
	
	if ((document.comment.guest.value=='')&&(document.comment.user_id.value=='')) {
		alert('Prosze o podanie autora\n');
		return false;
	} else return true;
	if (document.comment.text.value=='') {
		alert('Prosze o podanie tresci komentarza\n');
		return false;
	} else return true;
	if (document.comment.tandc.checked==false) {
	    alert("Prosze zaakceptowac warunki strony internetowej")
	    return false
  }
  
	else return true;
}

function check_addevent() {
	var x=0;
	var msg='';
	
	if (document.addevent.nazwa.value=='') {
		alert('Prosze o podanie nazwy wydarzenia\n');
		return false;
	} 
	if (document.addevent.kategoria.value=='') {
		alert('Prosze o podanie kategorii wydarzenia\n');
		return false;
	} 
	if (document.addevent.miejsce.value=='') {
	    alert("Prosze o podanie miejsca")
	    return false
  	}
	if (document.addevent.wstep.value=='') {
	    alert("Prosze o podanie informacji dotyczacych wstepu")
	    return false
  	}
	if (document.addevent.opis.value=='') {
	    alert("Prosze o podanie opisu wydarzenia")
	    return false
  	}
	else return true;
}

function check_addfoto() {
	var x=0;
	var msg='';
	
	if (document.addfoto.nazwa.value=='') {
		alert('Prosze o podanie nazwy galerii\n');
		return false;
	} 
	if (document.addfoto.kategoria.value=='') {
		alert('Prosze o podanie kategorii galerii\n');
		return false;
	}
	if (document.addevent.addfoto.value=='') {
	    alert("Prosze o podanie opisu galerii")
	    return false
  	}
	else return true;
}


function check_kontakt() {
	var x=0;
	var msg='';
	
	if (document.kontakt.autor.value=='') {
		alert("Prosze o podanie autora\n");
		return false;
	} else return true;
	if (document.kontakt.email.value=='') {
		alert("Prosze o podanie emaila\n");
		return false;
	} else return true;
	if (document.kontakt.email.value!='') {
		if(!valid_mail(document.kontakt.email.value)) {
		alert("Prosze o podanie prawidlowego adresu e-mail\n");
		return false;
		}
	} else return true;
	if (document.kontakt.text.value=='') {
		alert("Prosze o podanie tresci korespondencji\n");
		return false;
	} else return true;
}

function check_ankieta() {
	var x=0;
	var msg='';
	
	if (document.form.name_uczestnika.value=='') {
		alert("Prosze o podanie imienia i nazwiska\n");
		return false;
	} 
	if (document.form.email_uczestnika.value=='') {
		alert("Prosze o podanie emaila\n");
		return false;
	}
	if (document.form.email_uczestnika.value!='') {
		if(!valid_mail(document.form.email_uczestnika.value)) {
		alert("Prosze o podanie prawidlowego adresu e-mail\n");
		return false;
		}
	} 
	if (document.form.regulamin.checked==false) {
	    alert("Prosze zaakceptowac regulamin konkursu")
	    return false
  	}
	else return true;
}


function check_infoadd() {
	var x=0;
	var msg='';

	if (document.comment.nazwa.value=='') {
		alert('Prosze o podanie nazwy\n');
		return false;
	} else return true;
	if (document.comment.adres.value=='') {
		alert('Prosze o podanie adresu\n');
		return false;
	} else return true;
	if (document.comment.tandc.checked==false) {
	    alert("Prosze zaakceptowac warunki strony internetowej")
	    return false
  }	
	else return true;
}
	
	
function onColor(co,jaki)
{
	co.style.backgroundColor=jaki;
}

function offColor(co,jaki)
{
	co.style.backgroundColor=jaki;
}



function check_mail() {
	if (document.form1.email.value!='') {
		if(!valid_mail(document.form1.email.value)) {
		alert('Prosze o podanie prawidlowego adresu e-mail\n');
		return false;
		}
	}
	else return true;
}

