function bRoll2(itemName,itemState) {
	if(itemState==1){
			itemName.className='msgButtonRoll';
	} else {
			itemName.className='msgButton';
	}
}

function ResendMailNofify(popURL, cid) {	
	popURL += '?w=6&p='+cid;	
	window.open(popURL, 'tbPop3', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=200');
}
// opens the avatar gallery
function galPop(popURL) {
	popURL +='?w=8';
	window.open(popURL,'tbPop4','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=440');
}
// opens the avatar gallery
function galPop2(popURL,u) {
	popURL +='?u='+u;
	window.open(popURL,'tbPop4','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=440');
}
// openes the avatar upload form
function avPop(popURL) {
	window.open(popURL,'tbPop5','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=450,height=200');
}
// openes the avatar upload form
function avPop2(popURL,u) {
	popURL +='?u='+u;
	window.open(popURL,'tbPop6','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=450,height=200');
}
// marks forum read
function markRead(popURL) {
	window.open(popURL,'tbPop7','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=350,height=150');
}

// shows the attachment upload
function fileUp(popURL) {
	window.open(popURL,'filePop','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=550,height=450');	
}

// shows the PM user lookup
function TBUserLookup(popURL) {	
	popURL += '?w=4';	
	window.open(popURL, 'tbPop2', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=325');
}

// forum quick jump
function quickJ(aPath) {
	if (aPath!='0')
		window.location.href=aPath;
}

// pm select/deselect all checkboxes...
function doCheckboxes() {
	var nVal=document.pmlist.pmcall.checked;
//	alert(nVal);
	for (var i=0;i<document.pmlist.elements.length;i++) {
		var e = document.pmlist.elements[i];
		if ((e.name == 'pms') && (e.type=='checkbox')) {
			e.checked=nVal;
		}
	} 

}

// pm check for delete
function checkDelete(eod) {
	var dCount=0;
	for (var i=0;i<document.pmlist.elements.length;i++) {
		var e = document.pmlist.elements[i];
		if ((e.name == 'pms') && (e.type=='checkbox')) {
			if(e.checked==true) {
				dCount += 1;
			}
		}
	} 
	if(dCount==0) {
		alert('You must select the messages you want to delete!');
	} else {
		document.pmlist.eod.value=eod;
		document.pmlist.submit();
	}
}

// pm check for reply
function checkReply() {
	var dCount=0;
	for (var i=0;i<document.pmlist.elements.length;i++) {
		var e = document.pmlist.elements[i];
		if ((e.name == 'pms') && (e.type=='checkbox')) {
			if(e.checked==true) {
				dCount += 1;
			}
		}
	} 
	switch(dCount) {
		case 0: {
			alert('You must select the message you want to reply to!');	
			break;			
		}
		case 1: {
			document.pmlist.eod.value='ri';
			document.pmlist.submit();
			break;
		}
		default: {
			alert('You can select only 1 message for replies!');	
			break;			
		}		
	}
	
}

// pm check for forward
function checkForward() {
	var dCount=0;
	for (var i=0;i<document.pmlist.elements.length;i++) {
		var e = document.pmlist.elements[i];
		if ((e.name == 'pms') && (e.type=='checkbox')) {
			if(e.checked==true) {
				dCount += 1;
			}
		}
	} 
	if(dCount==0) {
		alert('You must select at least one message to forward!');	
	} else {
		document.pmlist.eod.value='fw';
		document.pmlist.submit();
	}	
}

// pm get filtered member list for sending
function sendFilter(fChar) {
	document.fForm.ml.value=fChar;
	document.fForm.submit();
}

// pm name list passback
function sendNamesToParent() {
	var nLen=document.dForm.uDrop.length;
	if (nLen==0){
		alert('You did not select any names to be added!');
	} else {
		var nStr='';
		var i;
		for (i=0;i<nLen;i++) {
			if (i>0) {
				nStr += ',' + document.dForm.uDrop[i].value;
			} else {
				nStr += document.dForm.uDrop[i].value;
			}
		}
		window.opener.document.pForm.uName.value=nStr;
		window.close();
	}
}

// New in v2.4 : processes thread subscriptions
function doSubscribe(popURL) {
	window.open(popURL,'tbPop10','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=350,height=150');
}

// updated in v2.4 : Moved from TBform.js
function TBTagsHelp(popURL) {		
	window.open(popURL, 'tbPop', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=410');
}

