<!--

	function changeCheckboxes ( formId, sel ) {
		changeto = sel.checked;
		form = document.forms[formId];
		len = form.length;
		
		for ( i = 0; i < len; i++ ) {
			curr = form.elements[i];
			if ( curr.type == 'checkbox' )
				curr.checked = changeto;
				
			if ( curr.id != "" ) selectRow ( curr );
		}
	}
	
	function selectRow ( checkbox ) {
		sel = checkbox.checked;
		row = document.getElementById ( checkbox.id );
		if ( sel )
			row.className = "selectedRow";
		else
			row.className = "light";
	}
	
	function switchFilter ( object ) {
		location.href = document.getElementById("get_string").value + "&" + object.name + "=" + object.value;
	}
	
	function deleteChecked ( formId, getString ) {
		form = document.forms[formId];
		form.action = "index.php?" + getString;
		q = confirm ( "Are you sure that you want to delete all selected items?" );
		if ( q )
			form.submit();
	}
	
	function postChecked ( formId, getString) {
		form = document.forms[formId];
		form.action = "index.php?" + getString;
		form.submit();
	}
	
	function dropChecked ( formId, getString) {
		q = confirm ( "Are you sure that you want to drop all selected trades?" );
		if ( q ) {
			form = document.forms[formId];
			form.action = "index.php?" + getString;
			form.submit();
		}
	}
	
	function withdrawChecked ( formId, getString) {
		q = confirm ( "Are you sure that you want to withdraw all selected offers?" );
		if ( q ) {
			form = document.forms[formId];
			form.action = "index.php?" + getString;
			form.submit();
		}
	}
	
	function confirmDelete ( destination ) {
		q = confirm ( "Are you sure that you want to delete the selected item?" );
		if ( q )
			window.open(destination, '_parent');
	}
	
	function confirmWithdraw ( destination ) {
		q = confirm ( "Are you sure that you want to withdraw your offer?" );
		if ( q )
			window.open(destination, '_parent');
	}
	
	function confirmDrop ( destination ) {
		q = confirm ( "Are you sure that you want to drop the selected trade?" );
		if ( q )
			window.open(destination, '_parent');
	}
	
	function IsNumeric(strString) {
		var strValidChars = "0123456789";
		
		if (strString.length == 0) return false;
		for (i = 0; i < strString.length; i++) {
			strChar = strString.charAt(i);
			if (strValidChars.indexOf(strChar) == -1) return false;
		}
		
		return true;
	}
	 
	function validateLinks ( form ) {
		error = "";
		if ( !IsNumeric ( form.niche.value ) ) {
			error = error + "Please select a niche from the menu.\n";
		}
		
		if ( form.url.value == "" ) {
			error = error + "Link URL is required.\n";
		}
		
		if ( form.anchor_text.value == "" ) {
			error = error + "Anchor text is required.\n";
		}
		
		if ( form.keywords.value == "" ) {
			error = error + "Please enter at least one keyword.\n";
		}
		
		if ( error != "" ) {
			alert ( error );
			return false;
		}
		
		return true;
	}
	
	// CAPTURE MOUSE X,Y POSITION
	
	function getAbsolutePos ( el ) {
		var r = { x: el.offsetLeft, y: el.offsetTop };
		if (el.offsetParent) {
			var tmp = getAbsolutePos(el.offsetParent);
			r.x += tmp.x - 1;
			r.y += tmp.y;
		}
		return r;
	};
	
	var IE = document.all?true:false
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = getMouseXY;
	var tempX = 0;
	var tempY = 0;
	
	var scrollerX = 0;
	var scrollerY;
	
	function getMouseXY(e) {
		scrollerX = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;
		scrollerY = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;

		if (IE) { 
		tempX = event.clientX + scrollerX;
		tempY = event.clientY + scrollerY;
	  } else {  
		tempX = e.pageX;
		tempY = e.pageY;
	  }  

	  if (tempX < 0){tempX = 0}
	  if (tempY < 0){tempY = 0}

	  return true
	}
	
	// <POPUP MESSAGES>
	
	function showMsg( title, message ) {
		drop = document.getElementById("msgDiv");
		if ( title != "" ) {
			htmlTitle = "<strong id='msgCaption'>" + title + "</strong>\n";
		} else {
			htmlTitle = "";
		}
		
		drop.innerHTML =  htmlTitle + message;
		drop.style.visibility = "visible";
		
		if ( IE ) {
			drop.style.left = tempX + 10;
			drop.style.top = tempY;
		} else {
			drop.style.left = ( tempX + 20 ) + "px";
			drop.style.top = tempY + "px";
		}
	}
	
	function hideMsg() {
		drop = document.getElementById("msgDiv");
		drop.style.visibility = "hidden";
	}
	
	
	function showHelp ( helpId ) {
		msg = helpInfo[helpId];
		if ( msg == "undefined" ) return false;
		
		temp = msg.split("|");
		
		showMsg ( temp[0], temp[1] );
	}
	
	function hideHelp ( ) {
		hideMsg();
	}
	
	// </POPUP MESSAGES>

-->