function show_info_btn(nr, on) {
	
  // btn
  var b_a = document.getElementById("t"+nr+"_btn_a");
  var b_b = document.getElementById("t"+nr+"_btn_b");
  var b_c = document.getElementById("t"+nr+"_btn_c");

  // div content
  var c = document.getElementById("t"+nr+"_content");
  
  if (getInternetExplorerVersion() > -1) var class_name = 'className'; else var class_name = 'class'; // id IE

  if (on == 'on') {
	  b_a.setAttribute(class_name, "t1_l");
	  b_b.setAttribute(class_name, "t1_lnk");
	  b_c.setAttribute(class_name, "t1_r");

 	  c.setAttribute(class_name, "t_content_on"); // content
  }
  else
  {
	  b_a.setAttribute(class_name, "t2_l");
	  b_b.setAttribute(class_name, "t2_lnk");
	  b_c.setAttribute(class_name, "t2_r");
	  
 	  c.setAttribute(class_name, "t_content_off"); // content
  }

  if (on == 'on') {
    if (nr != '1') show_info_btn('1', 'off'); 
    if (nr != '2') show_info_btn('2', 'off'); 
    if (nr != '3') show_info_btn('3', 'off');
  }
}



function getInternetExplorerVersion() {
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}


function stripslashes(str) {
str=str.replace(/\\'/g,'\'');
str=str.replace(/\\"/g,'"');
str=str.replace(/\\0/g,'\0');
str=str.replace(/\\\\/g,'\\');
return str;
}

function star(no) {
  var i=1;
  for (i=1; i <=5; i++) {
	  if (no >= i) document.getElementById("star_"+i).src = '/images/star_on.gif'; else document.getElementById("star_"+i).src = '/images/star_off.gif';
  }
}

function write_stars(program_name, stars) { // write stars images
  var s = '';
  var gif = '';
  for (i=1; i <=5; i++) {
	if (i <= stars) gif = 'on'; else gif = 'off'; // img name (on|off)
    s = s + '<img id="star_'+i+'" src="/images/star_'+gif+'.gif" align="absmiddle" onmouseover="star('+i+')" onmouseout="star('+stars+')" onclick="star_msg(\''+program_name+'\');">';
  }
  document.write(s+'<span class="blue_lnk">Rate it!</span>');
}

function star_msg(s) {
	alert('You Rate '+s+'!\nThank you for your vote');
}

function preload_images() {
	pi = new Image(23,21);
	pi.src="/images/star_off.gif";
}
