// generic javascript function BrowserCheck() { var b = navigator.appName if (b == "Netscape") { this.b = "ns"; } else if (b == "Microsoft Internet Explorer") { this.b = "ie"; } else this.b = b; this.version = navigator.appVersion; this.v = parseInt(this.version); this.ns = (this.b == "ns" && this.v >= 4); this.ns4 = (this.b == "ns" && this.v == 4); this.ns5 = (this.b == "ns" && this.v == 5); this.ie = (this.b == "ie" && this.v >= 4); this.ie4 = (this.version.indexOf('MSIE 4') > 0); this.ie5 = (this.version.indexOf('MSIE 5') > 0); this.ie6 = (this.version.indexOf('MSIE 6') > 0); this.min = (this.ns || this.ie); } is = new BrowserCheck(); function showdiv(divid) { var elementid = document.getElementById(divid); if (elementid != null) { elementid.style.visibility = "visible"; elementid.style.display = "block"; } } function hidediv(divid) { var elementid = document.getElementById(divid); if (elementid != null) { elementid.style.visibility = "hidden"; elementid.style.display = "none"; } } function updatediv(location, element, display) { if (location == "opener") { var elementid = window.opener.document.getElementById(element); } else if (location == "parent") { var elementid = window.parent.document.getElementById(element); } else if (location == "self") { var elementid = document.getElementById(element); } if (elementid != null) { elementid.innerHTML = display; elementid.style.display = "inline"; } } function setepoch() { var epoch; epoch = new Date(); epoch = Math.round(epoch.valueOf() / 1000); return epoch; } function uploader(scripturl, senddata) { var sendstring, postsuccess, httpRequest; scripturl += "?epoch="+ setepoch(); sendstring = ""; postsuccess = false; for (var key in senddata) { if (sendstring.length == 0) { sendstring += ""; } else { sendstring += "&"; } sendstring += "formdata["+ escape(key) +"]="+ escape(senddata[key]); } if (window.XMLHttpRequest) { httpRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { httpRequest = new ActiveXObject('Microsoft.XMLHTTP'); } if (httpRequest && httpRequest.readyState != 0) { alert("Uploader failed: "+ httpRequest.statusText); window.status = "send failed"; httpRequest.abort(); } httpRequest.open("POST",scripturl,true); httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); httpRequest.setRequestHeader("User-Agent","spoofed agent"); httpRequest.onreadystatechange = function() { if (httpRequest.readyState == 4 && httpRequest.responseText) { if (httpRequest.responseText.charAt(0) != "<") { if (httpRequest.statusText == "OK") { window.status = "done"; if (senddata["callback"]) { return eval(senddata["callback"] +"(httpRequest.responseText);"); } } else { alert("Uploader failed: "+ httpRequest.statusText); window.status = "send failed"; httpRequest.abort(); return false; } } else { alert("Uploader failed: "+ httpRequest.statusText); window.status = "send failed"; httpRequest.abort(); return false; } } } window.status = "sending..."; httpRequest.send(sendstring); } function floattostr(data) { data = parseFloat(data); if (data < 0) { data *= -1; var sign = true; } var intpart = Math.floor(data); var floatpart = Math.floor((data - intpart) * 1000); floatpart = Math.round(floatpart / 10); if (floatpart < 10) { floatpart = "0"+ floatpart; } if (floatpart >= 100) { intpart++; floatpart = "00"; } if (sign == true) { intpart *= -1; } return intpart +"."+ floatpart; } function flop(element) { var elm = document.forms[0].elements[element]; if (elm.checked == true) { elm.checked = false; } else { elm.checked = true; } } function clickwindow(url, windowname, width, height) { view_window = window.open(url,windowname,"location=0,width="+ width +",height="+ height +",toolbar=0,scrollbars=1,resizable=1,history=0,status=1"); view_window.focus(); } function formwindow(windowname, formname, width, height) { var windowobj = window.open("blank.htm", windowname, "location=0,width="+ width +",height="+ height +",toolbar=0,scrollbars=1,resizable=1,history=0,status=1"); //if (!windowobj_.opener) { windowobj_.opener = self; } //whoiswin_.moveTo((screen.width-640)/2, (screen.height-480)/2); document.forms[formname].target = windowname; document.forms[formname].submit(); windowobj.focus(); return true; } function closeself(closesec) { window.status = "Closing: "+ closesec; document.title = "Closing: "+ closesec; if (closesec <= 0) { window.close(); } closesec--; setTimeout("closeself("+ closesec +")",1000); } function copyformfields(formname, formelement, start, times, skip) { var form = document.forms[formname]; var type = formelement.type; var end = start + (times * skip); for (var counter = start; counter < end; counter += skip) { if (form.elements[counter].type == type) { if (type == 'checkbox' || type == 'radio') { form.elements[counter].checked = formelement.checked; } if (type == 'select-one') { form.elements[counter].options[formelement.selectedIndex].selected = formelement.value; } if (type == 'text' || type == 'textarea') { form.elements[counter].value = formelement.value; } } } } function preload_images() { if (document.images) { var load_image = new Array(); for (var i = 0; i < image_list.files.length; i++) { load_image[i] = image_obj(image_list.files[i]); } image_list.preloaded = true; } } function image_obj(image_src) { var new_image; new_image = new Image(); new_image.src = image_src; return new_image; } function btn_hover(e) { var event_target; if (!e) var e = window.event; if (e.target) { event_target = e.target; } else if (e.srcElement) { event_target = e.srcElement; } if (event_target) { // fix safari bug if (event_target.nodeType == 3) {event_target = event_target.parentNode; } btn_class = 'btn '; if (event_target.tagName == 'INPUT' && event_target.className.indexOf(btn_class) == 0) { // button type btn_type = event_target.className.slice(btn_class.length, event_target.className.length); // update button switch (btn_type) { case 'std': event_target.className = btn_class + 'std_on'; break; case 'std_on': event_target.className = btn_class + 'std'; break; case 'alt': event_target.className = btn_class + 'alt_on'; break; case 'alt_on': event_target.className = btn_class + 'alt'; break; case 'opt': event_target.className = btn_class + 'opt_on'; break; case 'opt_on': event_target.className = btn_class + 'opt'; break; } } } } function toggle_info(target_node) { target_parent = target_node.parentNode.parentNode; div_nodes = target_parent.getElementsByTagName('DIV'); for (var i = 0; i < div_nodes.length; i++) { if (div_nodes[i].className == 'more_info') { if (div_nodes[i].style.display == '' || div_nodes[i].style.display == 'none') { div_nodes[i].style.display = 'block'; } else { div_nodes[i].style.display = 'none'; } } } } function initclock(year, month, day, hour, min, sec) { mytime = new Date(); mytime.setUTCFullYear(year,month - 1,day); mytime.setUTCHours(hour,min,sec); } function setclock(location, element) { mytime.setUTCMilliseconds(1000); setTimeout("setclock('"+ location +"','"+ element +"')",1000); regex = /.{3}, (\d{1,2}) .{3} (\d{4}) (\d{2}):(\d{2}):(\d{2}) .{3}/; regex.exec(mytime.toUTCString()); var year = RegExp.$2; var month = mytime.getUTCMonth() + 1; var day = RegExp.$1; var hour = RegExp.$3; var min = RegExp.$4; var sec = RegExp.$5; if (month < 10) { month = "0"+ month; } if (day.length < 2) { day = "0"+ day; } datestring = year+ "-"+ month +"-"+ day +" "+ hour +":"+ min +":"+ sec; updatediv(location, element, datestring); } var IFrameObj; // our IFrame object function callToServer(URL) { if (typeof(loaded)=='undefined' || loaded!=true) { setTimeout('callToServer("'+URL+'")',10); return false; } // alert ("We are loaded"); loaded = false; if (!document.createElement) {return true}; var IFrameDoc; if (!IFrameObj && document.createElement) { // create the IFrame and assign a reference to the // object to our global variable IFrameObj. // this will only happen the first time // callToServer() is called try { var tempIFrame=document.createElement('iframe'); tempIFrame.setAttribute('id','RSIFrame'); tempIFrame.style.border='0px'; tempIFrame.style.width='0px'; tempIFrame.style.height='0px'; if (typeof(tempIFrame.document) != "undefined") { // IE tempIFrame.document.location='https://'+document.domain+'/blank.htm'; } else { // Mozilla tempIFrame.src='https://'+document.domain+'/blank.htm'; } IFrameObj = document.body.appendChild(tempIFrame); if (document.frames) { // this is for IE5 Mac, because it will only // allow access to the document object // of the IFrame if we access it through // the document.frames array IFrameObj = document.frames['RSIFrame']; } } catch(exception) { // This is for IE5 PC, which does not allow dynamic creation // and manipulation of an iframe object. Instead, we'll fake // it up by creating our own objects. iframeHTML='\