self.name = "Parent_Window";

function getOffset(w,h) {

	if (document.all)
	var xMax = screen.width, yMax = screen.height;
	else
	if (document.layers)
	var xMax = window.outerWidth, yMax = window.outerHeight;
	else
	var xMax = 640, yMax=480;
	
	var xOffset = (xMax - w)/2, yOffset = (yMax - h)/2;
	
	var finalOffset = ',screenX=' + xOffset + ',screenY=' + yOffset + ',top=' + yOffset + ',left=' + xOffset;
	return finalOffset;
}

function showPic(p,a,l) {
var w=90, h=110;
var url = 'show.priv.pics.php?pic='+p+'&affil='+a+'&loc='+l;
var w = window.open(url,'tn_show','width='+w+',height='+h+getOffset(w,h)); w.focus();

}

function showPrivImg(l) {
var w=350, h=350;
var url2 = "show.priv.pics2.php?pic="+l;
var w = window.open(url2,'showPic','width='+w+',height='+h+',resizable=yes'+getOffset(w,h)); w.focus();
}

function myonblurFunc() { 
// helps detect when window blur occurs
// see new.msg.read.php, chat.php
;
}

function fillNewModTime(modtime){
	document.forms['triggeread'].elements['secs'].value=modtime;
}

// count number of xters
function countXters(f,n){
f.count.value=n.value.length;
}

function getbDate(m,d){
document.step1.dobm.selectedIndex=m;
document.step1.dobd.selectedIndex=d;
}


function chkHist(u) {
var w=20, h=20;
var w = window.open('chk.contact.history.php?u='+u,'','width='+w+',height='+h+',resizable=yes'+getOffset(w,h)); w.focus();
}

function blurWin(id){
var w=800, h=400;
var w = window.open('adshow.php?id='+id,'','width='+w+',height='+h+',scrollbars=yes,resizable=yes'+getOffset(w,h)); w.focus();
}

function chkUsr(l,f) {
document.frames['cannedLtr'].location.href="saveCannedLetter.php?cmd=verUsr&f="+f+"&l="+l.value;
}

function go(f) {
var text = window.location.search.substring(1);
var s = f.v.selectedIndex;
var str = text+"&v="+s;
creator.document.location.href="reply.php?"+str;
window.close();
}

function addPageBorder() {
 if (document.body.style.cssText){    document.body.style.cssText="border:10px solid #1E90FF";
 }
}

function sizeUp(){
document.getElementById("aTextArea").style.height='330px';
document.getElementById("aTextArea").style.width='396px';
document.getElementById("msg").style.width='180px';
document.images[0].src='./images/<? echo $thumb; ?>';
top.resizeTo(410,490);
document.getElementById("msg").focus();
}

function sizeDn(){
document.getElementById("aTextArea").style.height='194px';
document.getElementById("aTextArea").style.width='299px';
document.getElementById("msg").style.width='189px';
top.resizeTo(311,376);
document.getElementById("msg").focus();
}

function finishOff(sId){
var w = window.open('chatStop.php?sessid='+sId,'finWIN','width=1,height=1');
}

function checkCode(f) {

if (f.code.value != f.conf.value) 
  { 
  alert("Correct confirmation code required");f.conf.value='';f.conf.focus();return(false); 
  }
}

function showLayer(myLayer) {
document.getElementById("myLayer").style.visibility="visible";
}

function hideLayer(myLayer) {
document.getElementById(myLayer).style.visibility="hidden";
}

function popPreReply(qs) {
var w=350, h=200;
var new_win = window.open('reply.b4.php?id='+qs,'preReply','width='+w+',height='+h+',scrollbars=yes,resizable=yes'+getOffset(w,h)); new_win.creator=self; new_win.focus(); return(false);
}

function playSound() { document.firstSound.play(); }
function exitSound() { document.secondSound.play(); }
function muzikSound() { document.musikSound.play(); }
function muzikStop() { document.musikSound.stop(); }
function newMsgSnd() { document.newMsgAlert.play(); }


function chgTitle(){ 
    for(var i=0; i<100; i++) {
    top.document.title=' | | | |';
    top.document.title='| | | |';
    }
    setTimeout("top.document.title='Oasis IM'",3000);
}



function changeThumb(imgIndex)
{

var changeImg = new Array ("images/__tn_p36a.jpg","images/__tn_p41.jpg","images/1008697717akindel.jpg","images/__tn_p46.jpg","images/tn_1006675810akindel.jpg")

window.document.images[0].src = changeImg[imgIndex];

}


function initChat(usrLogin,dom){ // called from cookie3.php & header nav links

var dt = new Date(); var H=dt.getHours(); 
var i=dt.getMinutes(); var s=dt.getSeconds(); var t=H+i+s;
var rnd_num = (Math.round((Math.random()*t)+1));

var myURL = dom+'/chat2.php?login='+usrLogin;
var chatMonWin = window.open(myURL,rnd_num,'width=167,height=388'); 
chatMonWin.focus();
}


