//############################## [CMS PORTAL] - JAVA SCRIPTS
//### ver. 1.5 [2009-09-07]
//###
//### Copyright by CN Design Marcin Czechowski
//###
//### cndesign.pl   biuro@cndesign.pl
//###
//### All rights reserved.
//############################################



//************************* Wyskakujace okno

function displayWindow(url, width, height)
{
 var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}



//************************* Liczenie znakow i ograniczenie textarea
// <span id=x>300</span><textarea onKeyUp=\"char_left(this,299);\" OnMouseOver=\"char_left(this,299);\">

function char_left(pole,max)
{
 document.getElementById('x').innerHTML = max - pole.value.length;
 if (pole.value.length > max) pole.value = pole.value.substr(0,max);
}



//************************* Podmiana duzego zdjecia

function swap_image(image)
{
 document.getElementById('big_image').innerHTML = "<img src=" + image + " alt='' border=0>";
}



//************************* Zwiększanie i zmniejszanie wartości w poli input o 1

function plus_minus(pole,act)
{
 var p = document.getElementById(pole);
 var p_show = document.getElementById(pole + '_show').firstChild;

 if ( act == 'plus' )
 {
  p_show.nodeValue++;
 }
 else if ( act == 'minus' )
 {
  if ( p_show.nodeValue > 1 ) p_show.nodeValue--;
 }
 
 p.value = p_show.nodeValue;
}


//*************************************************************************************
//************************* EFEKTY POKAZYWANIA I UKTYWANIA ELEMENTÓW

//*** SHOW / HIDE

var show_hide_opened = 0;
function show_hide(id, speed)
{
 if(!speed) var speed = "normal";

 if(show_hide_opened == 0)
 {
  $('#pos_' + id).show(speed);
  show_hide_opened = id;
 }
 else if(show_hide_opened != 0)
 {
  if(id == show_hide_opened)
  {
   $('#pos_' + id).hide(speed);
   show_hide_opened = 0;
  }
  else if (id != show_hide_opened)
  {
   $('#pos_' + show_hide_opened).hide(speed);
   $('#pos_' + id).show(speed);
   show_hide_opened = id;
  }
 }
}



//*** FADE IN / FADE OUT

var fadein_fadeout_opened = 0;
function fadein_fadeout(id, speed)
{
 if(!speed) var speed = "normal";

 if(fadein_fadeout_opened == 0)
 {
  $('#pos_' + id).fadeIn(speed);
  fadein_fadeout_opened = id;
 }
 else if(fadein_fadeout_opened != 0)
 {
  if(id == fadein_fadeout_opened)
  {
   $('#pos_' + id).fadeOut(speed);
   fadein_fadeout_opened = 0;
  }
  else if (id != fadein_fadeout_opened)
  {
   $('#pos_' + fadein_fadeout_opened).fadeOut(speed);
   $('#pos_' + id).fadeIn(speed);
   fadein_fadeout_opened = id;
  }
 }
}



//*** SLIDE DOWN / SLIDE UP

var slidedown_slideup_opened = 0;
function slidedown_slideup(id, speed)
{
 if(!speed) var speed = "normal";

 if(slidedown_slideup_opened == 0)
 {
  $('#pos_' + id).slideDown(speed);
  slidedown_slideup_opened = id;
 }
 else if(slidedown_slideup_opened != 0)
 {
  if(id == slidedown_slideup_opened)
  {
   $('#pos_' + id).slideUp(speed);
   slidedown_slideup_opened = 0;
  }
  else if (id != fadein_fadeout_opened)
  {
   $('#pos_' + slidedown_slideup_opened).slideUp(speed);
   $('#pos_' + id).slideDown(speed);
   slidedown_slideup_opened = id;
  }
 }
}



//*** SHOW OR HIDE 2

function show_or_hide_2(element)
{
 $("#link_" + element).click(
    function()
    {
     $("#more_" + element).slideToggle("slow");
    }
  ).toggle(
	 function()
	 {
	  $(this).text('ukryj');
	 },
     function()
     {
	  $(this).text('pokaż');
	 }
	);
}


