function createCookie(b,e,c){if(c){var d=new Date;d.setTime(d.getTime()+c*24*60*60*1000);c="; expires="+d.toGMTString()}else c="";document.cookie=b+"="+e+c+"; path=/"}function readCookie(b){b=b+"=";for(var e=document.cookie.split(";"),c=0;c<e.length;c++){for(var d=e[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(b)==0)return d.substring(b.length,d.length)}return null}function eraseCookie(b){createCookie(b,"",-1)} function getElementsByNames(b,e){b=document.getElementsByTagName(b);var c=[];for(iarr=i=0;i<b.length;i++){att=b[i].getAttribute("name");if(att==e){c[iarr]=b[i];iarr++}}return c} function initLanguage(){var b=location.href,e=[];b.split("#");e=b.indexOf("/eng/");b=b.indexOf("/english/");b=getElementsByNames("div","eng");e=getElementsByNames("div","rom");var c=getElementsByNames("div","engmore"),d=getElementsByNames("div","rommore"),f=getElementsByNames("div","romban"),g=getElementsByNames("div","romrol"),h=getElementsByNames("a","displang");lang=readCookie("lang");if(lang=="ro")for(var a in b){if(b[a]!=null)b[a].style.display="none";if(c[a]!=null)c[a].style.display="none"; if(e[a]!=null)e[a].style.display="block";if(d[a]!=null)d[a].style.display="block";if(f[a]!=null)f[a].style.display="block";if(g[a]!=null)g[a].style.display="block";h[a].innerHTML="[English] <img src='http://www.muza-chan.net/japan/rsc/icons/en.png' alt='English' />"}else for(a in b){if(e[a]!=null)e[a].style.display="none";if(d[a]!=null)d[a].style.display="none";if(f[a]!=null)f[a].style.display="none";if(g[a]!=null)g[a].style.display="none";if(b[a]!=null)b[a].style.display="block"; if(c[a]!=null)c[a].style.display="block";h[a].innerHTML="[Rom\u00e2n&#259;] <img src='http://www.muza-chan.net/japan/rsc/icons/ro.png' alt='Romana' />"}} function togglelang(){var b=getElementsByNames("div","eng"),e=getElementsByNames("div","rom"),c=getElementsByNames("div","engmore"),d=getElementsByNames("div","rommore"),f=getElementsByNames("div","romban"),g=getElementsByNames("div","romrol"),h=getElementsByNames("a","displang");for(var a in b)if(b[a]!=null)if(b[a].style.display=="block"){createCookie("lang","ro",30);if(b[a]!=null)b[a].style.display="none";if(c[a]!=null)c[a].style.display="none";if(e[a]!=null)e[a].style.display="block";if(d[a]!= null)d[a].style.display="block";if(f[a]!=null)f[a].style.display="block";if(g[a]!=null)g[a].style.display="block";h[a].innerHTML="[English] <img src='http://www.muza-chan.net/japan/rsc/icons/en.png' alt='English' />"}else{createCookie("lang","en",30);if(e[a]!=null)e[a].style.display="none";if(d[a]!=null)d[a].style.display="none";if(f[a]!=null)f[a].style.display="none";if(g[a]!=null)g[a].style.display="none";if(b[a]!=null)b[a].style.display="block";if(c[a]!=null)c[a].style.display= "block";h[a].innerHTML="[Rom\u00e2n&#259;] <img src='http://www.muza-chan.net/japan/rsc/icons/ro.png' alt='Romana' />"}};
/**
 * Original Source: Book: DHTML Utopia: Modern Web Design Using JavaScript & DOM
 * Also: http://www.sitepoint.com/article/dhtml-utopia-modern-web-design/2
 */

/**
 * Automagically set up rollover event handlers for all IMGs within links with the rollover class
 *
 * This is executed once after page load
 *
 * @todo preload rollover images?
 */
function setupRollovers()
{
	if(!document.getElementsByTagName)
	{ // We are NOT in a DOM-supporting browser:
		return;
	}

	// Get ALL the links in the current document:
	var all_links = document.getElementsByTagName('a');

	// Go through all the links:
	for(var i = 0; i < all_links.length; i++)
	{
		var link = all_links[i];
		if(link.className && (' ' + link.className + ' ').indexOf(' rollover ') != -1)
		{ // The link has the rollover class (among potentially other classes):
			// Set up event handlers:
			link.onmouseover = mouseover;
			link.onmouseout = mouseout;
		}
	}
}


/**
 * caters for the differences between Internet Explorer and fully DOM-supporting browsers
 */
function findTarget(e)
{
 var target;

 if (window.event && window.event.srcElement)
   target = window.event.srcElement;
 else if (e && e.target)
   target = e.target;
 if (!target)
   return null;

 while (target != document.body &&
     target.nodeName.toLowerCase() != 'a')
   target = target.parentNode;

 if (target.nodeName.toLowerCase() != 'a')
   return null;

 return target;
}


/**
 * MouseOver event handler
 */
function mouseover(e)
{
	var target = findTarget(e);
	if (!target) return;

	var img_tag = target.childNodes[0];
	if( img_tag.nodeName.toLowerCase() != 'img')
	{
		img_tag = target.childNodes[1];
	}

	// Take the "src", which names an image called "something.ext",
	// Make it point to "something_over.ext"
	img_tag.src = img_tag.src.replace(/(\.[^.]+)$/, '_over$1');
}


/**
 * MouseOut event handler
 */
function mouseout(e)
{
 var target = findTarget(e);
 if (!target) return;

	var img_tag = target.childNodes[0];
	if( img_tag.nodeName.toLowerCase() != 'img')
	{
		img_tag = target.childNodes[1];
	}

 // Take the "src", which names an image as "something_over.ext",
 // Make it point to "something.ext"
 img_tag.src = img_tag.src.replace(/_over(\.[^.]+)$/, '$1');
}


/**
 * When the page loads, set up the rollovers
 */
addEvent( window, 'load', setupRollovers, false );
function addEvent(a,b,c,d){if(a.addEventListener){a.addEventListener(b,c,d);return true}else if(a.attachEvent)return a=a.attachEvent("on"+b,c);else{a["on"+b]=c;return false}}function setstatus(a){window.status=a;return true}function resetstatus(){window.status="Done"} function pop_up_window(a,b,c,d,e){if(typeof c=="undefined")c=750;if(typeof d=="undefined")d=550;var f=(screen.width-c)/2,g=(screen.height-d)/2;if(typeof e=="undefined")e="scrollbars=yes, status=yes, resizable=yes, menubar=yes";e="width="+c+", height="+d+", left="+f+", top="+g+", "+e;opened=window.open(a,b,e);opened.focus();if(typeof openedWindows=="undefined")openedWindows=new Array(opened);else openedWindows.push(opened);return false} function toggle_display_by_id(a,b,c,d){if(document.getElementById(b).style.display==""){document.getElementById(a).innerHTML=d;document.getElementById(b).style.display="none"}else{document.getElementById(a).innerHTML=c;document.getElementById(b).style.display=""}return false} function toggle_clickopen(a,b,c){if(!(clickdiv=document.getElementById("clickdiv_"+a))||!(clickimg=document.getElementById("clickimg_"+a))){alert("ID "+a+" not found!");return false}if(typeof b=="undefined")b=document.getElementById("clickdiv_"+a).style.display!="none";if(typeof c=="undefined")c="";if(b){clickdiv.style.display="none";clickimg.src=imgpath_expand}else{clickdiv.style.display=c;clickimg.src=imgpath_collapse}return false} function textarea_replace_selection(a,b,c){textarea_wrap_selection(a,b,"",1,c)} function textarea_wrap_selection(a,b,c,d,e){e=e||document;var f={element:a,before:b,after:c,replace:d,target_document:e};if(!b2evo_Callbacks.trigger_callback("wrap_selection_for_"+a.id,f)){if(window.opener&&window.opener.b2evo_Callbacks&&typeof window.opener.b2evo_Callbacks!="undefined")if(window.opener.b2evo_Callbacks.trigger_callback("wrap_selection_for_"+a.id,f))return;if(e.selection){a.focus();sel=e.selection.createRange();sel.text=d?b+c:b+sel.text+c;a.focus()}else if(a.selectionStart||a.selectionStart== "0"){e=a.selectionStart;f=a.selectionEnd;var g,h;if(a.type=="textarea"&&typeof a.scrollTop!="undefined"){g=a.scrollTop;h=a.scrollLeft}if(d){a.value=a.value.substring(0,e)+b+c+a.value.substring(f,a.value.length);b=e+b.length+c.length}else{a.value=a.value.substring(0,e)+b+a.value.substring(e,f)+c+a.value.substring(f,a.value.length);b=f+b.length+c.length}if(typeof g!="undefined"){a.scrollTop=g;a.scrollLeft=h}a.focus();a.selectionStart=b;a.selectionEnd=b}else{a.value+=b+c;a.focus()}}} function toggle_filter_area(a){if(!(clickdiv=document.getElementById("clickdiv_"+a))||!(clickimg=document.getElementById("clickimg_"+a))){alert("ID "+a+" not found!");return false}if(hide=document.getElementById("clickdiv_"+a).style.display!="none"){clickdiv.style.display="none";clickimg.src=imgpath_expand;asyncRequest(htsrv_url+"async.php?collapse="+a)}else{clickdiv.style.display="block";clickimg.src=imgpath_collapse;asyncRequest(htsrv_url+"async.php?expand="+a)}return false} function asyncRequest(a){if(window.XMLHttpRequest)req=new XMLHttpRequest;else if(window.ActiveXObject)req=new ActiveXObject("Microsoft.XMLHTTP");if(req){swapSection("...");req.onreadystatechange=asyncResponseHandler;req.open("GET",a,true);req.setRequestHeader("content-type","application/x-www-form-urlencoded");req.send("dummy")}else swapSection("Your browser does not seem to support XMLHttpRequest.");return false} function asyncResponseHandler(){if(req.readyState==4)req.status==200?swapSection(req.responseText):swapSection("There was a problem retrieving the XML data:\n"+req.statusText)}function swapSection(a){var b=document.getElementById("asyncResponse");if(b)b.innerHTML=a}function b2evo_Callbacks(){this.eventHandlers=[]} b2evo_Callbacks.prototype={register_callback:function(a,b){if(typeof this.eventHandlers[a]=="undefined")this.eventHandlers[a]=[];this.eventHandlers[a][this.eventHandlers[a].length]=b},trigger_callback:function(a){if(typeof this.eventHandlers[a]=="undefined")return null;for(var b=false,c="",d=1;d<arguments.length;d++)c+="cb_arguments["+d+"], ";if(c.length)c=c.substring(0,c.length-2);for(d=0;d<this.eventHandlers[a].length;d++)b=eval("f("+c+");")||b;return b}};b2evo_Callbacks=new b2evo_Callbacks;