
function goTo (l) {
	location.href=l;
}

function changeBg (el) {
	el.style.backgroundColor = '#ffecec';
}
function changeBgTr (el) {
	el.style.backgroundColor = 'white';
}

function resizeContent () {
	var contentIframe = parent.document.getElementById('contentId');
	var contentOffset = document.body.offsetHeight ? document.body.offsetHeight : false;
	
	if(contentIframe != null) {
		contentIframe.style.height=contentOffset+'px';
	}
}

function openMenu(id) {
	var idEl = 'subMenu' + id;
  paramsEl = document.getElementById(idEl);
	 
  if(paramsEl.className == 'hiddenMenu') {
  	paramsEl.className = 'showMenu';
  } else {
  	paramsEl.className = 'hiddenMenu';
  }
  
  resizeContent ();
}



function okienkoImg(urlImg, title, width, height) {   
	var width = parseInt(width);
	var height = parseInt(height);
	var width = (isNaN(width) ? 420 : width+20);
	var height = (isNaN(height) ? 420 : height+20);
 
	var Win = window.open('',"",'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>'+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 align=center><table style="padding:4px;border:silver 1px solid"><tr><td><a href="javascript:self.close();"><img src="'+urlImg+'" alt="" border="0"></a></td></tr></table></td></tr></table>');
	Win.document.write('</body></html>');
	
};

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
  }
}