/*******************************************************************************************************
**  Mighty projekt javascript fájl / Poject Mighty's javascript file  *******************  200?.??.??  *
********************************************************************************************************
**                                                                                                     *
**  Írta és rendezte/made by: Bagaméri Béla                                                            *
**                     email: damien at hck.hu                                                         *
**         befejezve/fnished:                                                                          *
**                                                                                                     *
**  Ha valahol használtad ezt a kis scriptet kérlek dobj meg egy mailel hogy büszke lehessek magamra.  *
**  Köszönöm!                                                                                          *
**                                                                                                     *
********************************************************************************************************
**  If you have used this script in a project, please send a message.                                  *
**  Thanks                                                                                             *
********************************************************************************************************
**  Special thanks for:                                                                                *
**      - the guy who write the DOM onLoad function                                                    *
*******************************************************************************************************/


// Create event 'ondomload' which runs once when the dom of the document
//  has loaded. This is before images and other long downloads start.
//  If the browser does not support this, falls back to window.onload.
//  (Firefox and Opera)
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", onDOMContentLoaded, false);
}

//  (Safari)
if (/WebKit/i.test(navigator.userAgent)) { // sniff
	var _timer = setInterval(function() {
		if (/loaded|complete/.test(document.readyState)) {
			clearInterval(_timer);
			onDOMContentLoaded(); // call the onload handler
		}
	}, 10);
}
//  (Internet Explorer (using conditional comments))
/*@cc_on @*/
/*@if (@_win32)
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
	if (this.readyState == "complete") {
		onDOMContentLoaded(); // call the onload handler
	}
};
/*@end @*/
window.onload = onDOMContentLoaded;
function onDOMContentLoaded(){
	// quit if this function has already been called
	if (arguments.callee.done) return;
	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;
	ondomload();
}



function mighty()
{}

mighty.prototype.inits  = new Array();

mighty.prototype.init = function (method_name)
{
  var len = this.inits.length;
  this.inits[len]=method_name;
}

mighty.prototype.initAll = function ()
{
  var len = this.inits.length;
  for(var i=0; i<len; i++)
  {
    window[this.inits[i]]();
  }
}

var mighty = new mighty();

//Event.observe(window, 'load', mighty.initAll.bind(mighty));

window.ondomload = mighty.initAll.bind(mighty);

/***********************************************************************************************************/

mighty.init("ViewDesc");

function ViewDesc() {
     $$(".viewdesc").each(function(element){
          element.observe("click", function(event){
               if(Event.element(event).next(0).style.display!="block")
                    Event.element(event).next(0).style.display="block";
               else
                    Event.element(event).next(0).style.display="none";
          });
     });
}

