function getIP() { var ip = '18.119.133.228'; return ip; } // this is consuming too much CPU resource -- looking up each hostname. function getHostname() { var host = '18.119.133.228'; return host; } // color stuff function setColor(clr,el) { el.style.backgroundColor=clr; } // SAVE GET COOKIE // borrowed from: http://www.netspade.com/articles/javascript/cookies.xml // put these in the js, so we don't have to keep redl all this code; etc. function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } function deleteCookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // CALL HTTP IN BACKGROUND var xmlhttp function loadXMLDoc(url) { /* try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) { alert("Permission UniversalBrowserRead denied."); } */ // code for Mozilla, etc. if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest() xmlhttp.onreadystatechange=xmlhttpChange xmlhttp.open("GET",url,true) xmlhttp.send(null) } // code for IE else if (window.ActiveXObject) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") if (xmlhttp) { xmlhttp.onreadystatechange=xmlhttpChange xmlhttp.open("GET",url,true) xmlhttp.send() } } } function xmlhttpChange() { // if xmlhttp shows "loaded" if (xmlhttp.readyState==4) { // if "OK" if (xmlhttp.status==200) { // ...some code here... } else { alert("Problem retrieving XML data") } } } // WRITE TO A DIV function writit(text,id) { if (document.getElementById) { x = document.getElementById(id); x.innerHTML = ''; x.innerHTML = text; } else if (document.all) { x = document.all[id]; x.innerHTML = text; } else if (document.layers) { x = document.layers[id]; // text2 = '

' + text + '

'; // alert(text2) x.document.open(); x.document.write(text); //(text2); x.document.close(); } } // temporary hack until new version is loaded in. function resize(id,newheight, newwidth) { x = getobj(id) x.style.height = newheight; x.style.width = newwidth; // border: solid; border-width:1px; border-color:#e4e4e4; } // we are ending up with lots of duplicate functions... function getobj(id) { if (document.getElementById) { x = document.getElementById(id); } else if (document.all) { x = document.all[id]; } else if (document.layers) { x = document.layers[id]; } return x } // forwarding scripts.. // actually, we want to make it really easy for ppl to "forward" pages by including a js on their page. // functionality for emailing comments var forward_email = ''; // preserve the email address across the page... // save as a cookie, so we can load it up on other pages. // proxy as a background image request. function forward_page(email) { // get the url var page = document.URL; // check for a valid email address first. var cref = 'http://www.studentsreview.com/active/forward_page.php3?email=' + email + '&page=' + page; new Image().src = cref; // set a cookie, so user doesn't keep inputting their friend's email address... var d = new Date(); d.setTime(d.getTime() + 2592000); setCookie('forward_email',email,d,'/','studentsreview.com',0); } function overlib_forward_page() { var text = "Their Email Address:
OK!! Submitted",'submit_notify1_'+formname); } var q = "ds="+source+ "&sid="+sourceid+ "&type="+rtype+ "&email="+email+ "&uid="+uid+ "&response=" + escape(response) + "&response_href=" + escape(response_href); // alert(q); (new Image).src = 'http://www.studentsreview.com/active/add_response.php3?'+q; // add the comment. change the form to show the comment was added. // add the comment into a blank div. }