/////////////////////////////////////////////////////////////////////////
//                                                                     //
//  This script is copyright n-e-s.info. You are forbidden to use it!  //
//                                                                     //
/////////////////////////////////////////////////////////////////////////

function showcmd(command)
{
	document.getElementById("cmdElm").style.display = 'block';
	document.getElementById("cmdElm").innerHTML = '<span style="color:#fff">Command:</span> ' + command;
}

function cmdresult(command)
{
	document.getElementById("resultElm").style.display = 'block';
	switch(command)
	{
		case "about":
		document.getElementById("resultElm").innerHTML = '\n<p>Hi! I\'m NeS</a>. My name is <a href="http://www.facebook.com/sergiu.negara" target="blank">Sergiu Negara</a>.</p>\n<p>Student at the Technical University of Moldova</p>\n<p>Web developer</p>\n<p>Trance music addict</p>\n<p>Photographer</p>\n<p>Linux user</p>\n<p>etc.</p>\n<p>Not enough so far? Feel free to <a href="javascript:cmd(\'contact\');">ask me</a> ;)</p>\n';
		break;
		case "links":
		document.getElementById("resultElm").innerHTML = '\n<p>Here are some useful links:</p>\n<ul>\n<p>My accounts:</p>\n<ul>\n<a href="http://www.linkedin.com/in/sergiunegara" target="_blank">linkedin.com</a><br>\n<a href="http://www.facebook.com/sergiu.negara" target="_blank">facebook.com</a><br>\n<a href="http://twitter.com/SergiuNegara" target="_blank">twitter.com</a><br>\n<a href="http://www.flickr.com/people/n-e-s" target="_blank">flickr.com</a><br>\n<a href="http://www.youtube.com/user/MrSergiuNegara" target="_blank">youtube.com</a><br>\n<a href="http://vimeo.com/sergiu" target="_blank">vimeo.com</a><br>\n<a href="http://www.last.fm/user/Sergiulica" target="_blank">last.fm</a>\n</ul>\n</ul>\n<p>to be updated...</p>\n';
		break;
		case "contact":
		document.getElementById("resultElm").innerHTML = '\n<a href="http://twitter.com/SergiuNegara/" target="_blank">follow me on twitter</a><br>\n<a href="mailto:contact@n-e-s.info">write me a mail</a><br>\n<p>Call me:\n<ul>\nMobile: +373/79/244943<br>\nSkype: <a href="skype:negara.sergiu?call">negara.sergiu</a>\n</ul>\n</p>\n';
		break;
		case "refresh":
		document.getElementById("resultElm").innerHTML = '\n<p>refreshing in 2 seconds...</p>\n';
		break;
		case "exit":
		document.getElementById("resultElm").innerHTML = '\n<p>redirecting in 2 seconds...</p>\n';
		break;
		default:
		document.getElementById("resultElm").innerHTML = '\n<p>Sorry, the command returned an erroneous result.</p>\n';
	}
}

function cmd(command)
{
	switch(command)
	{
		case 'about':
		showcmd(command);
		cmdresult(command);
		break;
		case "links":
		showcmd("links");
		cmdresult(command);
		break;
		case "contact":
		showcmd("contact");
		cmdresult(command);
		break;
		case "refresh":
		showcmd("refresh");
		cmdresult(command);
		setTimeout('window.location="./"',2000);
		break;
		case "exit":
		showcmd("exit");
		cmdresult(command);
		setTimeout('window.location="about:blank"',2000);
		break;
		default:
		alert("This command does not exist");
	}
}

