//***********************************************************************************************
function maillist(setmail){
	var obj = document.getElementById('newsmail');
	if(obj != null)
	{
		document.getElementById('newsmail').value = setmail;
	}
}
//***********************************************************************************************
function checkEmail (email) {
      invalid = " /:,;";
      if (email=="") { return false }
      for (i=0; i<invalid.length; i++) {
        bad = invalid.charAt(i);
        if (email.indexOf (bad, 0) != -1) { return false }
      }
      at = email.indexOf ("@", 0);
      if ((at == -1) || (at == 0)) { return false }
      if (email.indexOf ("@", at+1) != -1) { return false }
      period = email.indexOf (".", at);
      if ((period == -1) || (period == at+1)) { return false }
	  znak = email.charAt(email.length - 1);
      if (znak ==  ".") { return false }
      at = email.indexOf (".",email.length - 4);
      if (at == -1) { return false };
      return true;
}
//***********************************************************************************************
function zapisz(form,msg) {
	if (!(checkEmail(form.newsletter_mail.value))) {
		alert(msg);
		form.newsletter_mail.focus();
		form.newsletter_mail.select();
		return false;
	}
	else {
		return true;
	}
}
//***********************************************************************************************
function zapiszCustomer(form,msg) {
	var ifNewsletter = form.newsletter.checked;

	if (ifNewsletter) {
		if (!(checkEmail(form.email.value))) {
			alert(msg);
			form.email.focus();
			form.email.select();
			return false;
		} else {
			return true;
		}
	} else {
		if (!(checkCustomerEmail(form.email.value))) {
			alert(msg);
			form.email.focus();
			form.email.select();
			return false;
		} else {
			return true;
		}
	}
}
//***********************************************************************************************
function checkCustomerEmail (email) {
      invalid = " /:,;";
      if (email=="") { return true }
      for (i=0; i<invalid.length; i++) {
        bad = invalid.charAt(i);
        if (email.indexOf (bad, 0) != -1) { return false }
      }
      at = email.indexOf ("@", 0);
      if ((at == -1) || (at == 0)) { return false }
      if (email.indexOf ("@", at+1) != -1) { return false }
      period = email.indexOf (".", at);
      if ((period == -1) || (period == at+1)) { return false }
	  znak = email.charAt(email.length - 1);
      if (znak ==  ".") { return false }
      at = email.indexOf (".",email.length - 4);
      if (at == -1) { return false };
      return true;
}
//***********************************************************************************************
function sendOpinion(form,msg) {
	var key = 0;
	for (var i = 0; i < form.my_opinion.length; i++){
		if (form.my_opinion[i].checked){
			key = form.my_opinion[i].value;
			break;
		}
	}

	if (key == 0) {
		alert(msg);
		return false;
	} else {
		if (key == form.klucz.value) {
			form.action.value = "form";
		} else {
//			form.set.value = "tak";
		}
	}
	return true;
}
//***********************************************************************************************
function submitForm(name){
	if (document.forms[name])   {
		document.forms[name].submit();
	}
}
//***********************************************************************************************
function updateForm(){
	var obj = document.getElementById('section');
	if(obj != null)
	{
		document.getElementById('section').value = 'update';
	}
}
//***********************************************************************************************
function cleartxt(set){
	var obj = document.getElementsByName('clear_txt');
	if(obj != null)
	{
		document.forms['frm'].clear_txt.value = set;
	}
	document.forms['frm'].submit();
}
//***********************************************************************************************
function setViewHide(button) {
	var view	= (button.value == 1) ? "block" : "none";
//	var form	= document.forms['frm_customer'];

//	document.getElementById('l_size').style.display	= view;
//	document.getElementById('c_size').style.display	= view;
	document.getElementById('l_height').style.display	= view;
	document.getElementById('c_height').style.display	= view;
	document.getElementById('l_width').style.display	= view;
	document.getElementById('c_width').style.display	= view;
	document.getElementById('l_length').style.display	= view;
	document.getElementById('c_length').style.display	= view;
	document.getElementById('l_temperature').style.display	= view;
	document.getElementById('c_temperature').style.display	= view;
	document.getElementById('l_typ').style.display	= view;
	document.getElementById('c_typ').style.display	= view;
}
//***********************************************************************************************
function odswiezObject() {
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++)
	{
		objects[i].outerHTML = objects[i].outerHTML;
	}
}
//***********************************************************************************************

//obsluga dolnego banera
PositionX = 0;
PositionY = 0;
defaultWidth  = 620;
defaultHeight = 400;

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
imageURL = 'images/' + imageURL;
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();                
}}

//***********************************************************************************************