function ww (t,k) {
	o = document.getElementById(t);
	o.innerHTML = k;
	if(o.style.display == "none") {o.style.display = "block";}
}

function SetCookie(cookie, str) {
	document.cookie = cookie+"="+escape(str)+"; path=/; expires=Fri, 01-Jan-2010 00:00:00 GMT";
}

function GetCookie(cookie) {
	var i1 = document.cookie.indexOf(cookie+"=");
	if(i1<0) return "";
	i1 += cookie.length+1;
	var i2 = document.cookie.indexOf(";", i1);
	if(i2<0) i2 = document.cookie.length;
	return unescape(document.cookie.substring(i1, i2));
}

function GetNick () {
	var n=GetCookie("selected_nick")||GetCookie("detected_nick")||"";
	return n;
}

var nick="";
//nick=GetNick();

function detect_DoFSCommand(command, args) {
	if (command == "OK")  {
		var oldnick = GetCookie("detected_nick");
		var t = args.split("\t");
		SetCookie("detected_nick",t[0]);
		nick=GetNick();
		if(GetCookie("selected_nick")=="" && oldnick!="" && oldnick!=t[0]){
			AskSelectPers(oldnick,t[0]);
		}
	}
}
if (navigator.appName.indexOf("Microsoft") != -1) {// Hook for Internet Explorer.
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub detect_FSCommand(ByVal command, ByVal args)\n');
	document.write('Call detect_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

/* MENU */
function HideMenuDropdown(){
	$('#menu-more-dropdown').hide();
}
function ShowMenuMore(){
	var dd = $('#menu-more-dropdown');
	if(dd.is(':visible')){
		dd.hide(1,function(){
			$(document).unbind('click',HideMenuDropdown);
		});
	} else {
		dd.show(1,function(){
			$(document).bind('click',HideMenuDropdown);
		});
	}
}

/* GALLERY */
function HideLinkHere(event){
	if(!(event.target.className == 'linkhere-block' || $(event.target).parent('div.linkhere-block').get(0))){
		$('div.linkhere-block').hide();
	}
}
function ShowLinkHere(){
	var dd = $('div.linkhere-block');
	if(dd.is(':visible')){
		dd.hide(1,function(){
			$(document).unbind('click',HideLinkHere);
		});
	} else {
		dd.show('fast',function(){
			$(document).bind('click',HideLinkHere);
			//alert(document.location.href);
			$('#linkhereinput')[0].value = document.location.href;
			$('#linkhereinput').select();
		});
	}
}

