var t="";
var n="";
var c="";
var vText4=-1;
var tread;
var ot;
var nt;
var Dl;
var t0;
var t1;
var t2;
var ot4="-1";
var vS=-1;
var vE=-1;
var vEL=-1;
var vLS=-1;
var vLE=-1;
var fname;
var str;
var oA;
var vHold="";
var vW=new Array();
var vTextColor= new Array();
var vTextColorM=0;
var vTextColorN=1;
var vInterval=3000;
var oThread="";
var vDataT=new Array();
var vDataH=new Array();
var vDataC=0;
var vSearching=0;
var ovDataC=0
var n="";
var vMenu=1;
var vCMenu="";
var vThreadCount=0;
var vThreadHistory = new Array();
var vDataCount=-1;
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#FFFFFF";
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#FF0000";
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#C0C0C0";
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#FFFF00";
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#FF00FF"
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#00FF00"
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#00FFFF"
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#ECE9D8"
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#FF9900"
vTextColorM=vTextColorM+1;vTextColor[vTextColorM]="#FF00FF"
var vFont=vTextColor[1];
var vMP3File="";
var vMP3=0;
var vLastThread="";
var vNewMessage=0;
var ovHold="";
var vWC=0;	
var vWS="";	
var vMatch="";
var tmp="";
var xmlHTPP=false;
var vDeleteName="";
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlHTPP = new ActiveXObject("Msxml2.XMLHTTP");
  //alert("try 1")
 } catch (e) {
  try {
   xmlHTPP = new ActiveXObject("Microsoft.XMLHTTP");
  //alert("try 2")   
  } catch (E) {
   xmlHTPP = false;
     alert("Sorry you browser does not support streaming data!")
  }
 }
@end @*/
if (!xmlHTPP && typeof XMLHttpRequest!='undefined') {
	try {
		xmlHTPP = new XMLHttpRequest();
	} catch (e) {
		xmlHTPP=false;
	}
}
if (!xmlHTPP && window.createRequest) {
	try {
		xmlHTPP = window.createRequest();
	} catch (e) {
		xmlHTPP=false;
	}
}
var txtFile = xmlHTPP;

function fOpenMessageWindow() {
	
	try {
		OpenWindow=window.open("","newwindow","height=480, width=640,toolbar=yes,scrollbars=yes,menubar=yes;z-order=-1");
		//OpenWindow.document.write("<img src="file:///C:/Documents%20and%20Settings/John%20Turcott/My%20Documents/My%20Webs/%20+%20T1.value%20+">");
		OpenWindow.document.write("<font face=verdana size=2>");
		OpenWindow.document.write("<b>Name : " + Text0.value + " Thread : " + Text2.value + " Area : " + Text3.value + " Password : " + tPW.value + "</b><br><br>")
		for (i=vDataC;i>1;i=i-1) {
			OpenWindow.document.write(vDataT[i] + "<br>")
		}
		OpenWindow.document.write("<br>")
		OpenWindow.document.write("</font>")		
		OpenWindow.document.close();
	} catch (err) {
	}	
}


function fParticipense(){

	vWC=0;
	vWS="";
	var vM=""
	tmp="";
	var vIn="";
	var ovJunk=""	
	var vJunk=""
	
	for (i=1;i<vDataC+1;i=i+1){

		if (vDataH[i].indexOf("[")>-1 && vDataH[i].indexOf("]")>-1) {

			tmp=vDataH[i].slice(vDataH[i].lastIndexOf("["),vDataH[i].lastIndexOf("]")+1)

			if (vJunk.indexOf(tmp)==-1) {
			
				vJunk=vJunk + tmp + " "

				vWC=vWC+1;
				
				vW[vWC]=tmp;
				
			switch(vWC) {
			
				case 1:
					document.all.dSubMenu.innerHTML="Participense"				
					document.all.dOption1.innerHTML=tmp
					break;
				case 2:
					document.all.dOption2.innerHTML=tmp
					break;
				case 3:
					document.all.dOption3.innerHTML=tmp
					break;
				case 4:
					document.all.dOption4.innerHTML=tmp
					break;
				case 5:
					document.all.dOption5.innerHTML=tmp
					break;
				case 6:
					document.all.dOption6.innerHTML=tmp
					break;
				case 7:
					document.all.dOption7.innerHTML=tmp
					break;
				case 8:
					document.all.dOption8.innerHTML=tmp
					break;
				case 9:
					document.all.dOption9.innerHTML=tmp
					break;
				case 10:
					document.all.dOption10.innerHTML=tmp
					break;
				case 11:
					document.all.dOption11.innerHTML=tmp
					break;
				case 12:
					document.all.dOption12.innerHTML=tmp
					break;
				case 13:
					document.all.dOption13.innerHTML=tmp
					break;
				case 14:
					document.all.dOption14.innerHTML=tmp
					break;
				case 15:
					document.all.dOption15.innerHTML=tmp
					break;
				case 16:
					document.all.dOption16.innerHTML=tmp
					break;
				case 17:
					document.all.dOption17.innerHTML=tmp
					break;
				case 18:
					document.all.dOption18.innerHTML=tmp
					break;
				case 19:
					document.all.dOption19.innerHTML=tmp
					break;
				case 20:
					document.all.dOption20.innerHTML=tmp
					break;
					
				default:
				
			}  // switch
			} // if vM==0
		} // if
	} //for
}

function fHome(){
	document.all.Text1.value="Lobby";
	document.all.Text2.value="Main";
	document.all.tPW.value="Optional"
}


function fRestoreAZ() {

	var i=0;
	var vFound=0;
	ovDataC=vDataC;	
	vDataCount=-1;
	fClearDivs();	
	for (i=1;i<ovDataC+1;i++){
		vHold=vDataH[i];	
		document.all.dT20.innerHTML=document.all.dT19.innerHTML;
		document.all.dT19.innerHTML=document.all.dT18.innerHTML;
		document.all.dT18.innerHTML=document.all.dT17.innerHTML;
		document.all.dT17.innerHTML=document.all.dT16.innerHTML;
		document.all.dT16.innerHTML=document.all.dT15.innerHTML;
		document.all.dT15.innerHTML=document.all.dT14.innerHTML;
		document.all.dT14.innerHTML=document.all.dT13.innerHTML;
		document.all.dT13.innerHTML=document.all.dT12.innerHTML;
		document.all.dT12.innerHTML=document.all.dT11.innerHTML;
		document.all.dT11.innerHTML=document.all.dT10.innerHTML;
		document.all.dT10.innerHTML=document.all.dT9.innerHTML;
		document.all.dT9.innerHTML=document.all.dT8.innerHTML;
		document.all.dT8.innerHTML=document.all.dT7.innerHTML;
		document.all.dT7.innerHTML=document.all.dT6.innerHTML;
		document.all.dT6.innerHTML=document.all.dT5.innerHTML;
		document.all.dT5.innerHTML=document.all.dT4.innerHTML;
		document.all.dT4.innerHTML=document.all.dT3.innerHTML;
		document.all.dT3.innerHTML=document.all.dT2.innerHTML;
		document.all.dT2.innerHTML=document.all.dT1.innerHTML;	
		if (document.all.cLineNumbers.checked==true) {				
			vDataCount=vDataCount+1;				
			if (vDataCount<10) {
				document.all.dT1.innerHTML=vDataCount + ".   " + vDataH[i];
			} else if (vDataCount<100) {
					document.all.dT1.innerHTML=vDataCount + ".  " + vDataH[i];
			} else if (vDataCount<1000) {
					document.all.dT1.innerHTML=vDataCount + ". " + vDataH[i];
			}
		
		} else {document.all.dT1.innerHTML=vDataH[i];
		}
		//vSearching=0;
		//}					
		//}
	}
}

