$jtq = jQuery.noConflict();	// Make sure our implementation doesn't conflict with anyone elses

$jtq(document).ready(function() {
	$jtq("input[type='button'], input[type='submit'], .comment_reply_button").hover(
		function () {
			$jtq(this).addClass("button_hover");
		}, 
		function () {
			$jtq(this).removeClass("button_hover");
		}
	);
		
}
);

// Just a shortcut function
function get(id){
	return document.getElementById(id);
}

// Use - onkeydown="if (isEnter(event)) something"
function isEnter(e){ //e is event object passed from function invocation
	var characterCode //literal character code will be stored in this variable
	
	if (window.event)
		ccode = e.keyCode
	else if (e.which)
		ccode = e.which
	if (ccode == 13)
		return true;
	else
		return false;
}


function block_off(id)
{
	$jtq("#"+id).hide();
}


function block_on(id)
{
	$jtq("#"+id).show();
}

// ID is the id of the element to attach to

//**************
// Given a select tag's id, change its selected value to the sent value (if there's an option in the list matching that value)
//**************
function selecter(select_id, value)
{
	optLen = get(select_id).options.length;
	for (i=0;i < optLen;i++)
	{
		if (get(select_id).options[i].value == value)
		{
			get(select_id).options[i].selected = true;
			return;
		}
	}
}


//**************
// Given a select tag's id, change its selected value to the sent value (if there's an option in the list matching that value)
//**************
function get_selected(select_id)
{
    selected = get(select_id).selectedIndex;
    return get(select_id).options[selected].value;
}


//**************
// Used for AJAX
//**************
function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
} 