//*** SHOW OR HIDE

function show_or_hide(id)
{
 if(id != null)
 {
  el = document.getElementById('pos_'+id);

  if(!el)
   return;
   el.style.display = el.style.display == 'block' ? 'none' : 'block';
 }
}



//*************************************************************************************
//************************* Wstawianie tekstu

function storeCaret(textEl)
{
 if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}


function wstaw(text, zm)
{
  var gdzie = document.getElementById(zm); 
 if (gdzie.createTextRange && gdzie.caretPos)
 {
	var caretPos = gdzie.caretPos;
	caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
	gdzie.focus();
 }
 else if (gdzie.selectionStart != undefined)
 {
	gdzie.value = gdzie.value.substring(0, gdzie.selectionStart) + text + gdzie.value.substring(gdzie.selectionStart);
	gdzie.focus();
 }
 else
 {
	gdzie.value += text;
	gdzie.focus();
 }
}



//************************************************************************
//************************* OBSŁUGA ZAKŁADEK

function selectContent(containerId, contentIndex, przycisk)
{
 // menu i zaznaczenie przycisku
 var pojemnik_menu = przycisk.parentNode;
 var elementy_menu = pojemnik_menu.getElementsByTagName("*");
 var ile_menu = elementy_menu.length;

 for ( var i = 0; i < ile_menu; i++ )
 {
  elementy_menu[i].className = 'off';
 }

 przycisk.className = 'on';

 // content
 var content = document.getElementById(containerId);
 var elementy_content = content.getElementsByTagName("div");
 var ile_content = elementy_content.length;

 for ( var i = 0; i < ile_content; i++ )
 {
  elementy_content[i].className = 'zakladka';
 }

 //pokazuje wybrany element
 elementy_content[contentIndex].className = 'selected';

		
 return false;
}



//************************************************************************
//************************* WALIDACJA FORMULARZY

function error(tekst)
{
 if (errfound) return;
	window.alert(tekst);
errfound = true;
}


//************************* FORMULARZ KONTAKTOWY