function fMoveDown(){
	if (vEL>21) {
		vEL=vEL-1;
		document.all.dT1.innerHTML=document.all.dT2.innerHTML;
		document.all.dT2.innerHTML=document.all.dT3.innerHTML;
		document.all.dT3.innerHTML=document.all.dT4.innerHTML;
		document.all.dT4.innerHTML=document.all.dT5.innerHTML;
		document.all.dT5.innerHTML=document.all.dT6.innerHTML;
		document.all.dT6.innerHTML=document.all.dT7.innerHTML;
		document.all.dT7.innerHTML=document.all.dT8.innerHTML;
		document.all.dT8.innerHTML=document.all.dT9.innerHTML;
		document.all.dT9.innerHTML=document.all.dT10.innerHTML;
		document.all.dT10.innerHTML=document.all.dT11.innerHTML;
		document.all.dT11.innerHTML=document.all.dT12.innerHTML;
		document.all.dT12.innerHTML=document.all.dT13.innerHTML;
		document.all.dT13.innerHTML=document.all.dT14.innerHTML;
		document.all.dT14.innerHTML=document.all.dT15.innerHTML;
		document.all.dT15.innerHTML=document.all.dT16.innerHTML;
		document.all.dT16.innerHTML=document.all.dT17.innerHTML;
		document.all.dT17.innerHTML=document.all.dT18.innerHTML;
		document.all.dT18.innerHTML=document.all.dT19.innerHTML;
		document.all.dT19.innerHTML=document.all.dT20.innerHTML;
		document.all.dT20.innerHTML=vDataH[vEL-19];
	}
}

function fMoveUp() {

//	if (vEL<EL) {
		vEL= vEL+1;
		document.all.dT20.innerHTML=document.all.dT19.innerHTML;
		document.all.dT19.innerHTML=document.all.dT18.innerHTML;
		document.all.dT18.innerHTML=document.all.dT17.innerHTML;
		document.all.dT17.innerHTML=document.all.dT16.innerHTML;
		document.all.dT16.innerHTML=document.all.dT15.innerHTML;
		document.all.dT15.innerHTML=document.all.dT14.innerHTML;
		document.all.dT14.innerHTML=document.all.dT13.innerHTML;
		document.all.dT13.innerHTML=document.all.dT12.innerHTML;
		document.all.dT12.innerHTML=document.all.dT11.innerHTML;
		document.all.dT11.innerHTML=document.all.dT10.innerHTML;
		document.all.dT10.innerHTML=document.all.dT9.innerHTML;
		document.all.dT9.innerHTML=document.all.dT8.innerHTML;
		document.all.dT8.innerHTML=document.all.dT7.innerHTML;
		document.all.dT7.innerHTML=document.all.dT6.innerHTML;
		document.all.dT6.innerHTML=document.all.dT5.innerHTML;
		document.all.dT5.innerHTML=document.all.dT4.innerHTML;
		document.all.dT4.innerHTML=document.all.dT3.innerHTML;
		document.all.dT3.innerHTML=document.all.dT2.innerHTML;
		document.all.dT2.innerHTML=document.all.dT1.innerHTML;
		document.all.dT1.innerHTML=vDataH[vEL+1];
//	}
 }
 

function fClearDivs(){
		document.all.dT20.innerHTML="&nbsp;";
		document.all.dT19.innerHTML="&nbsp;";
		document.all.dT18.innerHTML="&nbsp;";
		document.all.dT17.innerHTML="&nbsp;";
		document.all.dT16.innerHTML="&nbsp;";
		document.all.dT15.innerHTML="&nbsp;";
		document.all.dT14.innerHTML="&nbsp;";
		document.all.dT13.innerHTML="&nbsp;";
		document.all.dT12.innerHTML="&nbsp;";
		document.all.dT11.innerHTML="&nbsp;";
		document.all.dT10.innerHTML="&nbsp;";
		document.all.dT9.innerHTML="&nbsp;";
		document.all.dT8.innerHTML="&nbsp;";
		document.all.dT7.innerHTML="&nbsp;";
		document.all.dT6.innerHTML="&nbsp;";
		document.all.dT5.innerHTML="&nbsp;";
		document.all.dT4.innerHTML="&nbsp;";
		document.all.dT3.innerHTML="&nbsp;";
		document.all.dT2.innerHTML="&nbsp;";
		document.all.dT1.innerHTML="&nbsp;";
}


function fPSort(){

	vDataH.sort();
	var i=0;
	ovDataC=vDataC;	
	vDataCount=-1;
	fClearDivs();	
	for (i=1;i<ovDataC;i++){
		vHold=vDataH[i];	
		document.all.dT20.innerHTML=document.all.dT19.innerHTML;
		document.all.dT19.innerHTML=document.all.dT18.innerHTML;
		document.all.dT18.innerHTML=document.all.dT17.innerHTML;
		document.all.dT17.innerHTML=document.all.dT16.innerHTML;
		document.all.dT16.innerHTML=document.all.dT15.innerHTML;
		document.all.dT15.innerHTML=document.all.dT14.innerHTML;
		document.all.dT14.innerHTML=document.all.dT13.innerHTML;
		document.all.dT13.innerHTML=document.all.dT12.innerHTML;
		document.all.dT12.innerHTML=document.all.dT11.innerHTML;
		document.all.dT11.innerHTML=document.all.dT10.innerHTML;
		document.all.dT10.innerHTML=document.all.dT9.innerHTML;
		document.all.dT9.innerHTML=document.all.dT8.innerHTML;
		document.all.dT8.innerHTML=document.all.dT7.innerHTML;
		document.all.dT7.innerHTML=document.all.dT6.innerHTML;
		document.all.dT6.innerHTML=document.all.dT5.innerHTML;
		document.all.dT5.innerHTML=document.all.dT4.innerHTML;
		document.all.dT4.innerHTML=document.all.dT3.innerHTML;
		document.all.dT3.innerHTML=document.all.dT2.innerHTML;
		document.all.dT2.innerHTML=document.all.dT1.innerHTML;	
		if (document.all.cLineNumbers.checked==true) {				
			vDataCount=vDataCount+1;				
			if (vDataCount<10) {
				document.all.dT1.innerHTML=vDataCount + ".   " + vDataH[i];
			} else if (vDataCount<100) {
					document.all.dT1.innerHTML=vDataCount + ".  " + vDataH[i];
			} else if (vDataCount<1000) {
					document.all.dT1.innerHTML=vDataCount + ". " + vDataH[i];
			}
		
		} else {document.all.dT1.innerHTML=vDataH[i];
		}
		}
}

function fSearchAZ(){

	var tmp=document.all.tSearch.value.toUpperCase()
	if (tmp.length==0) {
		alert("Nothing to search for!")
		document.all.tSearch.focus();
		return;
	}
	
	var vMsg=""
	
	var i=0;
	var vFound=0;
	ovDataC=vDataC;	
	vDataCount=-1;
	fClearDivs();

	for (i=1;i<ovDataC;i++){

		if (vDataT[i].toUpperCase().indexOf(tmp)>-1) {
			if (vFound==0) {
				vFound=1;
				tCM();
				vDataC=ovDataC;
			}
			
			vSearching=1;

		document.all.dT20.innerHTML=document.all.dT19.innerHTML;
		document.all.dT19.innerHTML=document.all.dT18.innerHTML;
		document.all.dT18.innerHTML=document.all.dT17.innerHTML;
		document.all.dT17.innerHTML=document.all.dT16.innerHTML;
		document.all.dT16.innerHTML=document.all.dT15.innerHTML;
		document.all.dT15.innerHTML=document.all.dT14.innerHTML;
		document.all.dT14.innerHTML=document.all.dT13.innerHTML;
		document.all.dT13.innerHTML=document.all.dT12.innerHTML;
		document.all.dT12.innerHTML=document.all.dT11.innerHTML;
		document.all.dT11.innerHTML=document.all.dT10.innerHTML;
		document.all.dT10.innerHTML=document.all.dT9.innerHTML;
		document.all.dT9.innerHTML=document.all.dT8.innerHTML;
		document.all.dT8.innerHTML=document.all.dT7.innerHTML;
		document.all.dT7.innerHTML=document.all.dT6.innerHTML;
		document.all.dT6.innerHTML=document.all.dT5.innerHTML;
		document.all.dT5.innerHTML=document.all.dT4.innerHTML;
		document.all.dT4.innerHTML=document.all.dT3.innerHTML;
		document.all.dT3.innerHTML=document.all.dT2.innerHTML;
		document.all.dT2.innerHTML=document.all.dT1.innerHTML;	
		
		if (document.all.cLineNumbers.checked==true) {				
			vDataCount=vDataCount+1;				
			if (vDataCount<10) {
				document.all.dT1.innerHTML=vDataCount + ".   " + vDataH[i];
			} else if (vDataCount<100) {
					document.all.dT1.innerHTML=vDataCount + ".  " + vDataH[i];
			} else if (vDataCount<1000) {
					document.all.dT1.innerHTML=vDataCount + ". " + vDataH[i];
			}		
		} else {document.all.dT1.innerHTML=vDataH[i];
		}
		vSearching=0;
		}
	}

}

