<!-- Begin 
var key_tab = 9;
var basic = true;

function replace(string,text,by) {
    
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function count_strings(string, word) {
	var substrings = string.split(word);
	return substrings.length - 1;
}

function preview(textarea_obj) {
	var txt = get_textarea(textarea_obj);
	var pop_win = window.open("", "win", "width=400,height=250");
	pop_win.document.open("text/html", "replace");
	pop_win.document.write("<HTML>");
	pop_win.document.write("<HEAD>");
	pop_win.document.write("<title>Post Previewer</title>");
	pop_win.document.write("<link rel=stylesheet type=text/css href=default1.css>");
	pop_win.document.write("</HEAD>");
	pop_win.document.write(txt);
	pop_win.document.write("</HTML>");
	pop_win.focus();
}

function get_selection() {
	if (document.getSelection) {
		var txt = document.getSelection();
	} else if (document.selection && document.selection.createRange) {
		var range = document.selection.createRange();
		var txt = range.text;
	} else {
		var txt = "Sorry, this is not supported with your browser.";
	}
	return(txt);
}

function get_textarea(textarea_obj) {
	return(textarea_obj.value);
}

function set_textarea(textarea_obj,txt) {
	textarea_obj.value = txt;
}

function append_textarea(textarea_obj,txt) {
	textarea_obj.value += txt;
}

function processTab() {
  if ( window.event.keyCode == key_tab ) 
  {
	var s = document.selection;
	var tr = s.createRange();
	if ( tr != null ) 
		tr.text = "\t";
		window.event.returnValue=false;
  }
}

function bold(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[B][/B]");
	} else if (txt != null) {
		//var new_txt = existing_txt.replace(txt,"<b>"+txt+"</b>");
		var new_txt = replace(existing_txt,txt,"[B]"+txt+"[/B]");
		set_textarea(textarea_obj,new_txt);
	}
}

function underline(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[I][/I]");
	} else if (txt != null) {
		var new_txt = replace(existing_txt,txt,"[I]"+txt+"[/I]");
		set_textarea(textarea_obj,new_txt);
	}
}

function italicize(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[I][/I]");
	} else if (txt != null) {
		var new_txt = replace(existing_txt,txt,"[I]"+txt+"[/I]");
		set_textarea(textarea_obj,new_txt);
	}
}

function center(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[DIV ALIGN=CENTER][/DIV]");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"[DIV ALIGN=CENTER]"+txt+"[/DIV]");
		set_textarea(textarea_obj,new_txt);
	}
}

function right(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[DIV ALIGN=RIGHT][/DIV]");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"[DIV ALIGN=RIGHT]"+txt+"[/DIV]");
		set_textarea(textarea_obj,new_txt);
	}
}

function hyperlink(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[URL][/URL]");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"[URL]"+txt+"[/URL]");
		set_textarea(textarea_obj,new_txt);
	}
}

function mailto(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[EMAIL=][/EMAIL]");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"[EMAIL=]"+txt+"[/EMAIL]");
		set_textarea(textarea_obj,new_txt);
	}
}

function paragraph(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[P][/P]");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"[P]"+txt+"[/P]");
		set_textarea(textarea_obj,new_txt);
	}
}

function linebreak(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		//append_textarea(textarea_obj,"<br>");
		append_textarea(textarea_obj,"\n");
	} else if (txt != null) {
		//var new_txt = existing_txt.replace(txt,"<br>"+txt+"");
		var new_txt = existing_txt.replace(txt,"\n"+txt+"");
		set_textarea(textarea_obj,new_txt);
	}
	textarea_obj.focus( );
	textarea_obj.select( );
}


function table(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"<table><tr><td></td></tr></table>");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"<table><tr><td>"+txt+"</td></tr></table>");
		set_textarea(textarea_obj,new_txt);
	}
}

function image(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[IMG][/IMG]");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"[IMG]"+txt+"[/IMG]");
		set_textarea(textarea_obj,new_txt);
	}
}

function quote(textarea_obj) {
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,"[BLOCKQUOTE][/BLOCKQUOTE]");
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,"[BLOCKQUOTE]"+txt+"[/BLOCKQUOTE]");
		set_textarea(textarea_obj,new_txt);
	}
}

