function show_comment(the_id){	var show_id_str = "cmnt_full_"+the_id;	var hide_id_str = "cmnt_pre_"+the_id;	document.getElementById(show_id_str).style.display="block";	document.getElementById(hide_id_str).style.display="none";}function hide_comment(the_id){	var show_id_str = "cmnt_pre_"+the_id;	var hide_id_str = "cmnt_full_"+the_id;	document.getElementById(show_id_str).style.display="block";	document.getElementById(hide_id_str).style.display="none";}function show_comm_form(the_id){	document.getElementById("add_comment_button_"+the_id).style.display="none";	document.getElementById("comm_form_"+the_id).style.display="block";}function hide_comm_form(the_id){	document.getElementById("add_comment_button_"+the_id).style.display="block";	document.getElementById("comm_form_"+the_id).style.display="none";}function close_warning(){	document.getElementById("warning").style.display="none";}function record_rating(the_rating,c_id,r_id){	xmlhttp=null;	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){		var url = "record_rating.php?c="+c_id+"&r="+r_id+"&rat="+the_rating; 		xmlhttp.onreadystatechange=state_Change(the_rating);		xmlhttp.open("GET",url,true);/*		// for testing...		xmlhttp.onreadystatechange=function() {		   if (xmlhttp.readyState==4) {			   var testwin = window.alert(xmlhttp.responseText);		   }		}*/				xmlhttp.send(null);		var new_img = "<img src='/images/rating/"+the_rating+"-stars.gif' width='74' height='14' border='0' id='stars'> <div id='status_report' style='display:inline;'></div>";		document.getElementById("star_div").innerHTML = new_img;		document.getElementById("status_report").innerHTML = "<em>Recorded</em>";	}else{		  alert("Your browser does not support XMLHTTP.");		}}function state_Change(the_rating){	if (xmlhttp.readyState==4){// 4 = "loaded"			window.alert("state_Change 4");	 		 if (xmlhttp.status==200){// 200 = OK		 		 }else{			window.alert("Problem retrieving XML data");		 		 }	 	}}//// scripts for resources "send to a colleague" box//function show_box(box,trigger){//	window.alert("box: "+box+", trigger: "+trigger);	var box_left_offset = -250;	var box_top_offset = 40;	var the_trigger = trigger;	var trig_left = trig_top = 0;	var trig_width = parseInt(the_trigger.offsetWidth);		while(the_trigger != null){		trig_left += the_trigger.offsetLeft;		trig_top += the_trigger.offsetTop;		the_trigger = the_trigger.offsetParent;	}	var the_box = document.getElementById(box);		the_box.style.display = "block";	var box_width = parseInt(the_box.offsetWidth);		var new_x = trig_left + box_left_offset;	var new_y = trig_top + box_top_offset;		if(box == "tell_a_friend_box"){		box_top_offset = box_width - trig_width;	}			the_box.style.top = new_y + "px";//	the_box.style.left = "500px";	the_box.style.left = new_x + "px";//	window.alert("trig_width: "+trig_width+"; trig_left: "+ trig_left +"; x: "+new_x + "; Y: "+new_y);	document.getElementById('send_btn').focus();}function hide_box(box){	var the_box = document.getElementById(box);	var the_content = document.getElementById("friend_content");	the_box.style.display = "none";	the_content.innerHTML = "<h3 style='margin:0 0 5px; 0;'>Send to a Colleague</h3>  <form onSubmit=\"sendFriend()\" id='friend_form' action='javascript:;'>  <div><label for='s_name'>Your Name</label> <input type='text' name='s_name' id='s_name' ></div>  <div><label for='s_email'>Your Email</label> <input type='text' name='s_email' id='s_email' ></div>  <div><label for='f_name'>Colleague's Name</label> <input type='text' name='f_name' id='f_name' ></div>  <div><label for='f_email'>Colleague's Email</label> <input type='text' name='f_email' id='f_email' ></div>  <label for='msg'>Message</label><br />  <textarea id='msg' name='msg' style='width:300px;height:50px;'></textarea><br />  <input type='submit' value='Send Message' id='send_btn'>  </form>";}function sendRequest(url,callback,postData) {	var req = createXMLHTTPObject();	if (!req) return;	var method = (postData) ? "POST" : "GET";	req.open(method,url,true);	req.setRequestHeader('User-Agent','XMLHTTP/1.0');	if (postData)		req.setRequestHeader('Content-type','application/x-www-form-urlencoded');	req.onreadystatechange = function () {		if (req.readyState != 4) return;		if (req.status != 200 && req.status != 304) {//			alert('HTTP error ' + req.status);			return;		}		callback(req);	}	if (req.readyState == 4) return;	req.send(postData);}var XMLHttpFactories = [	function () {return new XMLHttpRequest()},	function () {return new ActiveXObject("Msxml2.XMLHTTP")},	function () {return new ActiveXObject("Msxml3.XMLHTTP")},	function () {return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject() {	var xmlhttp = false;	for (var i=0;i<XMLHttpFactories.length;i++) {		try {			xmlhttp = XMLHttpFactories[i]();		}		catch (e) {			continue;		}		break;	}	return xmlhttp;}function handleFriend(req) {	var writeroot = document.getElementById("friend_content");	writeroot.innerHTML = req.responseText;}function sendFriend(){	the_form = document.getElementById("friend_form");	var s_name = the_form.elements["s_name"].value;	var s_email = the_form.elements["s_email"].value;	var f_name = the_form.elements["f_name"].value;	var f_email = the_form.elements["f_email"].value;	var msg = the_form.elements["msg"].value;	var the_rsrc = the_form.elements["the_rsrc"].value;	var rqst_link = "/resources/send_friend.php";	var postData = "s_name="+s_name+"&s_email="+s_email+"&f_name="+f_name+"&f_email="+f_email+"&msg="+msg+"&the_rsrc="+the_rsrc;	sendRequest(rqst_link,handleFriend,postData);	}