function fSearchZA(){

	var tmp=document.all.tSearch.value.toUpperCase()
	if (tmp.length==0) {
		alert("Nothing to search for!")
		document.all.tSearch.focus();
		return;
	}
	var i=0;
	var vFound=0;
	ovDataC=vDataC;	
	vDataCount=-1;
	fClearDivs();	

	for (i=ovDataC;i>1;i--){	

		if (vDataT[i].toUpperCase().indexOf(tmp)>-1) {
			if (vFound==0) {
				vFound=1;
				tCM();
				vDataC=ovDataC;
			}
			vSearching=1;
			//vHold=vDataH[i];
		document.all.dT20.innerHTML=document.all.dT19.innerHTML;
		document.all.dT19.innerHTML=document.all.dT18.innerHTML;
		document.all.dT18.innerHTML=document.all.dT17.innerHTML;
		document.all.dT17.innerHTML=document.all.dT16.innerHTML;
		document.all.dT16.innerHTML=document.all.dT15.innerHTML;
		document.all.dT15.innerHTML=document.all.dT14.innerHTML;
		document.all.dT14.innerHTML=document.all.dT13.innerHTML;
		document.all.dT13.innerHTML=document.all.dT12.innerHTML;
		document.all.dT12.innerHTML=document.all.dT11.innerHTML;
		document.all.dT11.innerHTML=document.all.dT10.innerHTML;
		document.all.dT10.innerHTML=document.all.dT9.innerHTML;
		document.all.dT9.innerHTML=document.all.dT8.innerHTML;
		document.all.dT8.innerHTML=document.all.dT7.innerHTML;
		document.all.dT7.innerHTML=document.all.dT6.innerHTML;
		document.all.dT6.innerHTML=document.all.dT5.innerHTML;
		document.all.dT5.innerHTML=document.all.dT4.innerHTML;
		document.all.dT4.innerHTML=document.all.dT3.innerHTML;
		document.all.dT3.innerHTML=document.all.dT2.innerHTML;
		document.all.dT2.innerHTML=document.all.dT1.innerHTML;	

		if (document.all.cLineNumbers.checked==true) {				
			vDataCount=vDataCount+1;				
			if (vDataCount<10) {
				document.all.dT1.innerHTML=vDataCount + ".   " + vDataH[i];
			} else if (vDataCount<100) {
					document.all.dT1.innerHTML=vDataCount + ".  " + vDataH[i];
			} else if (vDataCount<1000) {
					document.all.dT1.innerHTML=vDataCount + ". " + vDataH[i];
			}		
		} else {document.all.dT1.innerHTML=vDataH[i];
		}
			vSearching=0;
		}
	}

}



function fInterval(){
	vInterval=document.all.MC.value
	vInterval=eval(vInterval.slice(0,vInterval.indexOf(" ")));
	vInterval=eval(vInterval * 1000)
	clearTimeout(t);	
	t=setTimeout("tnext()",vInterval);		
	alert("Checking messages ever " + eval(vInterval/1000) + " seconds.")
	tnext();
}

function tCM(){		
		
		document.all.dT20.innerHTML="&nbsp;";
		document.all.dT19.innerHTML="&nbsp;";
		document.all.dT18.innerHTML="&nbsp;";
		document.all.dT17.innerHTML="&nbsp;";
		document.all.dT16.innerHTML="&nbsp;";
		document.all.dT15.innerHTML="&nbsp;";
		document.all.dT14.innerHTML="&nbsp;";
		document.all.dT13.innerHTML="&nbsp;";
		document.all.dT12.innerHTML="&nbsp;";
		document.all.dT11.innerHTML="&nbsp;";
		document.all.dT10.innerHTML="&nbsp;";
		document.all.dT9.innerHTML="&nbsp;";
		document.all.dT8.innerHTML="&nbsp;";
		document.all.dT7.innerHTML="&nbsp;";
		document.all.dT6.innerHTML="&nbsp;";
		document.all.dT5.innerHTML="&nbsp;";
		document.all.dT4.innerHTML="&nbsp;";
		document.all.dT3.innerHTML="&nbsp;";
		document.all.dT2.innerHTML="&nbsp;";
		document.all.dT1.innerHTML="&nbsp;";
		
		document.all.dMusicMP3.style.pixelLeft=-400;
		document.all.dMusicMP3.style.pixelTop=-400;		
		document.all.dMusicMP3.innerHTML='<embed id="eMusicMP3" src="" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'
		
		document.all.dMusic.style.pixelLeft=-400
		document.all.dMusic.style.pixelTop=-500	
		document.all.dMusic.innerHTML='<embed id="eSound" src="" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'	
		
		vDataCount=-1;		
		
		if (document.all.cEraseHistory.checked==true) {	
			vDataC=0;	
		}
}

function tSM(){
	alert("Sorry, this function is not available at this time!")	
}

function CPP(n) {

	if (n==1 && C2.checked==true) {
		C3.checked=false;
		dPP.innerHTML="This is a public thread, listed in the lobby."
	}else if (n==1 && C2.checked==false) {
		C3.checked=true;
		dPP.innerHTML="This is a private thread, not listed in the lobby."
	}

	if (n==2 && C3.checked==true) {
		C2.checked=false;
		dPP.innerHTML="This is a private thread, not listed in the lobby."		
	}else if (n==2 && C3.checked==false) {
		C2.checked=true;
		dPP.innerHTML="This is a public thread, listed in the lobby."		
	}	
}

function fPPE(){
	alert("Public threads are listed in the lobby.\n" + "If you do not want this thread to be listed, click Private.\n\n"+ "Private threads are not listed in the lobby.\n" + "Only visitors that know this thread's name and password will be able to join.")
}

function C1Color(){
	C1.style.background="#ECECD9"
}

function thowitworks(){
	alert("How it works!\n \n 1. Enter your name\n 2. Enter unique thread (example: MyBestFriends)\n 3. Enter unique password\n 4. Email your tread and password to your friends\n\nWorld's fastest messaging!\n - Up to 100 guests\n - No membership fees\n - Free worldwide meetings")
}
function tclear(){
	S2.value="";
	document.all.dS2Length.innerHTML="350";
}

