/* WT-Frontend v1.2 by Martin Nielsen http://jirc.webt.dk
No need to change anything in this file
*/

away = 'no';

function setmsg (type) {
	msg = prompt("Enter your "+ type +" here:", "");
	if (msg != null) { return msg; }
	else { return false; }
}

function actmsg (type) {
	msg = prompt("Enter an action here:", "");
	if (msg != null) { return msg; }
	else { return ''; }
}

function jpilot(type,action) {
	if (type == 'sclear') { document.jchat.processJInput('/clear '); }
/*	if (type == 'time') { document.jchat.processJInput('/ctcp %$HN time'); }	
	if (type == 'version') { document.jchat.processJInput('/ctcp %$HN version'); }
	if (type == 'whois') { document.jchat.processJInput('/whois %$HN '); }
	if (type == 'ping') { document.jchat.processJInput('/ctcp %$HN ping'); }
*/
	     if (type=='ignorepm') { document.jchat.processJinput('/silence +* ');}
	     if (type == 'ignore') { document.jchat.processJInput('/ignore  %$HN '); }
	if (type == 'viewprofile') { document.jchat.processJInput('/showprofile %$HN '); }
           if (type == 'sendfile') { document.jchat.processJInput('/dccsend %$HN '); }
	      if (type == 'Greet') { document.jchat.processJInput('13,9งงงงงงงงงงง9,13 %$HN 13,9งงงงงงงงง'); }
	      if (type == 'curly') { document.jchat.processJInput('8,2  (ฏ`ท.ธธ.ทดฏ`ท.ธธ.->12,2  %$HN 8,2 <-.ธธ.ทดฏ`ท.ธธ.ทดฏ) '); }
	    if (type =='1001000S') { document.jchat.processJinput('/me chucks 100s and 1,000s everywhere 4 3 2 13 12 7 9 10 3 9 1 10 6 8 3 11 4 3 0 13 12 6 8 7 6 12 2 13 12 7 3'); }
	       if (type =='river') { document.jchat.processjinput('/me tosses %$HN in da river ธ.ทดฏ`ท.ธ.ทดฏ`ท.ธธ.ทดฏ`ท.ธ ><((((บ>  %$HN <บ))))><'); }
	if (type == 'opmode') {
		document.jchat.processJInput('/mode %$C '+ action +' %$HN ');
	}
	if (type == 'cmode') {
		document.jchat.processJInput('/mode %$C '+ action );
	}
	
	if (type == 'kick') {
		 kickmsg = 'we kick we score - cya'; 
	         document.jchat.processJInput('/kick %$C %$HN '+ kickmsg);
	}
	if (type == 'kickban') {
		kickmsg = setmsg('kick');
		if (kickmsg != false) {
			document.jchat.processJInput('/mode %$C +b %$HN ');
			document.jchat.processJInput('/kick %$C %$HN '+ kickmsg);
		}
	}
	if (type == 'away') {
		if (away == 'yes') { action = 'back' }
		if (away == 'no') { action = 'away' }
		if (action == 'away') {
			awaymsg = setmsg('away message');
			if (awaymsg != false) {
				document.jchat.processJInput('/away ' + awaymsg);
				document.jchat.processJInput('/me is AWAY \('+awaymsg+'\).');
				away = 'yes';
				/* document.away.src=away_2.src */
			}
		}
			else {
				document.jchat.processJInput('/away');
				document.jchat.processJInput('/me is BACK from being AWAY \('+awaymsg+'\).');
				away = 'no';
				/* document.away.src=away_1.src */
			}
		}

if (type == 'TEEGEE_CHAT') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #TEEGEE_CHAT');
     document.jchat.processJinput('/clear ');
}

if (type == '20Plus') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #20Plus');
     document.jchat.processJinput('/clear ');
}
if (type == '30Plus') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #30Plus');
     document.jchat.processJinput('/clear ');
}
if (type == '40Plus') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #40Plus');
     document.jchat.processJinput('/clear ');
}
if (type == '50Plus') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #50Plus');
     document.jchat.processJinput('/clear ');
}
if (type == '60Plus') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #60Plus');
     document.jchat.processJinput('/clear ');
}
if (type == 'Adelaide_City_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Adelaide_City_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'B9Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #B9Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'Bedroom_Fun4Adults') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Bedroom_Fun4Adults');
     document.jchat.processJinput('/clear ');
}
if (type == 'Blush') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Blush');
     document.jchat.processJinput('/clear ');
}
if (type == 'Brisbane_City_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Brisbane_City_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'Darwin_City_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Darwin_City_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'Herword') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Herword');
     document.jchat.processJinput('/clear ');
}
if (type == 'Hobart_City_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Hobart_City_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'InfoDesk') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #InfoDesk');
     document.jchat.processJinput('/clear ');
}
if (type == 'KidzClub') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #KidzClub');
     document.jchat.processJinput('/clear ');
}
if (type == 'LoungeBar') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #LoungeBar');
     document.jchat.processJinput('/clear ');
}
if (type == 'ManTalk') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #ManTalk');
     document.jchat.processJinput('/clear ');
}
if (type == 'Melbourne_City_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Melbourne_City_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'Perth_City_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Perth_City_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'Pit_Lane') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Pit_Lane');
     document.jchat.processJinput('/clear ');
}
if (type == 'PrideZone') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #PrideZone');
     document.jchat.processJinput('/clear ');
}
if (type == 'Queensland_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Queensland_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'Rave') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Rave');
     document.jchat.processJinput('/clear ');
}
if (type == 'Sidewalkcafe') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Sidewalkcafe');
     document.jchat.processJinput('/clear ');
}
if (type == 'SuperTrivia') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #SuperTrivia');
     document.jchat.processJinput('/clear ');
}
if (type == 'Sydney_City_Chat') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #Sydney_City_Chat');
     document.jchat.processJinput('/clear ');
}
if (type == 'TheBasement') {
     document.jchat.processJInput('/part %$C ');
     document.jchat.processJInput('/Join #TheBasement');
     document.jchat.processJinput('/clear ');
}


}