function ImageSizer(max_width,max_height,imageObject,divObject) {
									
	img_width = parseInt(imageObject.width);
	img_height = parseInt(imageObject.height);
	
	if (img_width < img_height) {
		leading_property = "height";
		if (img_height < max_height) { leading_size = img_height; }
		else { leading_size = max_height; }
	}
	else {
		leading_property = "width";
		if (img_width < max_width) { leading_size = img_width; }
		else { leading_size = max_width; }										
	}

	document.getElementById(divObject).innerHTML='<img src="' + imageObject.src + '" name="thumbnail" id="thumbnail"' + leading_property + '="' + leading_size + '" border="0">';
}

function validate(field) {
	var valid = ".0123456789"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) {
	temp = "" + field.value.substring(i, i+1);
	if (valid.indexOf(temp) == "-1") ok = "no";
}

if (ok == "no") {
	alert("Invalid entry!  Only numbers are accepted!");
	field.focus();
	field.select();
	   }
} 

function checkLength(field) {
	var ok = "yes";
	for (var i=0; i<field.value.length; i++) {
	if (field.value.length >= 13) ok = "no";
}

if (ok == "no") {
	alert("Amount shouldn't be than more 9,999,999.99!");
	field.focus();
	field.select();
	   }
}

                   
function checkrequired(which) {
	var pass=true;
	if  (document.images) {
		for (i=0;i<which.length;i++) {
		var tempobj=which.elements[i];
			if (tempobj.name.substring(0,8)=="required") {
			   if (((tempobj.type=="text"||tempobj.type=="textarea")&& tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&& tempobj.selectedIndex==0)) {
			   		
					pass=false;
					break;
					//return true;
		   		}
			}
	 	}
    }
	if (!pass) {
		shortFieldName=tempobj.name.substring(8,30).toUpperCase();
		alert("Please make sure the "+shortFieldName+" field was properly completed.");
		return false;
	}
	else
	return true;
}

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function DeleteObject(string){
var e = "document." + string
	if (confirm("This action is going to delete this record and are you okay with this?")){
		
		eval(e).submit();
	}
	return false;
}


function SelectAll(){
	for (var i=0;i<document.approval.elements.length;i++)	{
		var e = document.approval.elements[i];
		if (e.type=='checkbox'){
		e.checked = true;
		}
	}
}

function DeselectAll(){
	for (var i=0;i<document.approval.elements.length;i++)	{
		var e = document.approval.elements[i];
		if (e.type=='checkbox'){
		e.checked = false;
		}
	}
}

function doThePopUp(id){
theUrl="viewdescription.asp?id=" + id
reWin=window.open(theUrl,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=310,height=300,top=100,left=100')
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



<!--
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}




function openWindow(theURL,winName,features) {
	if (winName.window) winName.focus;
	popupWin = window.open(theURL,winName,features)
	popupWin.focus;
}

function enter(){
	chatWin = window.open("main.asp","chatWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,WIDTH=630,HEIGHT=540");
	chatWin.location.href = "main.asp"
	if(navigator.appVersion.indexOf("4") != -1){
		chatWin.moveTo(0,0);
	}
}

 function closeWin(){
	   chatWin.close();
 }
 
   <!--
   function openw() { 
   var jumpToHere;
	var winOptions;
	var popUpWindow;
	
	jumpToHere = "chatroom/Default.asp";
	
	winOptions = "top=100,left=200,width=600,height=480,scrollbars=no";
	popUpWindow = open(jumpToHere, "MyWindow2", winOptions);
   }
//-->

  function verify(form){
      if(form.room_name.value == "" || form.room_description.value==""){
            alert("Enter a room name and a room description.");
            return false;
      }
  }
  
  
  
function validate(field) {
var valid = "abcdefghijklmnopqrstuvwxyz0123456789_"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid entry!  Only characters and numbers are accepted!");
field.focus();
field.select();
   }
}

function validate2(field) {
var valid = "abcdefghijklmnopqrstuvwxyz"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid entry!  Only characters are accepted!");
field.focus();
field.select();
   }
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//-->

function openw(url) { 
	var jumpToHere;
	var winOptions;
	var popUpWindow;
	//alert(url);
	jumpToHere = url;
	
	winOptions = "top=100,left=200,width=350,height=400,scrollbars=yes";
	popUpWindow = open(jumpToHere, "MyWindow22", winOptions);
}