function tsend(){
	t0=Text0.value;
	t2=Text2.value;
	
	if (document.all.S2.value.length<1){
		alert("Nothing to send!")
		return;
	}
				str=Text2.value;
				Text2.value=str.replace(/\n/,"");
				
				str=Text2.value;
				Text2.value=str.replace(/#/,"");
				
				str=Text2.value;
				Text2.value=str.replace(/</,"");
				
				str=Text2.value;
				Text2.value=str.replace(/>/,"");
				
				str=Text2.value;				
				Text2.value=str.replace(/=/,"");
				
				//str=Text2.value;				
				//Text2.value=str.replace(/+/,"");
				
				str=Text2.value;								
				Text2.value=str.replace(/%/,"");
				
				str=Text2.value;				
				Text2.value=str.replace(/@/,"");
				
				str=Text2.value;
				Text2.value=str.replace(/&/,"");
				
				str=Text2.value;
				Text2.value=str.replace(/$/,"");

	t3=Text3.value;	

				str=Text3.value;				
				Text3.value=str.replace(/\n/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/#/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/</,"");
				
				str=Text3.value;
				Text3.value=str.replace(/>/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/=/,"");
				
				
				/*
				str=Text3.value;
				Text3.value=str.replace(/+/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/-/,"");
				*/
				
				
				//str=Text3.value;
				//Text3.value=str.replace(/*/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/%/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/@/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/&/,"");
				
				str=Text3.value;
				Text3.value=str.replace(/$/,"");
				


	//var t4=tPW.value;	

				str=tPW.value;				
				tPW.value=str.replace(/\n/,"");
				
				str=tPW.value;
				tPW.value=str.replace(/#/,"");
				
				str=tPW.value;
				tPW.value=str.replace(/</,"");
				
				str=tPW.value;
				tPW.value=str.replace(/>/,"");
				
				str=tPW.value;
				tPW.value=str.replace(/=/,"");
				
				//str=tPW.value;
				//tPW.value=str.replace(/+/,"");
				
				//str=tPW.value;
				//tPW.value=str.replace(/*/,"");
				
				str=tPW.value;
				tPW.value=str.replace(/%/,"");
				
				str=tPW.value;
				tPW.value=str.replace(/@/,"");
				
				str=tPW.value;
				tPW.value=str.replace(/&/,"");
				
				str=tPW.value;
				tPW.value=str.replace(/$/,"");

	var t4=tPW.value;



	clearTimeout(t);
	
	t=setTimeout("tnext()",vInterval);	
		
	if (t0 !="") {	
		if (t2 !=""){
			if (t3 !=""){
				C1.style.background="#ECECD9"
				//var txtMsg = new XMLHttpRequest();
				var txtMsg=xmlHTPP;

		
				str=S2.value;								
				S2.value=str.replace(/\n/g,"~n~");
				
				str=S2.value;				
				S2.value=str.replace(/&/g,"~u~");
								
				str=S2.value;
				S2.value=str.replace(/#/g,"~p~");

				str=S2.value;
				S2.value=str.replace(/</g,"~1~");

				str=S2.value;
				S2.value=str.replace(/>/g,"~r~");

				str=S2.value;
				S2.value=str.replace(/=/g,"~e~");
				
				//if (S2.value.indexOf("+")>-1) {
				//	alert("Found it!")					
				//}
				//str=S2.value;
				//S2.value=str.replace(charCodeAt(43),"~2~");
				/*
				var j=0;
				var vStr=""
				for (j=1;j<str.length;j=j+1) {
					if (str.slice(j,1)=="+") {
						vStr=vStr + "~2~"
					} else {
					vStr=vStr + str.slice(j,1)
					}
				}
				S2.value=vStr

				str=S2.value;
				S2.value=str.replace(/-/g,"~0~");
				*/
				
				
				if (S2.value.toUpperCase()=="[DELETE]" && Text3.value.toUpperCase()=="MAIN") {
					if (Text0.value.toUpperCase()!="WNGJAVA") {
						alert("Sorry, Main areas can not be deleted.")
						return
					}
					
				}
				
				if (S2.value.toUpperCase()=="[DELETE]" && vDeleteName.toUpperCase()!=Text0.value.toUpperCase()) {
					alert("Sorry, this thread can only be deleted by the person that created it.\n" + "Please contact the creator and ask to have this thread deleted.")
					return
				}
				

				
				var t4="";


				if (tPW.value.toUpperCase()!="OPTIONAL" && tPW.value.toUpperCase()!="" && tPW.value.toUpperCase()!=" ") {
					//if (tPW.value.toUpperCase()!=("OPTIONAL" !! "" !! " " !! "  ") {				
					var t4="-" + tPW.value;
				}				
				msg1="http://www.411ppc.com/asp/ReadLong.asp?R=" + Text2.value + "&D=" + Text4.value + "&P=" + Text3.value + t4 + "&C=" + Text0.value + "&F=" + vFont + "&M=" + S2.value		
				txtMsg.open("GET", msg1, true);
				txtMsg.send(null);	

				if (S2.value.toUpperCase()=="[DELETE]") {
					alert("Thread : " + document.all.Text2.value + " " + document.all.Text3.value + t4 + " has been deleted!" + "\n" + "However, until your Internet cache is cleared, you will still be able to read this thread." + "\n" + "Cache also clears at midnight on most computers.")
				}				
				//alert("Sent : " + msg1);				
				S2.value="";
				document.all.dS2Length.innerHTML="350";
				Text6.value=msg1;
				clearTimeout(t);
				t=setTimeout("tnext()",500);				
			}
			
		}
	}
}

function fS2Length(){
	document.all.dS2Length.innerHTML=350-eval(document.all.S2.value.length);
	if (eval(document.all.dS2Length.innerHTML)<1) {
		alert("Sorry, you are limited to 350 characters.")
		document.all.S2.value=document.all.S2.value.slice(0,345);
		return;
	}
}
function tnextClear() {
	t0=""
	t2=""
	t3=""
	ot="";
	ot4="-1";
	vLastThread="";
	clearTimeout(t);
	t=setTimeout("tnext()",250)
	vE=-1;
	vEL=vE;
	ovHold="";
	tCM();
	tnext();
}




function tnext(){


t0=Text0.value;
t2=Text2.value;
t3=Text3.value;
clearTimeout(t);
t=setTimeout("tnext()",vInterval);

		
	if (t0 !="") {
	
	if (t2 !="") {	
	
		if (t2 ===ot){
			Text4.value="0";
			ot=t2;
		}
		
	if (t3 !="") {
	
		var t4="";

		if (tPW.value.toUpperCase()!="OPTIONAL") {
		
			if (tPW.value!="") {
			
				var t4="-" + tPW.value;
				
			} else {
			
				//document.all.tPW.value="Optional"
			}
			
		}
		
		if (t4.toUpperCase()=="OPTIONAL") {
		
			t4="";
			
		}
		
		fName="http://www.411ppc.com/Chat/" + Text2.value + Text3.value + t4 + Text4.value + ".txt";		
		
		if (vText4==Text4.value && Text4.value>0) {		

			clearTimeout(t);
			
			t=setTimeout("tnext()",1000)		
			
			return ;		
		}		

		
		//var txtFile = new XMLHttpRequest();
		
		var txtFile=xmlHTPP;
		
		txtFile.open("GET", fName,true);
		
		Text7.value=fName;

		txtFile.onreadystatechange = function() {
		//alert(txtFile.readyState)

		

		
  if (txtFile.readyState===4) {  // Makes sure the document is ready to parse.
	
			//dM.value=txtFile.status;
			
				//tSearch.value=txtFile.status;
				
				if (C1.checked==true && vNewMessage==1){
					if (txtFile.status==404) {
						C1.style.background="Red"
						vMP3File="Music/Ringtone_most_Cool_SMS_tone09.mp3" // Sound/ding.wav"
						//document.all.dMusicMP3.style.pixelLeft="-400";
						//document.all.dMusicMP3.style.pixelTop="-400";
						document.all.dMusicMP3.innerHTML='<embed id="eMusicMP3" src=' + vMP3File + ' type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'										
						//fStartMP3(vMP3File)
						vNewMessage=0;						
					}
				}		
		
		
  	if (txtFile.status ===200) {
				vHold=txtFile.responseText;  	
				
				if (vHold==ovHold){
					txtFile.send(null);				
					clearTimeout(t);
					t=setTimeout("tnext()",1000);				
					return;
				}
				
				ovHold=vHold  	  				
 				
  				if (t4.toUpperCase()=="OPTIONAL") {
  				
  					t4="";
  				}

	  			var vCompare=document.all.Text2.value.toUpperCase() + document.all.Text3.value.toUpperCase() + t4;
	  				
				ot4=t4
				
				if (Text4.value=="0") {
					if (vHold.indexOf("[")>-1) {
						vDeleteName=vHold.slice(vHold.indexOf("[")+1,vHold.indexOf("]"))
						//alert(vDeleteName)
					}
				}
				
				vText4=Text4.value;
				
				vLastThread=fName;
				  				
  				if (oThread!==vCompare){
  				
  					oThread=vCompare;
  					
  					var vMatch=0;
  					
  					var j=1;
  					
  					for (j=1;j<=vThreadCount;j++) {
  					
  						if (vThreadHistory[j].toUpperCase()==document.all.Text2.value.toUpperCase() + "|" + document.all.Text3.value.toUpperCase() + "|" + t4) {
  						
  							vMatch=1;
  						}
  					}
  					
  					if (vMatch<1) {
  					
	  					vThreadCount=vThreadCount+1;	  	
	  									
	  					vThreadHistory[vThreadCount]=document.all.Text2.value + "|" + document.all.Text3.value + "|" + t4;
	  					
	  				}
	  				
  					vHold='<center><font size="2" color="#FF0000"><span style="background-color: #FFFF00">&nbsp;Thread: ' + document.all.Text2.value + " " + document.all.Text3.value + " " + document.all.tPW.value + '&nbsp;</span></font></center>'
  					
  					fShow();
  				}

				vHold=txtFile.responseText;				
				fShow();
				t=setTimeout("tnext()",vInterval);
				c=Text4.value;
				c=eval(c)+1;				
				Text4.value=c;
				
				if (C1.checked==true){
					C1.style.background="Red"
					//vMP3File="Music/Ringtone_most_Cool_SMS_tone09.mp3" // Sound/ding.wav"
					//document.all.dMusicMP3.style.pixelLeft="-400";
					//document.all.dMusicMP3.style.pixelTop="-400160";
					//document.all.dMusicMP3.innerHTML='<embed id="eMusicMP3" src=' + vMP3File + ' type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'										
					//fStartMP3(vMP3File)
					if (vHold.indexOf("[")>-1) {
						vTmp=vHold.slice(vHold.indexOf("[")+1,vHold.indexOf("]"))
						if (vTmp.toUpperCase()!=Text0.value.toUpperCase()) {
							vNewMessage=1;							
						} else { vNewMessage=0;
						}
					}
				}
				else{
					C1.style.background="#ECECD9"
				}
				clearTimeout(t);
				t=setTimeout("tnext()",200)

		}
  }

}
txtFile.send(null);

}

if (t0+t2+t3!=ot) {
	ot=t0+t2+t3;
	Text4.value="0";
	//S2.value="";
	//alert("done")
}
	  
}

}


function fDataCount() {

	if (document.all.cLineNumbers.checked==true) {
		vDataCount=vDataCount+1;				
		if (vDataCount<10) {
			document.all.dT1.innerHTML=vDataCount + ".   " + document.all.dT1.innerHTML;
		} else if (vDataCount<100) {
			document.all.dT1.innerHTML=vDataCount + ".  " + document.all.dT1.innerHTML;					
		} else if (vDataCount<1000) {
			document.all.dT1.innerHTML=vDataCount + ". " + document.all.dT1.innerHTML;					
		}
	} else {vDataCount=vDataCount=0;
	}	
}

function fShow() {


		document.all.dT20.innerHTML=document.all.dT19.innerHTML;
		document.all.dT19.innerHTML=document.all.dT18.innerHTML;
		document.all.dT18.innerHTML=document.all.dT17.innerHTML;
		document.all.dT17.innerHTML=document.all.dT16.innerHTML;
		document.all.dT16.innerHTML=document.all.dT15.innerHTML;
		document.all.dT15.innerHTML=document.all.dT14.innerHTML;
		document.all.dT14.innerHTML=document.all.dT13.innerHTML;
		document.all.dT13.innerHTML=document.all.dT12.innerHTML;
		document.all.dT12.innerHTML=document.all.dT11.innerHTML;
		document.all.dT11.innerHTML=document.all.dT10.innerHTML;
		document.all.dT10.innerHTML=document.all.dT9.innerHTML;
		document.all.dT9.innerHTML=document.all.dT8.innerHTML;
		document.all.dT8.innerHTML=document.all.dT7.innerHTML;
		document.all.dT7.innerHTML=document.all.dT6.innerHTML;
		document.all.dT6.innerHTML=document.all.dT5.innerHTML;
		document.all.dT5.innerHTML=document.all.dT4.innerHTML;
		document.all.dT4.innerHTML=document.all.dT3.innerHTML;
		document.all.dT3.innerHTML=document.all.dT2.innerHTML;
		document.all.dT2.innerHTML=document.all.dT1.innerHTML;	
		
		

		if (vHold.toUpperCase().indexOf("|")>-1) {
			var v1=vHold.slice(0,vHold.indexOf("]")+1);
			vHold= vHold.slice(vHold.indexOf("]"));
			var vF=vHold.slice(vHold.indexOf("=")+1,vHold.indexOf("|"));
			vHold=vHold.slice(vHold.indexOf("|")+1);

			if (document.all.cPopUps.checked==true){

				if (vHold.toUpperCase().indexOf("HTTP://")>-1 && vHold.toUpperCase().indexOf(".JPG")>0) {

					var tmp=""
					tmp=vHold.slice(vHold.toUpperCase().indexOf("HTTP://"))				
					tmp=tmp.slice(0,tmp.toUpperCase().indexOf(".JPG")+4)

					vHold=vHold.slice(0,vHold.toUpperCase().indexOf("HTTP://")-1) + vHold.slice(vHold.toUpperCase().indexOf(".JPG")+4)
					
					var vImage=""
				
					OpenWindow=window.open("","newImage" + vDataC,"height=600, width=800,toolbar=yes,scrollbars=yes,menubar=yes");
					OpenWindow.document.write("<img src=" + tmp + ">");
					OpenWindow.document.write("This is a pic!");
					OpenWindow.document.close();
			
					//http://www.leenwallpapers.com/images/gallery/ChopperConcept.jpg
				}
			} 
			if (vHold.toUpperCase().indexOf(".MP3")>-1 && vHold.indexOf("~20")>-1) {
				var tmp=vHold
				tmp=tmp.replace(/~20/g,"%20");				
				vHold=tmp;
			}
			if (document.all.cNAE.checked==true) {
				document.all.dT1.innerHTML='<font color="' + vF + '">' + vHold + ' ' + v1;
			} else {
				document.all.dT1.innerHTML=v1 + ' <font color="' + vF + '">' + vHold;
				//document.all.dT1.innerHTML=v1 + ' <font color="' + vF + '">' + vHold + '';
			}

			
			if (vSearching>0) {
				alert("coming back1")			
				return;
			}			

			vDataC=vDataC+1;
			vDataH[vDataC]=document.all.dT1.innerHTML;
			vDataT[vDataC]=document.all.dT1.innerText;

			
		} else {
			document.all.dT1.innerHTML=vHold;		
			if (vSearching>0) {
				alert("coming back2")			
				return;
			}						
			vDataC=vDataC+1;vDataH[vDataC]=document.all.dT1.innerHTML;
			vDataT[vDataC]=document.all.dT1.innerText;			
		}

				vE=eval(vE)+1;
				vEL=vE;
				
		fDataCount();		

				
			if (document.all.cMP3.checked==true && vHold.length>6 && vHold.toUpperCase().indexOf(".MP3")>-1) {
				var tmp=vHold.slice(vHold.toUpperCase().lastIndexOf("HTTP://"))
				if (tmp.toUpperCase().indexOf(".MP3")>-1) {				
					vMP3File=vHold
					//alert("Found MP3 : " + vMP3File)
					fPlayMP3(vMP3File);
				}
			}
				
				

			if (document.all.cSWF.checked==true && vHold.length>6 && vHold.toUpperCase().indexOf(".SWF")>-1) {
				var tmp=vHold.slice(vHold.toUpperCase().lastIndexOf("HTTP://"))
				if (tmp.toUpperCase().indexOf(".SWF")>-1) {				
					vSWF=vHold
					fPlaySWF(vSWF);
				}
			}

		
			if (document.all.cPopUpsMessage.checked==true){
				if (vHold.indexOf("!")>-1) {
					alert(v1 + "\n\n" + vHold);
					vHold=""
				}
			}	
				
}

}



function tTC() {
	if (vTextColorN<vTextColorM) {
		vTextColorN=vTextColorN+1;
	} else {
		vTextColorN=1;
	}
	vFont=vTextColor[vTextColorN];
	document.all.dTextColor.style.color=vTextColor[vTextColorN];
}

function fCMenu(n) {

	if (n==1) {
		vCMenu=document.all.dMenu1.innerHTML;
	} else if (n==2) {
		vCMenu=document.all.dMenu2.innerHTML;
	} else if (n==3) {
		vCMenu=document.all.dMenu3.innerHTML;
	} else if (n==4) {
		vCMenu=document.all.dMenu4.innerHTML;
	} else if (n==5) {
		vCMenu=document.all.dMenu5.innerHTML;
	} else if (n==6) {
		vCMenu=document.all.dMenu6.innerHTML;
	} else if (n==7) {
		vCMenu=document.all.dMenu7.innerHTML;
	} else if (n==8) {
		vCMenu=document.all.dMenu8.innerHTML;		
	}
	
	fClearShowHistory();	
	
	if (vCMenu.toUpperCase()=="LOBBY") {
		document.all.Text2.value="Lobby";
		document.all.Text3.value="Main";
		document.all.tPW.value="Optional";
		tnextClear();
		return;
	}
	
	if (vCMenu.toUpperCase()=="CHAT") {
		document.all.Text2.value="Chat";
		document.all.Text3.value="Main";
		document.all.tPW.value="Optional";
		tnextClear();
		return;
	}
	
	if (vCMenu.toUpperCase()=="BUSINESS") {
		document.all.Text2.value="Business";
		document.all.Text3.value="Main";
		document.all.tPW.value="Optional";
		tnextClear();
		return;
	}
	
	
	if (vCMenu.toUpperCase()=="EFFECTS") {
		//document.all.tPicURL.focus();
		location.href="#OptionsMenu";
		//<p align="center"><a href="#OptionsMenu">Test</a>
		
		return;
	}
	
	
	
	if (vCMenu.toUpperCase()=="HISTORY") {
		
		//if (document.all.dSubMenu.innerHTML.length>1) {
			//vMenu=0;
			//fClearShowHistory();	
		//} else {		
			fShowHistory();
			vMenu=1;
		//}
	} else if (vCMenu.toUpperCase()=="POPULAR") {	

		//if (document.all.dSubMenu.innerHTML.length>1) {
			//vMenu=0;
			//fClearShowHistory();	
		//} else {		
			//fShowPopular();
			document.all.dSubMenu.innerHTML=vCMenu;			
			document.all.dOption1.innerHTML="Automobiles for sale|Main"			
			document.all.dOption2.innerHTML="Music|Main"
			document.all.dOption3.innerHTML="Sports|News|Main"				
			document.all.dOption4.innerHTML="Technology|Main"			
			document.all.dOption5.innerHTML="Wanted|Main"	

					

	} else if (vCMenu.toUpperCase()=="TECHNOLOGY") {

			document.all.dSubMenu.innerHTML=vCMenu;			
			document.all.dOption1.innerHTML="Technology|Main"			
			//document.all.dOption2.innerHTML=""
			//document.all.dOption3.innerHTML=""			
			//document.all.dOption4.innerHTML=""
			
	} else if (vCMenu.toUpperCase()=="MUSIC") {
			document.all.dSubMenu.innerHTML=vCMenu;			
			document.all.dOption1.innerHTML="Music|Main"			
			//document.all.dOption2.innerHTML=""
			//document.all.dOption3.innerHTML=""			
			//document.all.dOption4.innerHTML=""
	}
}

function fShowHistory() {

	document.all.dSubMenu.innerHTML=vCMenu;
	
	//alert("fShowHistory() : vThreadCount = " + vThreadCount);
	
	var j=1;
	
for (j=1;j<=vThreadCount;j=j+1) {

	vTmp=vThreadHistory[j]
	
	//alert("j First time = " + j)
	
	if (vTmp.indexOf("|")>-1) {
		var vTmp1=vTmp.slice(0,vTmp.indexOf("|"))
		vTmp=vTmp.slice(vTmp.indexOf("|")+1)
		if (vTmp.indexOf("|")>-1) {
			var vTmp2=vTmp.slice(0,vTmp.indexOf("|"))
			vTmp=vTmp.slice(vTmp.indexOf("|")+1)

			if (vTmp.indexOf("|")>-1) {
				var vTmp3=vTmp.slice(0,vTmp.indexOf("|"))
				vTmp=vTmp.slice(vTmp.indexOf("|")+1)
				vTmp=vTmp1 + "|" + vTmp2 + "|" + vTmp3
				//alert("3 parts = " + vTmp);				
			} else { 				
				//alert("2 parts = " + vTmp1 + "*" + vTmp2)
				vTmp3=""
				if (vTmp!="") {
					if (vTmp.indexOf("-")>-1) {
						vTmp=vTmp.slice(1)
					}
					vTmp3=vTmp
				}
				vTmp=vTmp1 + "|" + vTmp2 + "|" + vTmp3
				//alert("vTmp now combines 3 parts: " + vTmp)
			}

	}	else {
	//			vTmp=vTmp1 + "|" + vTmp2 ;
	//			alert("function fShowHistory() 2 parts = " + vTmp);
	}	
	}

if (j==1) {
	document.all.dOption1.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==2) {
	document.all.dOption2.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==3) {
	
document.all.dOption3.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==4) {

document.all.dOption4.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==5) {

document.all.dOption5.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==6) {

document.all.dOption6.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==7) {

document.all.dOption7.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==8) {

document.all.dOption8.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==9) {

document.all.dOption9.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==10) {

document.all.dOption10.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==11) {

document.all.dOption11.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==12) {

document.all.dOption12.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==13) {

document.all.dOption13.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==14) {

document.all.dOption14.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==15) {

document.all.dOption15.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==16) {

document.all.dOption16.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==17) {

document.all.dOption17.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==18) {

document.all.dOption18.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==19) {

document.all.dOption19.innerHTML=vTmp; // =vThreadHistory[j];
}else if (j==20) {
document.all.dOption20.innerHTML=vTmp; // =vThreadHistory[j];
}
}
}

function fClearShowHistory(){
document.all.dSubMenu.innerHTML="";
document.all.dOption1.innerHTML="";
document.all.dOption2.innerHTML="";
document.all.dOption3.innerHTML="";
document.all.dOption4.innerHTML="";
document.all.dOption5.innerHTML="";
document.all.dOption6.innerHTML="";
document.all.dOption7.innerHTML="";
document.all.dOption8.innerHTML="";
document.all.dOption9.innerHTML="";
document.all.dOption10.innerHTML="";
document.all.dOption11.innerHTML="";
document.all.dOption12.innerHTML="";
document.all.dOption13.innerHTML="";
document.all.dOption14.innerHTML="";
document.all.dOption15.innerHTML="";
document.all.dOption16.innerHTML="";
document.all.dOption17.innerHTML="";
document.all.dOption18.innerHTML="";
document.all.dOption19.innerHTML="";
document.all.dOption20.innerHTML="";
}

function fMenu() {

if (vMenu!=1) {
	
	document.all.dMenu1.innerHTML="Business";
	document.all.dMenu2.innerHTML="Chat";
	document.all.dMenu3.innerHTML="Effects";
	document.all.dMenu4.innerHTML="History";
	document.all.dMenu5.innerHTML="Lobby";
	document.all.dMenu6.innerHTML="Music";	
	document.all.dMenu7.innerHTML="Popular";	
	document.all.dMenu8.innerHTML="Technology";		
	
	vMenu=1;

	}else{
	vMenu=0;
	document.all.dMenu1.innerHTML="-"
	document.all.dMenu2.innerHTML="-"
	document.all.dMenu3.innerHTML="-"
	document.all.dMenu4.innerHTML="-"	
	document.all.dMenu5.innerHTML="-"	
	document.all.dMenu6.innerHTML="-"	
	document.all.dMenu7.innerHTML="-"	
	document.all.dMenu8.innerHTML="-"		
	fClearShowHistory();
	}
}

function fOption(n) {

	//alert(vCMenu);
	

	
	if (document.all.Text0.value.length<1){
		alert("You are not signed in, please enter you name, located above left.");
		document.all.Text0.focus();
		return;
	}
	
	
	if (vCMenu.toUpperCase()=="HISTORY") {
		var vTmp=vThreadHistory[n]
			//alert("function fOption(n) n = " + n + " vTmp = " + vTmp)
			//document.all.Text2.value=vThreadHistory[n].slice(0,vThreadHistory[n].indexOf("|"));
			//document.all.Text3.value=vThreadHistory[n].slice(vThreadHistory[n].indexOf("|")+1);
			
		document.all.Text2.value=vTmp.slice(0,vTmp.indexOf("|"));
		
		vTmp=vTmp.slice(vTmp.indexOf("|")+1)
	
		document.all.Text3.value=vTmp.slice(0,vTmp.indexOf("|"));		
		
		if (vTmp.indexOf("|")>0) {
			vTmp=vTmp.slice(vTmp.indexOf("|")+1)
					if (vTmp.indexOf("-")>-1) {
				document.all.tPW.value=vTmp.slice(1);
			} 
			else {
				document.all.tPW.value=vTmp 
			}

			//document.all.tPW.value=vTmp
			
			if (vTmp.slice(0,1)="-") {
				vTmp=vTmp.slice(1)
			}
			
			alert("function fOption(n) Password : vTmp = " + vTmp)
			
		} else {
			document.all.tPW.value="Optional"			
		}
				

			//alert("Re-entering : " + document.all.Text2.value + " " + document.all.Text3.value)
			
		vLastThread="";
		tCM();
		t0="";
		t1="";
		t2="";
		t3="";
		ot="";
		oThread="";
		ot4="-1";
		vE=-1;
		vEL=vE;
		tnext();		
		//fClearShowHistory();
		
	} 

	else {
		
		var Tmp="";
		if (n==1) {
			Tmp=document.all.dOption1.innerHTML
		} else if (n==2) {
			Tmp=document.all.dOption2.innerHTML		
		} else if (n==3) {
			Tmp=document.all.dOption3.innerHTML		
		} else if (n==4) {
			Tmp=document.all.dOption4.innerHTML		
		} else if (n==5) {
			Tmp=document.all.dOption5.innerHTML		
		} else if (n==6) {
			Tmp=document.all.dOption6.innerHTML		
		} else if (n==7) {
			Tmp=document.all.dOption7.innerHTML		
		} else if (n==8) {
			Tmp=document.all.dOption8.innerHTML		
		} else if (n==9) {
			Tmp=document.all.dOption9.innerHTML		
		} else if (n==10) {
			Tmp=document.all.dOption10.innerHTML					
		}
		
	if (document.all.dSubMenu.innerHTML=="Participense") {
		document.all.tSearch.value=Tmp
		fSearchZA();
		return
	}		
		
		var vTmp=Tmp
		document.all.Text2.value=vTmp.slice(0,vTmp.indexOf("|"))
		vTmp=vTmp.slice(vTmp.indexOf("|")+1);
		
		if (vTmp.indexOf("|")>0) {
			document.all.Text3.value=vTmp.slice(0,vTmp.indexOf("|"))				
			vTmp=vTmp.slice(vTmp.indexOf("|")+1);		
			
			if (vTmp.indexOf("-")>-1) {
				document.all.tPW.value=vTmp.slice(1);
			} 
			else {
				document.all.tPW.value=vTmp 
			}
			
			//document.all.tPW.value=Tmp.slice(Tmp.indexOf("|")+1)
		} else { document.all.Text3.value=vTmp;
			document.all.tPW.value="";
		}
		tCM();
	}
		vLastThread="";
		oThread="";	
		t0="";
		t1="";		
		ot="";
		t2="";
		t3="";
		ot4="-1";
		vE=-1;
		vEL=vE;
		tnext();
}

function fDelete() {
	document.all.S2.value="[DELETE]"
}

function fWebPage() {
	document.all.S2.value="";
	document.all.dS2Length.innerHTML="350";
	var tmp=document.all.Text19.value;

	//var tmp=document.all.Text19.value.replace(/%20/g," ");
	//document.all.Text19.value=tmp;
	
	
	if (document.all.Text18.value.length<1) {
		alert("Caption is missing!")
	}
	
	if (tmp.length>4 && tmp.indexOf(".")<tmp.length-1) {
		if (tmp.toUpperCase().indexOf("HTTP://")>-1) {
			setTimeout(function() { window.scrollTo(0, 1) }, 100);
			tmp='<a href="' + tmp + ' " target="_blank"><font color="yellow">Link :</font><font color="white">&nbsp;' + document.all.Text18.value + '&nbsp;</font></a>'
			// tmp=tmp + '<embed id="eMP3" src="' + document.all.Text19.value + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'
			// <a href="http://www.radiotower.com/player.php?channel_id=9893" target="_blank"><font face="cosmic" size="2" color="yellow">Click me for RadioTower.com</font></a>									
				 document.all.S2.value= tmp
				OpenWindow=window.open("","newImage" + vDataC,"height=200, width=500,toolbar=yes,scrollbars=yes,menubar=yes,alwaysRaised=yes;");
				OpenWindow.document.write('<font face="verdana" size="2" color="white">')
				OpenWindow.document.write('<center><b>Click the link below, if it functions properly, close this window and press Send, located at the top right of the 411PPC.com page.</b><p>')
				OpenWindow.document.write('<div>' + tmp + '</font></div></center>');
				OpenWindow.document.bgColor="black";				
				OpenWindow.document.close();
								
		} else {alert("Your entry does not seem to be an actual webpage or URL.") ;
			return;
		}	
	} else { alert("Your entry does not seem to be an actual webpage or URL.") ; 
		return
	}		
}


function fWebPage2() {
	document.all.S2.value="";
	document.all.dS2Length.innerHTML="350";
	var tmp=document.all.Text21.value;	
	tmp=tmp.replace(/%20/g,"~20");
	tmp=tmp.replace(/ /g,"~20");	
	document.all.Text21.value=tmp;
	
	if (document.all.Text20.value.length<1) {
		alert("MP3 caption is missing!")
		return;
	}	

	if (tmp.length>4 && tmp.indexOf(".")<tmp.length-1) {
		if (tmp.toUpperCase().indexOf("HTTP://")>-1) {

			//works great for inline MP3 player
			//tmp='<a href="' + tmp + ' " target="_blank"><font color="yellow">' + document.all.Text20.value + '</font></a>'
			//tmp='<embed id="eMP3" src="' + document.all.Text21.value + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" auto_play="false" width="200" height="16">' + ' Link: ' + tmp
     //    [John]<font color="#ffffff">
     //   <div onmouseover="style.cursor=&quot;hand&quot;" style="CURSOR: hand" onclick="fStartMP3(&quot;http://c.wrzuta.pl/wa5199/3f94c66f002a7d624a02db9c/0/sean" burning.mp3?) fire kingston>
     //     <font color="yellow">MP3 : </font><font color="white">Test this out!</font>
     //   </div>			
			
		if (tmp.toUpperCase().indexOf(".MP3")>-1) {
				var vMusicTmp=document.all.Text21.value;
				var tmp1='<div onmouseover=style.cursor="hand" onclick=fStartMP3("';
				var tmp2= vMusicTmp;
				var tmp3='")'
				var tmp4='><font color="yellow">MP3 : </font><font color="White">';
				var tmp5= document.all.Text20.value + '</font></div>';
				var tmp = tmp1 + tmp2 + tmp3 + tmp4 + tmp5;
				
				// was good as long as there are no %20 tmp='<div onmouseover=style.cursor="hand" onclick=fStartMP3("' + document.all.Text21.value + '")>' + '<font color="yellow">MP3 : </font><font color="White">' + document.all.Text20.value + '</font></div>'				

				//        tmp='<div onmouseover=style.cursor="hand" onclick=fStartMP3("' + document.all.Text21.value + '")>' + document.all.Text20.value + '</div>'
				//                 <div onmouseover=style.cursor="hand" onclick=fStartMP3("http://noydj.free.fr/musik/08-craig_david-unbelievable.mp3")>				
		      	
				document.all.S2.value=tmp;
				//setTimeout(function() { window.scrollTo(0, 1) }, 100);
				OpenWindow=window.open("","newImage" + vDataC,"height=200, width=500,toolbar=yes,scrollbars=yes,menubar=yes,alwaysRaised=yes;");
				OpenWindow.document.write('<font face="verdana" size="2" color="white">')
				OpenWindow.document.write('<center><b>Click the link below, if the MP3 plays, close this window and press Send, located at the top right of the 411PPC.com page.</b><p>')			
				OpenWindow.document.write(tmp + '')
				OpenWindow.document.write('<div id="dMusicMP3"></div>');
				OpenWindow.document.write('<' + 'script>');
				OpenWindow.document.write('function fStartMP3(vMP3File) {');
				OpenWindow.document.write('document.all.dMusicMP3.style.pixelLeft="225";');
				OpenWindow.document.write('document.all.dMusicMP3.style.pixelTop="150";');
				OpenWindow.document.write('document.all.dMusicMP3.innerHTML=' + "'" + '<embed id="eMusicMP3" src="' + document.all.Text21.value + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">' + "'")
				OpenWindow.document.write('}');
				OpenWindow.document.write('<' + '/' + 'script>');
				OpenWindow.document.bgColor="black";				
				OpenWindow.document.close();
				if (tmp.indexOf("~20")>-1) {
					tmp=document.all.Text21.value;
					tmp=tmp.replace(/~20/g," ");				
					document.all.Text21.value=tmp;
				}
								
				setTimeout(function() { window.scrollTo(0, 1) }, 100);

			}
		} else {alert("Your entry does not seem to be an actual URL.") ;
			return;
		}	
	} else { alert("Your entry does not seem to be an actual URL.") ; 
		return
	}		
}

function fStartMP3(vMP3File) {		
		document.all.dMusicMP3.style.pixelLeft="225";
		document.all.dMusicMP3.style.pixelTop="160";
		document.all.dMusicMP3.innerHTML='<embed id="eMusicMP3" src=' + vMP3File + ' type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'
}

function fReload() {
	document.all.dMusicMP3.style.pixelLeft=-400;
	document.all.dMusicMP3.style.pixelTop=-400;
	document.all.dMusicMP3.innerHTML='<embed id="eMusicMP3" src="" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'
	document.all.dMusic.style.pixelLeft=-400
	document.all.dMusic.style.pixelTop=-500	
	document.all.dMusic.innerHTML='<embed id="eSound" src="" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'	
	tCM();
	t0=""
	t2=""
	t3=""
	ot="";
	ot4="-1";
	vLastThread="";
	clearTimeout(t);
	t=setTimeout("tnext()",250)
	vE=-1;
	vEL=vE;	
	tnext();	
}

function fPlayMP3(vMP3File) {
	var tmp=vMP3File.slice(vMP3File.lastIndexOf(".MP3")-5)
	tmp=tmp.toUpperCase()
	alert("MP3 = " + vMP3File)
	if (tmp.indexOf(".MP3")>-1) {
		vMP3File=vMP3File.replace(/%20/g," ");
		document.all.dMusicMP3.style.pixelLeft="225";
		document.all.dMusicMP3.style.pixelTop="160";
		document.all.dMusicMP3.innerHTML='<embed id="eMusicMP30" src=' + vMP3File + ' type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'
		//<embed id="eSound" src="Sound/ding.wav" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">
	}
}

function fPlaySWF(vSWF) {
	var tmp=vSWF.slice(vSWF.lastIndexOf(".SWF")-5)
	tmp=tmp.toUpperCase()
	
	if (tmp.indexOf(".SWF")>-1) {
		document.all.dMusic.style.pixelLeft="435";
		document.all.dMusic.style.pixelTop="180";

		vMP3File=vSWF
		document.all.dMusic.innerHTML='<embed id="eSound" src="' + vSWF + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="16">'
		document.all.dMusic.height=260
		document.all.dMusic.width=340
		document.all.eSound.height=240
		document.all.eSound.width=320
	}	
}

function fPic(){
	document.all.iPic.src=document.all.tPicURL.value
	document.all.dPicCaption.innerHTML=document.all.tPic.value
	document.all.S2.value=document.all.tPic.value + ' ' + '<img src="' + document.all.tPicURL.value + '">'
	alert("Click Send, located at the top of this page, to send this PIC and caption.")
}


t=setTimeout("tnext()",1000);

/*
Timbaland - Bounce (Feat. Dr. Dre, Missy Elliott, Justin Timberlake) 
http://www.resonatormag.com/music/timbaland-bounce.mp3

Craig David - Unbelievable 
http://noydj.free.fr/musik/08-craig_david-unbelievable.mp3


David Guetta FT Akon Sexy Bitch - Techno 
http://c.wrzuta.pl/wa6198/4985084c0009f7114a682934/0/david%20guetta%20ft%20akon%20-%20sexy%20bitch%20(extended%20mix).mp3


Hero - Nickelback 
http://freewebs.com/swampchicken/Tunes/Chad%20Kroeger%20-%20Hero%20%20(1).mp3


Sean Kingston Fire Burning
http://c.wrzuta.pl/wa5199/3f94c66f002a7d624a02db9c/0/sean%20kingston%20-%20fire%20burning.mp3
http://c.wrzuta.pl/wa5199/3f94c66f002a7d624a02db9c/0/sean kingston - fire burning.mp3

Shakira - She Wolf
http://c.wrzuta.pl/wa429/7d48849d001b7edb4a598e8b/0/shakira%20-%20she%20wolf.mp3

The Bellrays - Revolution Get Down .mp3
http://downloads.betterpropaganda.com/download.php?file=The_Bellrays-Revolution_Get_Down_128.mp3

Green Day - Know Your Enemy
http://culturebully.com/wp-content/uploads/2009/05/green-day-know-your-enemy-tv-total-05-06-2009.mp3

Keri Hilson ft Ne-Yo &amp; Kanye West - Knock You Down - Keri Hilson ft Ne-Yo & Kanye West [MusicForHer.com] .mp3
http://musicforher.com/files/knock_you_down_-_keri_hilson_ft_ne-yo_and_kanye_west_[MusicForHer.com].mp3

Michael Jackson - They Don't Care About Us
http://moncarnetdebord.allmyblog.com/images/moncarnetdebord/moncarnetdebord_20060612_195944.mp3

Pitbull - Calle Ocho 2009
http://lifeinart.ru/files/audio/2325/pitbull _ calle ocho (75_ brazil street) .mp3
http://beemp3.com/download.php?file=4614998&song=Calle+Ocho+2009

Enrique Iglesias - Tired of Being Sorry
http://intensebeats.com/music/Tired_Of_Being_Sorry_(Funky_Club_Edit)-Enrique_Iglesias.mp3
http://beemp3.com/download.php?file=2356969&song=Tired+of+Being+Sorry

Enrique Iglesias - 06 - Making Love For Fun 
http://pmusics.persiangig.com/www.pmusics.com/audio/mix/ENRIQUE_IGLESIAS___06___MAK.MP3

Jim Jonsin and Lady Gaga ft. Kalenna /Lady GaGa/Lady GaGa Feat. Madonna - Kaboom
http://attachments-blog.tut.by/9347/files/2009/02/lady-gaga-feat-madonna-kaboom-exlusive-zvukoffru.mp3

*/