function chatDelSessidMsgs(sessid){ // called with onUnload in chat.php
var page2Open = 'chatDelSessidMsgs.php?id='+sessid;
var new_window = window.open(page2Open,'cleanUp','width=1,height=1'); new_window.blur();
}

function chgColors(dClr)
{
  var bd,bg;

  var msgTxt = document.getElementById("aTextArea").style;

  var po='overflow:auto;font-size: 11pt; font-family: tahoma;line-height:130%;position:absolute; z-index:20; left:5; top:105; padding: 5px;';

  switch(dClr)
  {
    case "blk": bd='ffffff'; bg='000000'; break;
    case "pur": bd='FFCCFF'; bg='800080'; break;
    case "wht": bd='000000'; bg='ffffff'; break;
    case "gry": bd='eeeeee'; bg='999999'; break;
    case "blu": bd='4169E1'; bg='e6e6fa'; break;
    case "red": bd='ffaaaa'; bg='ffdddd'; break;
    case "ylw": bd='FF9900'; bg='FFFF66'; break;
    case "grn": bd='ccffcc'; bg='66cc66'; break;
  }

  document.body.style.cssText='background:#'+bg;
  po=po+'border:2px solid #'+bd+'; background-color: #'+bg+'; color: #'+bd+';width:296px; height:296px;';

  msgTxt.cssText=po;

  hideColorThemes('cTheme');document.getElementById("msg").focus();
}



function smily(descr){
var frm = document.getElementById("msg");
if(descr=='reg'){ frm.value += ':-)'; }
else if(descr=='tng'){ frm.value += ':-P'; }
else if(descr=='sad'){ frm.value += ':-('; }
else if(descr=='sck'){ frm.value += '+o('; }
else if(descr=='slp'){ frm.value += '|-)'; }
else if(descr=='srp'){ frm.value += ':-O'; }
else if(descr=='emb'){ frm.value += ':-$'; }
else if(descr=='sac'){ frm.value += '^o)'; }
else if(descr=='cnf'){ frm.value += ':-S'; }
else if(descr=='scr'){ frm.value += ':-#'; }
else if(descr=='ang'){ frm.value += ':-@'; }
else if(descr=='dsp'){ frm.value += ':-|'; }
else if(descr=='sec'){ frm.value += ':-*'; }
else if(descr=='grn'){ frm.value += ':-D'; }
else if(descr=='wnk'){ frm.value += ';-)'; }
document.getElementById("msg").focus();
}

function scrollToBottom (element) { 
//document.getElementById("aTextArea").scrollTop = parseInt(999999999999);
element.scrollTop = parseInt(999999999999);
//element.scrollTop = element.scrollHeight; 

  if (element.createTextRange) {
    var range = element.createTextRange();
    range.collapse(false);
    range.select();
  }

}


function scrollToTop (element) { element.scrollTop = 0; }




function whichButton(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {
alert('Oasisoflove\u00A9 Chat');return false;
}
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
alert('Oasisoflove\u00A9 Chat');document.getElementById("msg").focus();return false;
}
return true;
}









function noRtClk(e) {

var message="";

function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

}


/*
function noRtClk(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {return false; }else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {alert('Oasisoflove Chat\u00A9');return false;}
}
*/






function ieKeyPress() { 
var dest = document.chatForm.sendBtn; 

    if (window.event && (window.event.keyCode == 13) ) {
      dest.focus(); 
    }
}



function KeyPress(what,e,max,action) {
    if (document.layers) {
        if (e.target.value.length >= max)
            eval(action);
    }
    else if (document.all) {
        if (what.value.length > (max-1))
            eval(action);
    }
}


