var chttp;
var cobj

function gall(){
$(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	$("a[rel='gallery']").colorbox({transition:"none", width:"90%", height:"90%"});
	
	//Example of preserving a JavaScript event for inline calls.
	$("#click").click(function(){ 
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
});
}

function c(object, parm) {

	xmlhttp = null;
	cobj = object;

	var parmValue;

	if (parm == "ih" || parm == "cr" || parm == "sh") {
		parmValue = object.checked;
	} else {
		parmValue = escape(object.value);
	}

	// url = "http://www.604bc.ca/picCommenter?id=" + object.id + "&" + parm +
	// "=" + parmValue;  //window.location.href

	var hostLength = window.location.href.lastIndexOf("/");
	var host = window.location.href.substring(0, hostLength);
	
	url = host + "/picCommenter?id=" + object.id + "&" + parm
			+ "=" + parmValue;

//	alert(url);

	if (window.XMLHttpRequest) {
		// code for all new browsers
		xmlhttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		// code for IE5 and IE6
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (xmlhttp != null) {
		xmlhttp.onreadystatechange = state_Change;
		xmlhttp.open("GET", url, true);
		xmlhttp.send(null);
	} else {
		alert("Your browser does not support XMLHTTP.");
	}
}

function state_Change() {
	if (xmlhttp.readyState == 4) {
		// 4 = "loaded"

		if (xmlhttp.status == 200) {// 200 = OK
		// obj.className='menuLink';
		} else {
			alert("Problem retrieving XML data");
		}
	}
}
