// Author: Eric King Url: http://redrival.com/eak/index.shtml // This script is free to use as long as this info is left in // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/ var win = null; function addEngine() { try { window.external.AddSearchProvider("http://www.monova.org/search-plug.xml"); } catch(eObj) { if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) { window.sidebar.addSearchEngine( "http://www.monova.org/search-plug.src", "http://www.monova.org/images/favicon.ico", "MONOVA.ORG", "Web"); } else { alert("We're sorry; but we cannot add our search engine to "+ "your browser.\nWe require Mozilla, Firefox, or IE 7 "+ "to do this."); return true; } } return false; } function ContactCheckEmail(email) { AtPos = email.indexOf("@") StopPos = email.lastIndexOf(".") MaxLength = email.length; Message = "" if (email == "") { Message = "" } else if (AtPos == -1 || StopPos == -1) { Message = "" } else if (StopPos < AtPos) { Message = "" } else if (StopPos == MaxLength-1) { Message = "" } else if (StopPos - AtPos == 1) { Message = "" } else { Message = "" } return Message } function MailCheck(pass, pass2) { var display = ""; if (pass2 == "") { display = "\"X\""; } else if (pass == "") { display = "\"X\""; } else if(pass == pass2) { display = "\"V\""; } else { display = "\"X\""; } return display } function PassCheck(pass, pass2) { var display = ""; if(pass != pass2) { display = "\"X\""; } if(pass == pass2) { display = "\"V\""; } if(pass == "") { display = "\"X\""; } return display } function CheckPass(pass) { MaxLength = pass.length; Message = "" if (MaxLength >= 6) { Message = "\"V\"" } else { Message = "\"X\"" } return Message } function CheckEmail(email) { AtPos = email.indexOf("@") StopPos = email.lastIndexOf(".") MaxLength = email.length; Message = "" if (email == "") { Message = "\"X\"" } else if (AtPos == -1 || StopPos == -1) { Message = "\"X\"" } else if (StopPos < AtPos) { Message = "\"X\"" } else if (StopPos == MaxLength-1) { Message = "\"X\"" } else if (StopPos - AtPos == 1) { Message = "\"X\"" } else { Message = "\"V\"" } return Message } function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) } function popFolder(){ var e = document.getElementById('wrapper'); if (e){ var a=e.getElementsByTagName('a'); for (var i=0;i= 0){ a[i].className+=a[i].className?' popup':'popup'; a[i].title+=' (opens in new window)'; a[i].onclick=function(){newWin=window.open(this.href,'Win','location=no,menubar=no,status=no,toolbar=no,width=450,height=400');if(window.focus){newWin.focus()} return false;} } } } } window.onload = function(){if(document.getElementById) popFolder();} function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); // hack to make the script xhtml compliant function sndReqDetails(action,req, div) { http.open('get', 'http://www.monova.org//ajax.php?id='+action+'&request='+req+'&div='+div+ '&dummy=' + new Date().getTime()); http.onreadystatechange = handleResponse; http.send(null); } function sndAjaxReq(page, number) { http.open('get', ''+page+'.php?mode=ajax&page='+number+ '&dummy=' + new Date().getTime()); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; var update = new Array(); if(response.indexOf('|' != -1)) { update = response.split('|'); i = 0; //while (update[i] != "") //{ var obj = document.getElementById(update[0]); if (obj != null) obj.innerHTML = update[1]; //i = i +2; //} } } } function cache(identifiant) { if (document.getElementById('i_' + identifiant).style.display == "none") { document.getElementById('i_' + identifiant).style.display = ""; var obj = document.getElementById('img'+identifiant); if (obj != null) obj.src = 'http://www.monova.org//images/cross_m.gif' ; } else { document.getElementById('i_' + identifiant).style.display = "none"; var obj = document.getElementById('img'+identifiant); if (obj != null) obj.src = 'http://www.monova.org//images/cross_p.gif' ; } } var _catHover,_ad,_adTop,_maxScroll,_lastPos=0; window.onload=init; function init(){ if(document.getElementById('ad-right')) { _ad=document.getElementById('ad-right'); _adTop=_ad.offsetTop; _maxScroll=document.getElementById('main').offsetHeight+_adTop-_ad.offsetHeight; adScroll(); } } function adScroll(){ if(_maxScroll>_adTop&&_lastPos!=pos()) { _lastPos=pos(); if(pos()<_maxScroll&&pos()>_adTop) _ad.style.top=pos()+'px'; else if(pos()<_maxScroll)_ad.style.top=_adTop+'px'; else _ad.style.top=_maxScroll+'px'; } setTimeout('adScroll();',10); } function pos(){ if(window.innerHeight) return window.pageYOffset; else if(document.documentElement&&document.documentElement.scrollTop) return document.documentElement.scrollTop; else if(document.body) return document.body.scrollTop; } function addComment(repdeb, repfin) { var input = document.commentform.comment; input.focus(); if(typeof document.selection != 'undefined') { var range = document.selection.createRange(); var insText = range.text; range.text = repdeb + insText + repfin; range = document.selection.createRange(); if (insText.length == 0) { range.move('character', -repfin.length); } else { range.moveStart('character', repdeb.length + insText.length + repfin.length); } range.select(); } else if(typeof input.selectionStart != 'undefined') { var start = input.selectionStart; var end = input.selectionEnd; var insText = input.value.substring(start, end); input.value = input.value.substr(0, start) + repdeb + insText + repfin + input.value.substr(end); var pos; if (insText.length == 0) { pos = start + repdeb.length; } else { pos = start + repdeb.length + insText.length + repfin.length; } input.selectionStart = pos; input.selectionEnd = pos; } else { var pos; var re = new RegExp('^[0-9]{0,3}$'); while(!re.test(pos)) { pos = prompt("Inserting at position (0.." + input.value.length + "):", "0"); } if(pos > input.value.length) { pos = input.value.length; } var insText = prompt("Please input the text to format:"); input.value = input.value.substr(0, pos) + repdeb + insText + repfin + input.value.substr(pos); } } function change_height(element, height) { obj =document.getElementById(element); if (obj != null) { if (obj.style.height == '96px' && height == '32') obj.style.height = '64px'; else obj.style.height = height + 'px'; } }