/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object   the table row
 * @param   string   the action calling this script (over, out or click)
 * @param   string   the default background color
 * @param   string   the color to use for mouseover
 * @param   string   the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
        if (theAction == 'out') {
            newColor = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor = (thePointerColor != '')
                     ? thePointerColor
                     : theDefaultColor;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function






function showSteps() {
   var timer1 = setTimeout("document.forms[0].the_text.value='Creating Account';",1000);
   var timer2 = setTimeout("document.forms[0].the_text2.value='Done!';",8000);
   var timer3 = setTimeout("document.forms[0].the_text3.value='Adding Mailbox';",10000);
   var timer4 = setTimeout("document.forms[0].the_text4.value='Done!';",14000);
   var timer5 = setTimeout("document.forms[0].the_text5.value='Setting up Oasis Messenger';",16000);
   var timer6 = setTimeout("document.forms[0].the_text6.value='Done!';",20000);
   var timer7 = setTimeout("document.forms[0].the_text7.value='Your acccont was successfully created!';",22000);
   var timer8 = setTimeout("document.forms[0].the_text8.value='Please wait...';",24000);
   var timer9 = setTimeout("document.location.href='./2/email.white.list.html';",35000);
}



function showFolder() { // display selected folder
document.usrFldr.submit.click();
}



<!-- BEGIN icq chat -->
	
	<!--
		n = (document.layers) ? 1 : 0;
		ie = (document.all) ? 1 : 0;
		ver4 = (n || ie) ? 1 : 0;
		var n6 = ((document.getElementById)&&(!ie)) ? 1 : 0;   
		var maxLen = 450;
		var enable;
		var session = true;
		var now_date = new Date();
		var cookie_date = new Date();
			
		function remove_minus(str) {
		var i;
		var back = "";
		
		for (i = 0; i < str.length; ++i) {
			if (str.substring(i,i+1) != "-") {
				back += str.substring(i,i+1);
			}
		}
		
			return back;
		}
			
		function irc(popName) {
		var winName = "";
		winName = remove_minus(popName);
	
			if (document.frmLogin.nick.value != "") {
			  if (document.frmLogin.icq.value != "") document.frmLogin.nick.value += "-"+document.frmLogin.icq.value;
			} else {
			  if (document.frmLogin.icq.value != "") document.frmLogin.nick.value = "Guest-"+document.frmLogin.icq.value;
				else document.frmLogin.nick.value = "Guest";
			}
	
			if (document.frmLogin.info.value == "" && document.frmLogin.icq.value != "") document.frmLogin.info.value = document.frmLogin.icq.value+"@pager.icq.com";
	
			var url3 = "http://cgi.icq.com/cgi-bin/ircqnet/ircqnet.pl5?x=635&y=440&channel=" +popName+ "&nick=" +document.frmLogin.nick.value+ "&info=" +document.frmLogin.info.value;
			window.open(url3, winName, 'width=640,height=480, replace=yes');
		}
				
		function iRandom(iMax) {
			var now=new Date();
			var time=now.getTime();
			return ((time/10) % iMax);
		}
				
		function getpage()
			{
				pagenum = (iRandom(25) * iRandom(25) * iRandom(25) * iRandom(25) * iRandom(25));
				if (pagenum < 100000) {
					pagenum += 100000;
				}
				while (pagenum > 7500000) {
					pagenum -= 1000000;
				}
				pageloc="/wwp/"+pagenum;
				document.frmRandom.btnRandom.value=pagenum;
				window.location=pageloc;
			}
		
		function getpage2()
			{
				var wwp = parseInt( (Math.random()*58900000)+100000,10 );
				pageloc="/wwp/"+wwp;
				window.location=pageloc;
			}
		
//interest select option
		function Go() {
			if(document.go.page.options[document.go.page.selectedIndex].value== 0){
				window.location="http://web.icq.com/whitepages/interest/"
			}else{
				//window.location="http://www.icq.com/whitepages/interest/"+document.go.page.options[document.go.page.selectedIndex].value+".html";
				window.location="http://web.icq.com/whitepages/interest/0,,"+document.go.page.options[document.go.page.selectedIndex].value+",00.html";
				}
			}
					
		function Checkit()
		{
			if (document.frmSearch.first.value=='First Name'){
				document.frmSearch.first.value="";
			}
			
			if (document.frmSearch.last.value=="Last Name"){
				document.frmSearch.last.value="";
			}
			return 0;
		}
		
		function clearSearch() {
		
		if(document.frmSearch.first.value == "First Name"){
			document.frmSearch.first.value = "";
			}
		if(document.frmSearch.last.value == "Last Name"){
			document.frmSearch.last.value = "";
			}
		}
			
		function chPager () {
		
		    var name = document.pagerform.from.value;
			var msg = document.pagerform.body.value;
			var mail = document.pagerform.fromemail.value;
			
			if(name==""){
				alert("Please enter your name.");
				document.pagerform.from.focus();
				return false;
				}
				
			if(mail == ""){
				alert("Please enter your Email.");
				document.pagerform.fromemail.focus();
				return false;
				}
				
			if(mail.indexOf('@',0) == -1 || mail.indexOf('.',0) == -1){
				alert("You have entered an invalid email address.\nPlease check again and re-enter your email address.");
				document.pagerform.fromemail.value="";
				document.pagerform.fromemail.focus();
				return false;
				}

			if(msg==""){
				alert("Please enter your message.");{
				document.pagerform.body.focus();
				return false;
				}
				
				return true;
			}
		}
		
		function init(){
			if(n)document.captureEvents(Event.KEYDOWN)
			document.onkeydown=counter;
			document.myform.charcount.value = 450 - document.pagerform.body.value.length;
		}
			
		function Enablecounter() {
			enable = setInterval("counter()",500);
		}
			
		function counter(){
			var msLen, clLen,niLen, totLen, tmp;
			var done = 0;
			msLen = document.pagerform.body.value.length;
			totLen = msLen;
			
			tmp = maxLen - totLen;
			//alert(tmp);
			if (document.myform.charcount.value != tmp) {
				if (tmp > 0) {
				// update counter
				document.myform.charcount.value = tmp;
				} else {
					if (tmp == 0) {
						// alert once and update counter to be 0
						alert("Your message is too long");
						document.myform.charcount.value = 0;
						clearTimeout(enable);
						document.pagerform.body.value = document.pagerform.body.value.substring(0,maxLen);
					} else {
						document.myform.charcount.value = 0;
						document.pagerform.body.value = document.pagerform.body.value.substring(0,maxLen)
					}
				}
			}
		}
		
			function Enablecounter() {
				enable = setInterval("counter()",500);
			}
			
			function ClearForm () {
				document.pagerform.from.value ="";
				document.pagerform.fromemail.value ="";
				document.pagerform.body.value ="";
			}
				
		   function newWin(win_name,pic_width,pic_height,Wname) {
			window.open(win_name,Wname,"width="+ pic_width +",height="+ pic_height +",top=40");
		   }
				
		function chat() {
			if ("" == "yes") {
				newWin('http://web.icq.com/wwp/msg/1,,,00.html?Uin=8291288&Name=Richie&Send=no','635','440','msg');
			}
		}
		
	//-->
<!-- END icq chat -->





var remStat;

function checkRemoteStatus(login,buddy) {

var url='chat.check.init.status.php';
    if (window.XMLHttpRequest) {
        remStat = new XMLHttpRequest();
        remStat.onreadystatechange = processRemStatChange;
        remStat.open("GET", url, true);
        remStat.send(null);

    } else if (window.ActiveXObject) {
        remStat = new ActiveXObject("Microsoft.XMLHTTP");
        if (remStat) {
            remStat.onreadystatechange = processRemStatChange;
            remStat.open("GET", url, true);
            remStat.send();
        }
    }
}

function processRemStatChange() {
    if (remStat.readyState == 4) {
        if (remStat.status == 200) {

hideLayer('displayLoading');
//remStat.responseText;
        }
    }
}


function selectCountry(what) {
f = document.advform;
if(what<14){f.country.selectedIndex=37;}else{f.country.selectedIndex=1;}
}



function calcHeight(w) {
var f=document.forms[w];
f.heightcms.value=Math.round((parseInt(f.heightfeet.value)*30.48))+Math.round((parseInt(f.heightinch.value)*2.54));
}



function calcHeight2(w) {
var f=document.forms[w];
f.heightcms2.value=Math.round((parseInt(f.heightfeet2.value)*30.48))+Math.round((parseInt(f.heightinch2.value)*2.54));
}






function calc(w) {
var f=document.forms[w];
f.weightLbs.value=Math.round(parseInt(f.tens.value))+Math.round(parseInt(f.units.value));
f.weightKgs.value=Math.round( (parseInt(f.tens.value)+parseInt(f.units.value))*0.45 );
}



function calc2(w) {
var f=document.forms[w];
f.weightLbs2.value=Math.round(parseInt(f.tens2.value))+Math.round(parseInt(f.units2.value));
f.weightKgs2.value=Math.round( (parseInt(f.tens2.value)+parseInt(f.units2.value))*0.45 );
}



function numChoicesOFF(what,el) {

f=what.ans_choices;
t=what.answer_guide;

if(el.selectedIndex!=1){
f.disabled=true;f.style.backgroundColor='dcdcdc';
t.disabled=true;t.style.backgroundColor='dcdcdc';
}

else{
f.disabled=false;f.style.backgroundColor='ffffff';
t.disabled=false;t.style.backgroundColor='ffffff';
}

}


function chgStyle(what,acct) {

	f=what.loginName;
	t=what.passWrd;
	n=what.newAcctLogin;
	p=what.newAcctPassWrd;
	q=what.newAcctPassWrd2;

	if(acct=="y") {
	f.disabled=false;f.style.backgroundColor='#ffffff';
	t.disabled=false;t.style.backgroundColor='#ffffff';

	n.disabled=true;n.style.backgroundColor='#dcdcdc';
	p.disabled=true;p.style.backgroundColor='#dcdcdc';
	q.disabled=true;q.style.backgroundColor='#dcdcdc';

	alert('Please enter your LOGIN and PASSWORD.');
	f.focus();
	}
	else {
	f.disabled=true;f.style.backgroundColor='#dcdcdc';
	t.disabled=true;t.style.backgroundColor='#dcdcdc';

	n.disabled=false;n.style.backgroundColor='#ffffff';
	p.disabled=false;p.style.backgroundColor='#ffffff';
	q.disabled=false;q.style.backgroundColor='#ffffff';
	what.zipcode.readOnly=false;
	what.email.readOnly=false;

	alert('Please scroll down to create an account.');
	n.focus();
	}

}	


function chkAccount(f,p,l) {
if(p.value.length>0){frames['chkURL'].location.href='chkUrl.php?checkUser=&p='+p.value+'&l='+l.value;}
}



function getInfo4Edit(f,p,l) {
if(p.value.length>0){frames['chkURL'].location.href='chkUrl.php?checkUser=&info4Edit=&p='+p.value+'&l='+l.value;}
}



function chkUserName(l) {
frames['chkURL'].location.href='chkUrl.php?chkUserName=&l='+l.value;
}


function getLoc(w) {
frames['chkURL'].location.href='chkUrl.php?getCS=&z='+w.value;
}





function sendPass2Advertiser(w) {
frames['chkURL'].location.href='chkUrl.php?sendPass2Advertiser=&e='+w.value;
}


function preSelectFormType(w) {
var index = parseInt(w);
document.getElementById("editForm").form_type.selectedIndex=index;

}



function confirmDelete(href) {
var yesDelete=confirm("Are you sure you wish to PERMANENTLY\ndelete this question?\n\nIf you do, it would no longer be available.\n\nTo delete the question click OK, to keep, click Cancel.");
if (yesDelete) {
	document.location.href=href;
}
else {
	return false ;
}
}

function showLarge(img) {
var new_window = window.open('enlarge.php?img='+img,'akindele','width=350,height=350,scrollbars=yes,resizable=yes'); new_window.focus();
}


function chkAdvertiserEmail(f) {
frames['chkURL'].location.href='chkUrl.php?cmd=chkEmail&email='+f.value;
}


function translate(id,h) {

var new_window = window.open('http://'+h+'/translate.php?id='+id,null,'width=650,height=500,scrollbars=yes,resizable=yes'); new_window.focus(); 

}

function doTranslate(id,msgid) {
var new_window = window.open('translate.mbox.php?id='+id+'&msgid='+msgid,null,'width=650,height=500,scrollbars=yes,resizable=yes'); new_window.focus();

}

function doTranslate2(msgid) {
var transl_win = window.open('translate.general.php?msgid='+msgid,'msgTrans','width=750,height=500,scrollbars=yes,resizable=yes'); transl_win.focus();

}

function chkIt(f) {

var isChecked, fieldname;

	for(var i=0; i<6; i++) {
	fieldname='pic'+i;

	   if(f.elements[fieldname].focus) { // if field exists

              if(f.elements[fieldname].checked==true) {
	         isChecked='yes';
	      }
	   }
	}

	if( isChecked == undefined ) { // nothing is checked
	   alert('You must select at least one picture to send.'); 
	   return false; 
	}


	if(f.elements['pic0'].focus) {

	   if(f.sendToA.selectedIndex==0 && f.sendToB.value.length==0){
	      alert("Please select the user to send pictures to,\n\nor type the username.");
	      return false;
	   }
	}
	else { // no picture to send
	return false;
	}

f.submit();
}


function changecolor() {
document.getElementById('warning').style.color = colors[nextcolor++];
nextcolor = nextcolor % colors.length;
document.file_upper.progress.value="You may notice a delay. Be patient.";
}

function showImg(what,sufx) {

var indx = 'im'+sufx;

document.images[indx].src=what.value;

}

function getMsg(canID,cmd) { 

var toUrl = 'saveCannedLetter.php?canID='+canID+'&cmd='+cmd;
//document.getElementById("cannedLtr").location.replace(toUrl);
//document.getElementById("cannedLtr").src=toUrl;
//window.frames["cannedLtr"].location.href=toUrl;
frames["cannedLtr"].location.href=toUrl;

}

function delMsg(canID,cmd) { 
   if(confirm('Are you sure you want to delete this letter?')){
   frames["cannedLtr"].location.href='saveCannedLetter.php?canID='+canID+'&cmd='+cmd;
   }
}

function openEditWin(canID,cmd) { 
var w=460, h=350;
var page = "saveCannedLetter.php?canID="+canID+"&cmd="+cmd;
var new_window = window.open(page,null,'width='+w+',height='+h+',scrollbars=yes,resizable=yes'+getOffset(w,h)); new_window.focus();

}

function addImg(img,f,affil,priv,l) {
var u = "/"+affil+"/"+l+"/"+priv+"/"; var imgLoc = u+"tn_"+img; var bigImg = u+img+"&ot="+l;

if(img.length>0){f.descr.value+="<a href=# onClick=\"showLarge('"+bigImg+"');\"><img src='/images"+imgLoc+"' /></a><p>";}

}


function process(t) {t.sendit.disabled=true;setInterval('changecolor();',500);t.submit();}

function chkThis(what) {
     if(what.elements[0].selectedIndex==0&&what.elements[1].selectedIndex==0&&what.elements[2].selectedIndex==0&&what.elements[3].selectedIndex==0&&what.elements[4].selectedIndex==0&&what.elements[5].selectedIndex==0) {
alert("You must select at least one picture");return false;
}
what.submit();
}

function more() {
var w = window.open('more.search.php','','scrollbars,width=550,height=500,resizable=yes,screenX=0,screenY=0,top=0,left=0'); w.creator=self; w.focus(); return(false);
}

function captureLangs(t,c) {
var v=Parent_Window.advfrm.langs; v.value=t.selectedIndex+':'+v.value; c.value=c.value+t.options[t.selectedIndex].text+'\n';
}

function captureNtrsts(t,c) {
var v=Parent_Window.advfrm.ntrsts; v.value=t.selectedIndex+':'+v.value; c.value=c.value+t.options[t.selectedIndex].text+'\n';
}

function captureOccups(t,c) {
var v=Parent_Window.advfrm.occups; v.value=t.selectedIndex+':'+v.value; c.value=c.value+t.options[t.selectedIndex].text+'\n';
}

function captureHoros(t,c) { 

Parent_Window.advfrm.horos.value=t.selectedIndex; 
c.value=t.options[t.selectedIndex].text;

}

function doLangsBool(c) {
Parent_Window.advfrm.langsBool.value=c.options[c.selectedIndex].value; 
}

function doOccupsBool(c) {
Parent_Window.advfrm.occupsBool.value=c.options[c.selectedIndex].value; 
}

function doNtrstsBool(c) {
Parent_Window.advfrm.ntrstsBool.value=c.options[c.selectedIndex].value; 
}

function doHorosBool(c) {
Parent_Window.advfrm.horosBool.value=c.options[c.selectedIndex].value; 
}

function sendMoreOptsForm() {
Parent_Window.advfrm.submit();window.close(); 
}


function getRandom(min,max) { // random number b/w min and max
   return (Math.round(Math.random()*(max-min)))+min;
}
//Note: call the function with: var myLoNumber = 15, var myHiNumber = 35;

// myRandomNumber = function getRandom(myLoNumber,myHiNumber);



// the below displays bars incrementally.  Call function with cntdown();
/*
<form name='myform'>
Processing Login <input type=text name='mytext' style='font-family:arial;font-size:8pt;font-weight: 900;background-color:ffffff; width:120px; height:15px; border:0px;' disabled>
</form>
Use php to generate random numbers: $secs = rand(1, 12); $usecs = intval($secs."00")/3;
*/
var newcount = '|';
var the_timeout;
function cntdown()
{
	document.myform.mytext.value=newcount;
	newcount += '|';
	the_timeout = setTimeout('cntdown();', $usecs);
}

function doHide(w) {
if( w.checked == true ){ alert('\n\n\nYou have chosen to be invisible.\n\nYou will appear as offline to other users,\nand they cannot chat with you live.\n\n\n'); 
return;
}
}




// do rpc call

var conn;

function doXmlRpcCall(qString) {

var url4 = 'chat.date.chk.php?'+qString;

    if (window.XMLHttpRequest) {
        conn = new XMLHttpRequest();
        conn.onreadystatechange = chatFileDateChk;
        conn.open("GET", url4, true);
        conn.send(null);

    } else if (window.ActiveXObject) {
        conn = new ActiveXObject("Microsoft.XMLHTTP");
        if (conn) {
            conn.onreadystatechange = chatFileDateChk;
            conn.open("GET", url4, true);
            conn.send();
        }
    }
}

function chatFileDateChk() {

    if (conn.readyState == 4) {
        if (conn.status == 200) {

		var f = top.frames['msgchkr'].document.forms['lastmod'];
		if(!f) {;}else{
		f.elements['secs'].value=conn.responseText;
		document.getElementById("showTime").innerText=conn.responseText;
		}
        } 
    }
}

// end rpc call

// do post-chat cleanup (end chat monitor)

var pointer;

function del0ByteFile(who,sid) { // called with onUnload in buddydisplay.php

var url5 = 'chatDel0ByteFile.php?login='+who+'&sessid='+sid;

window.open(url5,'kleanup','width=1,height=1');
}

// end do post-chat cleanup (end chat monitor)



function getBrowserSize(dimension) {
//opera Netscape 6 Netscape 4x Mozilla 
	if (window.innerWidth || window.innerHeight){ 
		if(dimension=="h") {
			docsize = window.innerHeight;
		}
		else if(dimension=="w"){
			docsize = window.innerWidth; 
		}
	} 
//IE Mozilla 
	if (document.body.clientWidth || document.body.clientHeight){ 
		if(dimension=="h") {
			docsize = document.body.clientHeight;
		}
		else if(dimension=="w"){
			docsize = document.body.clientWidth; 
		}
	} 
return(docsize);
}



function processInput(elmt) {

while(''+elmt.value.charAt(0)==' ') elmt.value=elmt.value.substring(1,elmt.value.length);
var e=top.frames['hiddenwin'].document.forms['theForm']; e.elements['msg'].value=elmt.value;
if(e.elements['msg'].value!=''){ e.submit(); elmt.value=''; elmt.focus();}

}

function oSavChat(s,l,a) {

var new_window = window.open('chatEditBuddy.php?cmd=sav&sessid='+s+'&login='+l+'&author='+a,'akindele','width=350,height=100,screenX=400,screenY=400,top=400,left=400,resizable=yes'); 
new_window.focus(); return(false);
}


function sendForm(w) {
document.forms["sortOrder"].elements["sort"].value=w.options[w.selectedIndex].value;
document.forms["sortOrder"].submit();
}

function goChatWin(l,a,f,t,s,i) {

var nu_chat_win = window.open('chat3.php?login='+l+'&author='+a+'&affil='+f+'&thumb='+t+'&sessid='+s+'&id='+i,a,'width=301,height=550,resizable=yes'); nu_chat_win.focus(); 
}

function showInfo(id) {
var w=650, h=450;
var info_win = window.open('/get.info.msg.php?id='+id,'in4win','width='+w+',height='+h+',resizable=yes,scrollbars=yes'+getOffset(w,h));
info_win.focus();
}

function showArticle(id) {
var w=700, h=450, u = '/get.article.php?id='+id;
var a_win = window.open(u,'in4win','width='+w+',height='+h+',resizable=yes,scrollbars=yes'+getOffset(w,h));
a_win.focus();
}




function openWin(url,w,h,r,s,n) {
if(n=='') {n='genericWin';}
//w=width.h=height,r=resizable,s=scrollbars
var genericWin = window.open(url,n,'width='+w+',height='+h+',resizable='+r+',scrollbars='+s+getOffset(w,h));
genericWin.focus();
}

var zipCon;

function chkFilterZip(w) {

var url='chk.filter.zip.php?zip='+w;
    if (window.XMLHttpRequest) {
        zipCon = new XMLHttpRequest();
        zipCon.onreadystatechange = processZipChk;
        zipCon.open("GET", url, true);
        zipCon.send(null);

    } else if (window.ActiveXObject) {
        zipCon = new ActiveXObject("Microsoft.XMLHTTP");
        if (zipCon) {
            zipCon.onreadystatechange = processZipChk;
            zipCon.open("GET", url, true);
            zipCon.send();
        }
    }
}

function processZipChk() {
var zip = document.filterForm.zip_code;
    if (zipCon.readyState == 4) {
        if (zipCon.status == 200) {

var resp = zipCon.responseText;

	   if(resp=='e') {
	   alert('The zip code ( '+zip.value+' ) was not found in our database.');
	   zip.value='';
	   }
	   else {
	   var warn = 'The zip code ( '+zip.value+' ) corresponds to ( '+resp+' )';
	   warn += '\n\nIf this is not correct, please check what you typed.';
           alert(warn);
	   }

        }
    }
}


function ischeckd4Dwnld (w) {

var isChecked;
for(i=0; i<document.forms[w].elements.length; i++) {

 if(document.forms[w].elements[i].checked==true) { isChecked = 'yes'; }
 if(isChecked == 'yes') { break; }
}
if( isChecked == undefined ) {
 alert('You have not selected any messages to download'); return false; 
}

}

function ischekd4move(w) {
var isChecked;
for(m=0; m<document.forms[w].elements.length; m++)
{
 if(document.forms[w].elements[m].checked==true) { isChecked = 'yes'; }
 if(isChecked == 'yes') { break; }
}
if( isChecked != undefined )
{ 
return confirm('Click OK to complete the move, or Cancel to abort.'); }
else
{
 alert('Please select the Messages to move.\n\nUse the CHECKBOXES on the left.'); return false; 
}


}


function cCount(f) {
// completenessCount
var obj = document.forms['s4'].elements['completenessCount'];
obj.value=parseInt(obj.value)+1;
}



function chkAgeMin(v,n) {
var v=parseInt(v), n=parseInt(n);
if(v<18){document.filterForm.age_min.value=18;}
if(v>n){document.filterForm.age_min.value=n;}

}

function chkAgeMax(v,n) {
var v=parseInt(v), n=parseInt(n);
if(v<n){document.filterForm.age_max.value=n;}
}


function updateConf() {

var f = document.customise; 

var a = f.textcolor.value, c = f.backgroundcolor.value;
var d = f.fontnames.value, x = f.fontsize.value;

var g = f.borderSize, k = g.options[g.selectedIndex].value;

var h = f.borderColor.value, i = f.borderStyle;
var j = i.options[i.selectedIndex].value;

var m = 'border:'+k+'px '+j+' #'+h+';font-family:'+d+';font-size:'+x+'px;color:#'+a;
var n = 'background-color:#'+c+';border:0px;';



document.getElementById("testConf").innerHTML = 'Preview:<p><table cellspacing="0" cellpadding="1" style="'+m+'"><tr><td style="'+n+'"><img src="http://www.oasisoflove.com/images/oasis/allday/tn_0c73.jpe" border="1" /></td><td  style="'+n+'">Nick: <b>veronique</b><br /> ISO: Straight Male<br />City: Las Vegas<br />State: NV<br /> United States<br />Age: 20<br /> <font color=blue>More Info</font>..</td></tr></table>';

}


function getNdx() {
var f = document.locForm;
f.ndx.value=f.cscSent.selectedIndex;
}

function getRandom(min, max) {		
	var randomNum = Math.random() * (max-min); 
	return(Math.round(randomNum) + min); 
}


function hid(what) {
what.style.visibility="hidden";
}


function popCSC(W,f) {

var wX = w.selectedIndex, p = f.zipcode;

   if(p.value.length>0 && wX!=1){
      p.value='';
   }

   if(p.value.length==0 && wX==1){
      p.focus();
   }
   f.cty.value=wX;f.submit.disabled=false;

   if(wX>1){

      f.tempCtry.value=f.country.options[wX].text;

      if(wX!=223&&wX>0){
         showLayer('myLayer');
      }

      f.submit.disabled=true;f.city.focus();
   }
}

function goTo(a) {
document.location.href=a;
}



function popGen(url,w,h) {

var h_win = document.open(url,'genWin','width='+w+',height='+h+',left=10,top=40,scrollbars=yes,resizable=yes');  h_win.creator=self; h_win.focus();

}

function regNdx(f) {
var c = f.country;
f.distance.selectedIndex = 0;
f.zip_code.value='';
   if(f.state.selectedIndex<14) { 
      c.selectedIndex=39;}else{c.selectedIndex=1;
   }
}

function valMin(f) {
var e = f.age_min, v=parseInt(e.value);
   if(v<18) { 
      e.value=18;
   }
valMax(f);
}


function valMax(f) {
var v=parseInt(f.age_max.value), n=parseInt(f.age_min.value);
   if(v<n) {
      f.age_max.value=n;
   }
}



function vFrm(f) {
if(f.city.value.length>0 && f.state.value.length>0 ){f.submit.disabled=false;f.submit.click();}else{alert('You must type your CITY and STATE');return(false);}
}

function vCtry(f,tloc,mysel) {

	if(tloc.length>0) {
		
		var contry = "";
		switch(mysel) {
			case "223": contry = "the USA"; break;
			case "38": contry = "Canada"; break;
			case "222": contry = "the United Kingdom"; break;
			case "13": contry = "Australia"; break;
		}
		
		var msg_alert = "Your true location is "+tloc+" but you claim to be from "+contry+".\n";
		msg_alert += "Please declare your correct location.";
		alert(msg_alert); document.location.href='/register.php';
	}

   var p=f.zipcode, c=f.country, cN=c.options[c.selectedIndex].text;
   if(p.value.length>0 && cN!="United States") {
      p.value='';
   }
   if(p.value.length==0 && cN=="United States") { 
      document.getElementById('zipDiv').style.visibility="visible";hideLayer('myLayer');
      document.images['arrow'].src = '/images/down_animated.gif';
      p.disabled=false; p.focus();
   }
   f.cty.value=c.selectedIndex;
   f.submit.disabled=false;
   if(c.selectedIndex>1) { 
      f.tempCtry.value=cN;
      if(c.selectedIndex>0 && cN!="United States") { 
         document.getElementById('zipDiv').style.visibility="hidden";
         showLayer('myLayer'); 
         document.images['arrow'].src = '/images/down_animated.gif';
         f.city.focus(); p.disabled=true; 
      }
   f.submit.disabled=true;
   }
}






function vSubmt(f) {
var e='Please enter a zipcode OR select your country';
var c=f.country.selectedIndex, z=f.zipcode; 

   if(c==0) { alert(e); z.focus(); return false; } 

   if(z.value.length==0 && (c==0||c==1)){ alert(e); z.focus(); return false; }
}



function saveSelect(selIndex, GMTString)
{
	var the_cookie = "selIndex=" + selIndex;
	the_cookie = the_cookie + ";expires=" + GMTString;
	the_cookie = the_cookie + "path=/;";
	the_cookie = the_cookie + "domain=oasisoflove.com;";
	document.cookie = the_cookie;
}





