// JavaScript Document

function navigate(selectref)
{
	if(selectref.value!="")
        	document.location.href="http://"+selectref.value;

	//document.location.href="files/prod_cards/"+selectref.name+"/"+selectref.value+".pdf";
}

function verify_form(thisform)
{	
	//b = isBrowser();
	hide_error("error_main");
	var error=true;
	if(thisform.wiadomosc.value=="")
	{
		show_error("error_main");
		error=false;
	}
	

	if(thisform.imie.value=="")
	{
		show_error("error_main");
		
		error=false;
	}
	
	
	if(thisform.nazwisko.value=="")
	{
		show_error("error_main");
		error=false;
	}
	
		
	var reg=/^.+@.+\..+$/;
	if(thisform.email.value=="")
	{
		show_error("error_main");
		error=false;
	}
	else
	{
		
	
		if(thisform.email.value.match(reg)==null)
		{
			show_error("error_main");
			
			error=false;
		}
		
	}
	
	if(thisform.miejscowosc.value=="")
	{
		show_error("error_main");
		
		error=false;
	}
	
	if(thisform.kod.value=="")
	{
		show_error("error_main");
		
		error=false;
	}
	
	
	if(thisform.powiat.value=="")
	{
		show_error("error_main");
		error=false;
	}
	
		
	if(thisform.adres.value=="")
	{
		show_error("error_main");
		error=false;
	}
	
		
	if(thisform.wojewodztwo.value=="")
	{
		show_error("error_main");
		
		error=false;
	}
	
	if(thisform.odbiorca.value=="")
	{
		show_error("error_main");
		
		error=false;
	}
	
	if(thisform.zgoda.checked!=true)
	{
		show_error("error_main");
		error=false;
	}
	
	
	return error;
}

function show_error(what)
{
	//var what="error_1";
	b=navigator.appName;
	
	this.frm = "";

	this.doc = "document.";
	this.vis = ".display=";
	
	if (b=="Microsoft Internet Explorer") {
		this.obj = "all['"+what+"']";
		this.st = ".style";
		this.make = "\"block\"";
	
	} else {
		this.obj = "getElementById('"+what+"')";
		this.st = ".style";
		this.make = "\"block\"";
	}
	eval(this.frm+this.doc+this.obj+this.st+this.vis+this.make);
}

function hide_error(what)
{
	b=navigator.appName;
	
	this.frm = "";

	this.doc = "document.";
	this.vis = ".display=";
	
	if (b=="Microsoft Internet Explorer") {
		this.obj = "all['"+what+"']";
		this.st = ".style";
		this.make = "\"none\"";
	
	} else {
		this.obj = "getElementById('"+what+"')";
		this.st = ".style";
		this.make = "\"none\"";
	}
	eval(this.frm+this.doc+this.obj+this.st+this.vis+this.make);
	
}

function addbookmark()
{
	var adres=document.location;
	var tytul=document.title;
	
	
	if (window.sidebar) 
	{ 
		window.sidebar.addPanel(tytul, adres, ""); 
	} 
	else if (window.external) 
	{ 
	 	window.external.AddFavorite(adres, tytul); 
	} 
	else if (window.opera && window.print) 
	{ 
		var a = document.createElement('a'); 
		a.setAttribute('href', adres); 
		a.setAttribute('title', tytul); 
		a.setAttribute('rel','sidebar'); 
		a.click(); 
	}
	
}
