window.onload = startup; function startup() { var ua = navigator.userAgent.toLowerCase(); // Add the highlights to input form items addHighlights(); // Fix background PNG in IE6 if(document.body.style.filter!=undefined) { var thisDetails = document.getElementById('details'); if(thisDetails){ thisDetails.style.backgroundImage='none'; thisDetails.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/images/Body6.png", sizingMethod="scale")'; } else{ var thisBody = document.getElementsByTagName('body')[0]; thisBody.style.backgroundImage='none'; thisBody.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/images/Body5.png", sizingMethod="scale")'; } var thisHeader = document.getElementById('Header'); thisHeader.style.backgroundImage='none'; thisHeader.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/images/ehop32.png", sizingMethod="scale")'; var fr = document.getElementById('fr'); if(fr){ fr.style.backgroundImage='url(/images/fr2.jpg)'; fr.style.filter = 'none'; } var de = document.getElementById('de'); if(de){ de.style.backgroundImage='url(/images/de2.jpg)'; de.style.filter = 'none'; } var en = document.getElementById('en'); if(en){ en.style.backgroundImage='url(/images/en2.jpg)'; en.style.filter = 'none'; } var it = document.getElementById('it'); if(it){ it.style.backgroundImage='url(/images/it2.jpg)'; it.style.filter = 'none'; } var es = document.getElementById('es'); if(es){ es.style.backgroundImage='url(/images/es2.jpg)'; es.style.filter = 'none'; } var pt = document.getElementById('pt'); if(pt){ pt.style.backgroundImage='url(/images/pt2.jpg)'; pt.style.filter = 'none'; } var nl = document.getElementById('nl'); if(nl){ nl.style.backgroundImage='url(/images/nl2.jpg)'; nl.style.filter = 'none'; } } } /******* HIGHLIGHT INPUT FIELDS *******************************/ lastFocused = ''; function addHighlights2() {} function addHighlights() { var inputs = document.getElementsByTagName("input"); var textareas = document.getElementsByTagName("textarea"); var selects = document.getElementsByTagName("select"); var numInputs = inputs.length; var numTextAreas = textareas.length; var numSelects = selects.length; for ( i=0; i < numInputs; i++ ) { var currentInput = inputs[i]; currentInput.onfocus = onFocus; currentInput.onblur = onBlur; currentInput.onmouseover = onOver; currentInput.onmouseout = onOut; } for ( i=0; i < numTextAreas; i++ ) { var currentTextArea = textareas[i]; currentTextArea.onfocus = onFocus; currentTextArea.onblur = onBlur; currentTextArea.onmouseover = onOver; currentTextArea.onmouseout = onOut; } for ( i=0; i < numSelects; i++ ) { var currentSelect = selects[i]; //if(navigator.userAgent.toLowerCase().indexOf('mozilla') == -1) currentSelect.onfocus = onFocus; currentSelect.onblur = onBlur; currentSelect.onmouseover = onOver; currentSelect.onmouseout = onOut; } } function onFocus() { lastFocused = this; this.style.background = '#ffffff'; this.style.border = '1px solid #CC0000'; this.style.color = '#CC0000'; } function onBlur() { this.style.background = '#ECECEC'; this.style.border = 'solid 1px #B0B0B0'; this.style.color = '#000000'; } function onOver() { if (this != lastFocused) { this.style.background = '#CC0000'; if (this.type == 'submit') this.style.cursor = 'pointer'; if (this.type == 'button') this.style.cursor = 'pointer'; } } function onOut() { if (this != lastFocused) { this.style.background = '#ECECEC'; this.style.border = 'solid 1px #B0B0B0'; this.style.color = '#000000'; } } // Insert links to specified elements/textboxes function insertLink(elementId) { var link = prompt("Please enter the link in the form of http://www.website.com/link.html", ""); while (link != null && link.substr(0,7).toLowerCase() != 'http://') { alert('Link must start with http:// using format: http://www.website.com/link.html'); var link = prompt("Please enter the link in the form of http://www.website.com/link.html", ""); } if (link != null) var title = prompt("Please enter what the link should read (i.e. Click Here!): ",""); if (link != null && title != null) { var textbox = document.getElementById(elementId); textbox.value += ' ' + title + ' '; } } function addEvent(elm, evType, fn, useCapture) // addEvent and removeEvent // cross-browser event handling for IE5+, NS6 and Mozilla // By Scott Andrew { if (elm.addEventListener){ elm.addEventListener(evType, fn, useCapture); return true; } else if (elm.attachEvent){ var r = elm.attachEvent("on"+evType, fn); return r; } else { alert("Handler could not be removed"); } } /**************************************************************************************************************/ // Create xmlhttp object based on browsertype function getHTTPObject() { if (window.XMLHttpRequest) { // If IE7, Mozilla, Safari, etc: Use native object var xmlHttp = new XMLHttpRequest(); } else { if (window.ActiveXObject) { // ...otherwise, use the ActiveX control for IE5.x and IE6 var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } /**************************************************************************************************************/ // Report media as spam/stolen/etc function deleteImage(id, obj) { var sure = confirm ("Are you sure you want to delete this image? id = "+id); if (sure) { obj.src = '/users/database/progress_circle.gif'; var url = '/admin/delete.php?image_id=' + id; loadHttp = getHTTPObject(); loadHttp.open("GET", url, true); loadHttp.onreadystatechange = function() { if (loadHttp.readyState == 4) { if (loadHttp.responseText.indexOf('invalid') == -1) { obj.style.display="none"; } } }; loadHttp.send(null); } } function addToFavorites() { if (window.external) { window.external.AddFavorite("http://www.eeehop.com", "eeeeeeeee HOP"); } else { alert("Sorry! Your browser doesn't support this function."); } }