//var name='funta';
//var title='Funta';

function dummy() {
	return false;
}

function changeLanguage() {
	var display=document.getElementById('layer_language');
	if(display.style.display=='block') display.style.display='none';
	else {
		display.style.display='block';
	}
	
	return false;
}

function setFindFocus() {
	document.find_form.query.focus();
}
function setFindCategory(category) {
	document.find_form.category.value=category;

	setFindFocus();
}
function setFindLanguage(language) {
	if(language==null || language!='null') document.find_form.findlang[0].checked=true;
	else document.find_form.findlang[1].checked=true;
}

function picture_open(img) {
	var win=window.open(img,'img','dependent=yes, hotkeys=no, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, toolbar=no');
	win.document.write('<html><head><title>'+title+'</title></head>');
	win.document.write('<body><a href="#" onclick="window.close()" style="text-decoration: none">');
	win.document.write('<img src="'+img+'" alt=""/>');

	//set position
	win.moveTo(0,0);
	
	//resize
	var i=0;
	if(navigator.appName=='Netscape') i=40;
	if(win.document.images[0]) win.resizeTo(win.document.images[0].width +20, win.document.images[0].height+100-i);

	win.document.write('</a></body>');

	win.focus();
	
	return false;
}

function createXHR() {
	var xhr=null;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		xhr=new XMLHttpRequest();
		//if (xhr.overrideMimeType) xhr.overrideMimeType('text/xml');
  	} else if (window.ActiveXObject) { // IE
		try {
			xhr=new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e) {
			try {
				xhr=new ActiveXObject('Microsoft.XMLHTTP');
			} catch (e) {
				xhr=null;
			}
		}
	}
	if(xhr==null) alert('Your browser doesn\'t support Ajax!');
	
	return xhr;
}


function bookmark(url, title) {
  if ((typeof window.sidebar=='object') && (typeof window.sidebar.addPanel=='function')) {
    if (window.location.protocol!='file:') window.sidebar.addPanel(title,url,'');
  } else {
	  if ((typeof window.external=='object') && (typeof window.external.AddFavorite!='undefined')) {
		window.external.AddFavorite(url,title);
	  } else {
    	alert('Your browser doesn\'t support this function');
	  }
  }
}