function validate_contact(lang)
{
 errfound = false;
 var bledy = "";


 if (lang == "pl")
 {
  sender_name_txt = "Podaj swoje Imię";
  sender_email_txt = "Podaj swój adres e-mail";
  sender_email_err_txt = "Twój adres e-mail wydaje się być nieprawidłowy";
  subject_txt = "Podaj temat";
  text_txt = "Wpisz treść wiadomości";
 }
 else if (lang == "en")
 {
  sender_name_txt = "Please type Your name";
  sender_email_txt = "Please type Your e-mail address";
  sender_email_err_txt = "Your e-mail address is not valid";
  subject_txt = "Please type subject";
  text_txt = "Please type text";
 }
 else
 {
  sender_name_txt = sender_email_txt = sender_email_err_txt = subject_txt = text_txt = "BRAK TŁUMACZENIA DLA JĘZYKA: " + lang;
 }



 with(document.contact)
 {
  if (sender_name.value == "")
  {
   bledy += "* " + sender_name_txt + "!\n";
   sender_name.style.backgroundColor = "#FFB9B9";
  }
  else sender_name.style.backgroundColor = "#FFFFFF";


  if (sender_email.value == "")
  {
   bledy += "* " + sender_email_txt + "!\n";
   sender_email.style.backgroundColor = "#FFB9B9";
  }
  else if (sender_email.value != "" && (sender_email.value.length < 4 || sender_email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* " + sender_email_err_txt + "!\n";
   sender_email.style.backgroundColor = "#FFB9B9";
  }
  else sender_email.style.backgroundColor = "#FFFFFF";

  
  if (subject.value == "")
  {
   bledy += "* " + subject_txt + "!\n";
   subject.style.backgroundColor = "#FFB9B9";
  }
  else subject.style.backgroundColor = "#FFFFFF";


  if (text.value == "")
  {
   bledy += "* " + text_txt + "!\n";
   text.style.backgroundColor = "#FFB9B9";
  }
  else text.style.backgroundColor = "#FFFFFF";


  if (bledy != "") error(bledy);
 }
return !errfound;
}



//************************* DODAWANIE KOMENTARZA

function validate_com_logout(lang)
{
 errfound = false;
 var bledy = "";


 if (lang == "pl")
 {
  nick_txt = "Podaj nick";
  text_txt = "Wpisz treść komentarza";
 }
 else if (lang == "en")
 {
  nick_txt = "Please type Your nick";
  text_txt = "Please type comment";
 }
 else
 {
  nick_txt = text_txt = "BRAK TŁUMACZENIA DLA JĘZYKA: " + lang;
 }



 with(document.com_add)
 {
  if (nick.value == "")
  {
   bledy += "* " + nick_txt + "!\n";
   nick.style.backgroundColor = "#FFB9B9";
  }
  else nick.style.backgroundColor = "#FFFFFF";


  if (text.value == "")
  {
   bledy += "* " + text_txt + "!\n";
   text.style.backgroundColor = "#FFB9B9";
  }
  else text.style.backgroundColor = "#FFFFFF";


  if(bledy != "") error(bledy);
 }
return !errfound;
}



//************************* NEWSLETTER

function validate_newsletter(lang)
{
 errfound = false;
 var bledy = "";


 if (lang == "pl")
 {
  name_txt = "Podaj swoje Imię";
  email_txt = "Podaj swój adres e-mail";
  email_err_txt = "Twój adres e-mail wydaje się być nieprawidłowy";
 }
 else if (lang == "en")
 {
  name_txt = "Please type Your name";
  email_txt = "Please type Your e-mail address";
  email_err_txt = "Your e-mail address is not valid";
 }
 else
 {
  name_txt = email_txt = email_err_txt = "BRAK TŁUMACZENIA DLA JĘZYKA: " + lang;
 }



 with(document.newsletter)
 {
  if (name.value == "")
  {
   bledy += "* " + name_txt + "!\n";
   name.style.backgroundColor = "#FFB9B9";
  }
  else name.style.backgroundColor = "#FFFFFF";


  if (email.value == "")
  {
   bledy += "* " + email_txt + "!\n";
   email.style.backgroundColor = "#FFB9B9";
  }
  else if (email.value != "" && (email.value.length < 4 || email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* " + email_err_txt + "!\n";
   email.style.backgroundColor = "#FFB9B9";
  }
  else email.style.backgroundColor = "#FFFFFF";


  if (bledy != "") error(bledy);
 }
return !errfound;
}



//************************* RECOMMEND

function validate_recommend(lang)
{
 errfound = false;
 var bledy = "";

 if (lang == "pl")
 {
  recipient_email_txt = "Podaj adres e-mail Twojego znajomego";
  recipient_email_err_txt = "Adres e-mail Twojego znajomego wydaje się być nieprawidłowy";
  sender_email_txt = "Podaj swój adres e-mail";
  sender_email_err_txt = "Twój adres e-mail wydaje się być nieprawidłowy";
  sender_name_txt = "Podaj swoje Imię";
 }
 else if (lang == "en")
 {
  recipient_email_txt = "Please type the e-mail address of Your friend";
  recipient_email_err_txt = "E-mail address of your friend is not valid";
  sender_email_txt = "Please type Your e-mail address";
  sender_email_err_txt = "Your e-mail address is not valid";
  sender_name_txt = "Please type Your name";
 }
 else
 {
  recipient_email_txt = recipient_email_err_txt = sender_email_txt = sender_email_err_txt = sender_name_txt = "BRAK TŁUMACZENIA DLA JĘZYKA: " + lang;
 }



 with(document.recommend)
 {
  if (recipient_email.value == "")
  {
   bledy += "* " + recipient_email_txt + "!\n";
   recipient_email.style.backgroundColor = "#FFB9B9";
  }
  else if (recipient_email.value != "" && (recipient_email.value.length < 4 || recipient_email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* " + recipient_email_err_txt + "!\n";
   recipient_email.style.backgroundColor = "#FFB9B9";
  }
  else recipient_email.style.backgroundColor = "#FFFFFF";


  if (sender_email.value == "")
  {
   bledy += "* " + sender_email_txt + "!\n";
   sender_email.style.backgroundColor = "#FFB9B9";
  }
  else if (sender_email.value != "" && (sender_email.value.length < 4 || sender_email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* " + sender_email_err_txt + "!\n";
   sender_email.style.backgroundColor = "#FFB9B9";
  }
  else sender_email.style.backgroundColor = "#FFFFFF";


  if (sender_name.value == "")
  {
   bledy += "* " + sender_name_txt + "!\n";
   sender_name.style.backgroundColor = "#FFB9B9";
  }
  else sender_name.style.backgroundColor = "#FFFFFF";


  if (bledy != "") error(bledy);
 }
return !errfound;
}



//************************* PRESSROOM

function validate_pressroom_pl()
{
 errfound = false;
 var bledy = "";

 with(document.pressroom)
 {
  if (sender_name.value == "")
  {
   bledy += "* Podaj nazwę redakcji!\n";
   sender_name.style.backgroundColor = "#FFB9B9";
  }
  else sender_name.style.backgroundColor = "#FFFFFF";


  if (sender_email.value == "")
  {
   bledy += "* Podaj swój adres e-mail!\n";
   sender_email.style.backgroundColor = "#FFB9B9";
  }
  else if (sender_email.value != "" && (sender_email.value.length < 4 || sender_email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* Twój adres e-mail wydaje się być nieprawidłowy!\n";
   sender_email.style.backgroundColor = "#FFB9B9";
  }
  else sender_email.style.backgroundColor = "#FFFFFF";


  if (file_name.value == "")
  {
   bledy += "* Wybierz załącznik!\n";
   file_name.style.backgroundColor = "#FFB9B9";
  }
  else file_name.style.backgroundColor = "#FFFFFF";

  
  if (bledy != "") error(bledy);
 }
return !errfound;
}




//************************* SURVEYS

function validate_surveys(lang)
{
 errfound = false;
 var bledy = "";

 if (lang == "pl")
 {
  answer_txt = "Wpisz treść odpowiedzi";
  name_txt = "Podaj imię i nazwisko";
  email_txt = "Podaj swój adres e-mail";
  email_err_txt = "Twój adres e-mail wydaje się być nieprawidłowy";
  company_txt = "Podaj nazwę organizacji";
  accept_policy_txt = "Zaakceptuj politykę prywatności";
 }
 else
 {
  answer_txt = name_txt = email_txt = email_err_txt = company_txt = accept_policy_txt = "BRAK TŁUMACZENIA DLA JĘZYKA: " + lang;
 }



 with(document.surveys)
 {
  if (answer.value == "")
  {
   bledy += "* " + answer_txt + "!\n";
   answer.style.backgroundColor = "#FFB9B9";
  }
  else answer.style.backgroundColor = "#FFFFFF";


  if (name.value == "")
  {
   bledy += "* " + name_txt + "!\n";
   name.style.backgroundColor = "#FFB9B9";
  }
  else name.style.backgroundColor = "#FFFFFF";


  if (email.value == "")
  {
   bledy += "* " + email_txt + "!\n";
   email.style.backgroundColor = "#FFB9B9";
  }
  else if (email.value != "" && (email.value.length < 4 || email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* " + email_err_txt + "!\n";
   email.style.backgroundColor = "#FFB9B9";
  }
  else email.style.backgroundColor = "#FFFFFF";


  if (company.value == "")
  {
   bledy += "* " + company_txt + "!\n";
   company.style.backgroundColor = "#FFB9B9";
  }
  else company.style.backgroundColor = "#FFFFFF";


  if (accept_policy.checked == false)
  {
   bledy += "* " + accept_policy_txt + "!\n";
  }


  if (bledy != "") error(bledy);
 }
return !errfound;
}



//************************* REGISTER FORM

function validate_register_form(lang)
{
 errfound = false;
 var bledy = "";

 if (lang == "pl")
 {
  first_last_name_txt = "Podaj Imię i Nazwisko";
  phone_txt = "Podaj numer telefonu";
  email_txt = "Podaj adres e-mail";
  email_err_txt = "Twój adres e-mail wydaje się być nieprawidłowy";
  email_match_txt = "Podane adresy e-mail nie pasują do siebie";
  email_confirm_txt = "Potwierdź adres e-mail";
  password_txt = "Podaj hasło";
  password_confirm_txt = "Potwierdź hasło";
  password_match_txt = "Podane hasła nie pasują do siebie";
  company_txt = "Podaj nazwę firmy";
  type_of_business_txt = "Wybierz rodzaj działalności";
  nip_txt = "Podaj numer NIP";
  address_txt = "Podaj adres";
  zip_code_txt = "Podaj kod pocztowy";
  city_txt = "Podaj miejscowość";
  rules_txt = "Musisz zaakceptować warunki regulaminu";
 }
 else
 {
  first_last_name_txt = phone_txt = email_txt = email_err_txt = email_match_txt = email_confirm_txt = password_txt = password_confirm_txt = password_match_txt = company_txt = type_of_business_txt = nip_txt = address_txt = zip_code_txt = city_txt = rules_txt = "BRAK TŁUMACZENIA DLA JĘZYKA: " + lang;
 }



 with(document.register_form)
 {
  if (first_last_name.value == "")
  {
   bledy += "* " + first_last_name_txt + "!\n";
   first_last_name.style.backgroundColor = "#FFB9B9";
  }
  else first_last_name.style.backgroundColor = "#FFFFFF";


  if (phone.value == "")
  {
   bledy += "* " + phone_txt + "!\n";
   phone.style.backgroundColor = "#FFB9B9";
  }
  else phone.style.backgroundColor = "#FFFFFF";


  if (email.value == "")
  {
   bledy += "* " + email_txt + "!\n";
   email.style.backgroundColor = "#FFB9B9";
  }
  else if (email.value != "" && (email.value.length < 4 || email.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* " + email_err_txt + "!\n";
   email.style.backgroundColor = "#FFB9B9";
  }
  else email.style.backgroundColor = "#FFFFFF";


  if (email2.value == "")
  {
   bledy += "* " + email_confirm_txt + "!\n";
   email2.style.backgroundColor = "#FFB9B9";
  }
  else if (email2.value != "" && (email2.value.length < 4 || email2.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == null))
  {
   bledy += "* " + email_err_txt + "!\n";
   email2.style.backgroundColor = "#FFB9B9";
  }
  else email2.style.backgroundColor = "#FFFFFF";


  if (email.value != "" && email2.value != "" && email.value != email2.value)
  {
   bledy += "* " + email_match_txt + "!\n";
   email.style.backgroundColor = "#FFB9B9";
   email2.style.backgroundColor = "#FFB9B9";
  }
//  else email.style.backgroundColor = "#FFFFFF"; email2.style.backgroundColor = "#FFFFFF";


  if (pass1.value == "")
  {
   bledy += "* " + password_txt + "!\n";
   pass1.style.backgroundColor = "#FFB9B9";
  }
  else pass1.style.backgroundColor = "#FFFFFF";


  if (pass2.value == "")
  {
   bledy += "* " + password_confirm_txt + "!\n";
   pass2.style.backgroundColor = "#FFB9B9";
  }
  else pass2.style.backgroundColor = "#FFFFFF";


  if (pass1.value != "" && pass2.value != "" && pass1.value != pass2.value)
  {
   bledy += "* " + password_match_txt + "!\n";
   pass1.style.backgroundColor = "#FFB9B9";
   pass2.style.backgroundColor = "#FFB9B9";
  }
//  else pass1.style.backgroundColor = "#FFFFFF"; pass2.style.backgroundColor = "#FFFFFF";


  if (company.value == "")
  {
   bledy += "* " + company_txt + "!\n";
   company.style.backgroundColor = "#FFB9B9";
  }
  else company.style.backgroundColor = "#FFFFFF";


  if (type_of_business.value == "")
  {
   bledy += "* " + type_of_business_txt + "!\n";
   type_of_business.style.backgroundColor = "#FFB9B9";
  }
  else type_of_business.style.backgroundColor = "#FFFFFF";


  if (nip.value == "")
  {
   bledy += "* " + nip_txt + "!\n";
   nip.style.backgroundColor = "#FFB9B9";
  }
  else nip.style.backgroundColor = "#FFFFFF";


  if (address.value == "")
  {
   bledy += "* " + address_txt + "!\n";
   address.style.backgroundColor = "#FFB9B9";
  }
  else address.style.backgroundColor = "#FFFFFF";


  if (zip1.value == "" || zip2.value == "")
  {
   bledy += "* " + zip_code_txt + "!\n";
   zip1.style.backgroundColor = "#FFB9B9";
   zip2.style.backgroundColor = "#FFB9B9";
  }
  else zip1.style.backgroundColor = "#FFFFFF"; zip2.style.backgroundColor = "#FFFFFF";


  if (city.value == "")
  {
   bledy += "* " + city_txt + "!\n";
   city.style.backgroundColor = "#FFB9B9";
  }
  else city.style.backgroundColor = "#FFFFFF";


  if (rules.checked == false)
  {
   bledy += "* " + rules_txt + "!\n";
  }


  if (bledy != "") error(bledy);
 }
return !errfound;
}



//************************************************************************
//************************* GENERATOR LOSOWEGO HASŁA

function randomPassword(length)
{
 chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
 pass = "";

 for(x=0; x < length; x++)
 {
  i = Math.floor(Math.random() * 62);
  pass += chars.charAt(i);
 }

 document.getElementById("pass1").value = pass;
 document.getElementById("pass2").value = pass;
}



//************************************************************************
//************************* WALIDACJA ADRESU EMAIL

function clearField(fieldname)
{
 setStatus(fieldname, 'clear');

 if (fieldname == "name")
 {
  var button = document.getElementById('checkname');
  button.value = "Check Availability";
  button.disabled = '';
  button.style.display = '';
 }
}


function checkEmail(name) {
	var input = document.getElementById(name);
	if (name != "email1") {
		var first = document.getElementById("email1");
		if (first.value == input.value && input.value != null && input.value.length > 4 && input.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/))
			setStatus(name, 'good');
		else if (input.value.length <= 4)
			clearField(name);
		else setStatus(name, 'bad');
	} else {
		if (input.value != null && input.value.length > 4 && input.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/))
			setStatus(name, 'good');
		else if (input.value.length <= 4)
			clearField(name);
		else setStatus(name, 'bad');
	}
}


function checkPass(name) {
	var input = document.getElementById(name);
	if (name != "pass1") {
		var first = document.getElementById("pass1");
		if (first.value == input.value && input.value != null && input.value.length > 5)
			setStatus(name, 'good');
		else if (input.value.length < 1)
			clearField(name);
		else setStatus(name, 'bad');
	} else {
		if (input.value != null && input.value.length > 5)
			setStatus(name, 'good');
		else if (input.value.length < 1)
			clearField(name);
		else setStatus(name, 'bad');
	}
}


function setStatus(inputid, status) {
	var indicator = document.getElementById(inputid+'_status');
	if (indicator) {
		if (status == "good") {
			indicator.style.backgroundImage = "url('/gfx/layout/correct.gif')";
			}
	else if (status == "bad") {
	   indicator.style.backgroundImage = "url('/gfx/layout/incorrect.gif')";
	   }
	else {
	   indicator.style.backgroundImage = 'none';
	   }
	}
}

