var ie5=false;
var ns6=false;
var ns4=false;

if (document.getElementById && document.all) {ie5=true};
if (document.getElementById && !document.all) {ns6=true};
if (document.layers) {ns4=true};

function email(user) {
	full=user+'@infoplan.hu';
	document.write('<a href="mailto:'+full+'">'+full+'</a>');
}
function elink(user,name) {
	full=user+'@infoplan.hu';
	document.write('<a href="mailto:'+full+'">'+name+'</a>');
}

function searchClick(la,box) {
	switch (la) {
		case 'hu': defval='keresendő kifejezés';
		break;
	}
	if (box.value==defval) {
		box.value='';
	}
}
function searchBlur(la,box) {
	switch (la) {
		case 'hu': defval='keresendő kifejezés';
		break;
	}
	if (box.value=='') {
		box.value=defval;
	}
}

function referToFriend(la) {
	switch (la) {
		case 'hu': lang='hu';
		break;
	}
	refwin=window.open('refer.php?l='+la,'Ref','width=500,height=300');
}

function addToFav(la) { 
    switch (la) {
		case 'hu': title='Infoplan Mérnökiroda Kft.';
					msg='Nem támogatott böngésző - Kérjük használja a böngészője megfelelő funkcióját! Ctrl+D';
		break;
		case 'en':
					title='Infoplan Engineering Ltd.';
					msg='Non supported browser, please press Ctrl+D';
					break;
		case 'de': title='Infoplan Ingenierung GmbH.';
					msg='Bitte drucken Ctrl+D';
					break;
	}
	
	
	if (ie5) {
        // IE
        window.external.AddFavorite(top.location.href,title);
    } else if (window.sidebar) {
        // Mozilla & related
        window.sidebar.addPanel(name, location.href+'sidebar.html', "");
    } else {
        alert(msg);
    }
}


function gal(dir,l) {
	galwin=window.open('gallery.php?l='+l+'&dir='+dir,'Kepek','width=700,height=580');
}
