/*
    techTree
*/


function techChangeClass(check, id, class1, class2, sid, check_class){

  if ((!sid && !check_class) || (sid && check_class && document.getElementById(sid).className != check_class)){

  if (document.getElementById(id).className == class1) document.getElementById(id).className = class2;
    else
  if ((check && document.getElementById(id).className == class2) || !check) document.getElementById(id).className = class1;
  }
  

}

/**
 * @author Sławomir Kokłowski {@link http://www.kurshtml.boo.pl}
 * @copyright NIE usuwaj tego komentarza! (Do NOT remove this comment!)
 */

// Domyślny identyfikator IFRAME:
var autoiframe_id = 'autoiframe';
// Domyślny dolny margines:
var autoiframe_margin = 20;

var autoiframe_timer = null;
function autoiframe(id, margin)
{
	if (parent != self && document.body && document.body.offsetHeight && document.body.scrollHeight)
	{
		clearTimeout(autoiframe_timer)
		if (typeof id != 'undefined' && id) autoiframe_id = id;
		parent.document.getElementById(autoiframe_id).height = 600;
		autoiframe_timer = setTimeout("parent.document.getElementById(autoiframe_id).height = Math.max(document.body.offsetHeight, document.body.scrollHeight) + " + (typeof margin == 'undefined' || isNaN(parseInt(margin)) ? autoiframe_margin : parseInt(margin)), 1);
	}
}

if (window.addEventListener) window.addEventListener('load', function() { autoiframe(); }, false);
else if (window.attachEvent) window.attachEvent('onload', function() { autoiframe(); });

function autoiframeinside(id, margin)
{
	if (parent != self && document.body && document.body.offsetHeight && document.body.scrollHeight)
	{
		clearTimeout(autoiframe_timer)
		if (typeof id != 'undefined' && id) autoiframe_id = id;
		parent.document.getElementById(autoiframe_id).height = 600;
		
		autoiframe_timer = setTimeout("parent.document.getElementById(autoiframe_id).height = Math.max(document.body.offsetHeight, document.body.scrollHeight) + " + (typeof margin == 'undefined' || isNaN(parseInt(margin)) ? autoiframe_margin : parseInt(margin)), 1);
	}
}


function ActivatePage(page) {
    var i;
    // Zamykanie zakładek
    for (i=0; i<10; i++){
      if (document.getElementById('tab'+i))
        document.getElementById('tab'+i).className = 'tabhidden';

    if (document.getElementById('tab'+page)){
      document.getElementById('tab'+page).className = 'tabvisible';
    }

    }
    
    if (top) autoiframeinside();
  }
