function go2URL(address)
{
	document.location.href=address
}


function okienkoImg(urlImg, title, width, height) {    
	var Win = window.open('',"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no, menubar=no, left=350, top=100' );
	Win.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Ulrich - '+title+'</title></head><body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">');
	
	Win.document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><a href="javascript:self.close();"><img src="'+urlImg+'" alt="" border="0"></a></td></tr></table>');
	Win.document.write('</body></html>');
	
};

function printWindow(url){ 
	 w = window.open(url,'printWin','align=center,toolbar=0,status=1,location=0,directories=0,resizable=yes,scrollbars=yes,width=700,height=500,menubar=yes')
	 w.focus();
} 

function checkPressContactForm(f, calert, emailalert) {
	if(
		f.name.value != ''
		&& f.surname.value != ''
		&& f.firmName.value != ''
		&& f.telPrefix.value != ''
		&& f.telNumber.value != ''
		
		&& f.desc.value != ''
		
		&& checkEmailAddress(f.email)
		&& f.agree.checked
	) {
		f.submit();
	} else {
		if(!checkEmailAddress(f.email)) {
			alert(emailalert);
		} else {
			alert(calert);
		}
	}
}


function checkContactForm(f, calert, emailalert) {
	if(
		f.name.value != ''
		&& f.surname.value != ''
		&& f.firmName.value != ''
		&& f.office.value != ''
		&& f.firmAddr.value != ''
		&& f.telPrefix.value != ''
		&& f.telNumber.value != ''
		
		//&& f.mobile.value != ''
		&& f.desc.value != ''
		
		&& f.firmProfits.selectedIndex > 0
		&& f.trade.selectedIndex > 0		

		&& checkEmailAddress(f.email)
		&& f.agree.checked
	) {
		f.submit();
	} else {
		if(!checkEmailAddress(f.email)) {
			alert(emailalert);
		} else {
			alert(calert);
		}
	}
}

function checkBrochureForm(f, calert, emailalert) {
	if(
		f.name.value != ''
		&& f.surname.value != ''
		&& f.street.value != ''
		&& f.number.value != ''
		&& f.code.value != ''
		&& f.city.value != ''
		&& checkEmailAddress(f.email)
		&& f.agree.checked
	) {
		f.submit();
	} else {
		if(!checkEmailAddress(f.email)) {
			alert(emailalert);
		} else {
			alert(calert);
		}
	}
}

function checkEmailAddress(field) {
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	
	if (goodEmail){
	  return true
	} else {
    field.focus()
    field.select()
    return false
  }
}