function Window(link){
	newWindow=open(link,"ISWindow",	"width=500,height=374,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no");
		}
		

function openw3(url) { 
	var jumpToHere;
	var winOptions;
	var popUpWindow;
	//alert(url);
	jumpToHere = url;
	
	winOptions = "top=100,left=200,width=700,height=660,scrollbars=no";
	popUpWindow = open(jumpToHere, "MyWindow22", winOptions);
}
   
function openw2() { 
   	var jumpToHere;
	var winOptions;
	var popUpWindow;
	
	jumpToHere = "<%= url %>demo.asp<%= usersession %>";
	
	winOptions = "top=100,left=200,width=640,height=420,scrollbars=no";
	popUpWindow = open(jumpToHere, "MyWindow3", winOptions);
   } 
   
function openw4(url) { 
	var jumpToHere;
	var winOptions;
	var popUpWindow;
	//alert(url);
	jumpToHere = url;
	
	winOptions = "top=100,left=200,width=430,height=350,scrollbars=no";
	popUpWindow = open(jumpToHere, "MyWindow22", winOptions);
}


function njoy() { 
	var jumpToHere;
	var winOptions;
	var popUpWindow;
	//alert(url);
	jumpToHere = "http://www.njoyonline.com/njoyplayer/njoyradioplayer.php";
	
	winOptions = "top=100,left=200,width=266,height=550,scrollbars=no";
	popUpWindow = open(jumpToHere, "njyWindow", winOptions);
}


function openWin5(url) { 
	var jumpToHere;
	var winOptions;
	var popUpWindow;
	//alert(url);
	jumpToHere = url;
	
	winOptions = "top=100,left=200,width=550,height=400,scrollbars=yes";
	popUpWindow = open(jumpToHere, "MyWindow22", winOptions);
}


function radiopage() { 
   var jumpToHere;
	var winOptions;
	var popUpWindow;
	
	jumpToHere = "mediaplayer.asp";
	
	winOptions = "location=no,status=no,menubar=no,scrollbars=no,left = 112,top = 84,resizeable=no,height=320,width=600";
	popUpWindow = open(jumpToHere, "_AR_player", winOptions);
 } 
//-->

function formatText(txt2) {
	var textarea_obj = document.form1.message;
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,txt2);
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,txt2);
		set_textarea(textarea_obj,new_txt);
	}
}

function formatText2(txt2) {
	var textarea_obj = document.form1.requiredanswer;
	var txt = get_selection();
	var existing_txt = get_textarea(textarea_obj);
	var string_count = count_strings(existing_txt,txt);
	
	if (txt == "" || string_count > 1) {
		append_textarea(textarea_obj,txt2);
	} else if (txt != null) {
		var new_txt = existing_txt.replace(txt,txt2);
		set_textarea(textarea_obj,new_txt);
	}
}

function PopupPic(sPicURL) { 
 window.open( "popup.asp?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=350"); 
} 
   

function redirectPage() {
if ((screen.width <= 800) && (screen.height <= 600))
window.open('http://www.soulhourradio.com/soulhoursite/chat/index2.html?'+'dlp=75ENfv9yRr%2FA2','Chat','left=0,top=0,width=789,height=542,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
else if ((screen.width >= 1024) && (screen.height >= 768))
window.open('http://www.soulhourradio.com/soulhoursite/chat/index.html?'+'dlp=75ENfv9yRr%2FA2','Chat','left=0,top=0,width=1014,height=708,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
}

function Upload(sPicURL) { 
 window.open( "upload.aspx?id="+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=350"); 
} 

function Upload2(sPicURL) { 
 window.open( "upload2.aspx?id="+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=350"); 
} 
function Popup() { 
 window.open( "radio.asp?radio=", "popupwin", "toolbar=0,scrollbars=0,resizable=0,HEIGHT=50,WIDTH=300,location=0,statusbar=0,menubar=0,resizable=0"); 
}

function Popupchat() { 
 window.open( 'chat.htm', "popupchat", "toolbar=0,scrollbars=0,resizable=0,HEIGHT=508,WIDTH=706,location=0,statusbar=0,menubar=0,resizable=0"); 
}  
