
function setClass(objt,cls)
{
	document.getElementById(objt).className= cls;
}

function rollOver(objt,cstr)
{
	document.getElementById(objt).className=cstr+'_over';
}

function rollOut(objt,cstr)
{
	document.getElementById(objt).className=cstr+'_out';
}


function menuRollOver(objt)
{
	document.getElementById(objt).className='r_lcol_menu_link_over'
}

function menuRollOut(objt)
{
	document.getElementById(objt).className='r_lcol_menu_link_out'
}
function showProdMore(id) {
	var objInfo 	= new String("prodInfo" + id);
	var objMore 	= new String("prodMore" + id);

	document.getElementById(objInfo).className = 'prod_info_full';
	document.getElementById(objMore).style.display = 'block';
}
function hideProdMore(id) {
	var objInfo 	= new String("prodInfo" + id);
	var objMore 	= new String("prodMore" + id);

	document.getElementById(objMore).style.display = 'none';
	document.getElementById(objInfo).className = 'prod_info';
}

function ustawKontakt(adres) {

	var widok = false;

	email	= document.getElementById("office");

	if (adres != '' && checkEmail(adres)) {
	   email.value = adres;
	   widok = true;
      } else {
	   widok = false;
      }

	pokazDiv("btn_wyslij", widok);
}

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 }
	if (period+3>email.length == -1) { return false }
	return true;
}

function zerujRadioBtn(form_name) {
	var form = document.forms[form_name];
	if (form == null) {return;}
	for (var i = 0; i < form.c_employee_email.length; i++) {
		form.c_employee_email[i].checked = false;
	}
}

function sprawdzRadioBtn(form_name, msg_radio) {

	var zaznaczenie = false;
	var form = document.forms[form_name];

	if (form == null) {return false;}
	for (var i = 0; i < form.c_employee_email.length; i++) {
		if (form.c_employee_email[i].checked == true) {zaznaczenie = true;};
	}

	if (zaznaczenie == false) {
      	alert(msg_radio);
      }

      return zaznaczenie;
}

function wyslijPytanie(form, msg_mail, msg_name) {
	if (form.c_email.value == '' || !(checkEmail(form.c_email.value))) {
		alert(msg_mail);
		form.c_email.focus();
		form.c_email.select();
		return false;
	} else if (msg_name != '' && form.c_signature.value == '') {
		alert(msg_name);
		form.c_signature.focus();
		form.c_signature.select();
		return false;

	} else {
		return true;
	}
}

function showHideDiv(divID,divCount){
				  for(i=1;i<=divCount;i++){
					   cur_div = 'popup_' + i;
					   cur_t   = 'popup_t_'+i;
					   cur_a   = 'popup_a_'+i;
					   section = document.getElementById(cur_div);
					   section_t=document.getElementById(cur_t);
					   section_a=document.getElementById(cur_a);
					   
					   if(i != divID)
						{		
							section.style.display = 'none';
							section_t.className='m_out';
							section_a.style.color='#444444';
						}
						else
						{
							section.style.display = 'block';
							section_t.className='m_over';
							section_a.style.color='white';
						}
					   
				  }
				}
