var req = null; var openpophoro = null; function GetHTTPRequest() { /* if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } */ var httpRequest = null; if (window.XMLHttpRequest){ // Mozilla, Safari, ... httpRequest = new XMLHttpRequest(); if (httpRequest.overrideMimeType){ httpRequest.overrideMimeType('text/xml'); } }else if (window.ActiveXObject){ // IE try{ httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ try{ httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } /* try{ httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){ httpRequest = false; } } if(!httpRequest && document.createElement){ httpRequest = new XMLHttpRequest(); } */ if (!httpRequest){ alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } return httpRequest; } var menuLayers = { timer: null, activeMenuID: null, show: function(id, e) { var mnu = document.getElementById? document.getElementById(id): null; if (!mnu) return; this.activeMenuID = id; if ( mnu.onmouseout == null ) mnu.onmouseout = this.mouseoutCheck; if ( mnu.onmouseover == null ) mnu.onmouseover = this.clearTimer; this.position(mnu,e); }, hide: function() { this.clearTimer(); if (this.activeMenuID && document.getElementById) this.timer = setTimeout("document.getElementById('"+menuLayers.activeMenuID+"').style.visibility = 'hidden'", 200); }, position: function(mnu, e) { this.timer = setTimeout("document.getElementById('" + menuLayers.activeMenuID + "').style.visibility = 'visible'", 200); }, mouseoutCheck: function(e) { e = e? e: window.event; // is element moused into contained by menu? or is it menu (ul or li or a to menu div)? var mnu = document.getElementById(menuLayers.activeMenuID); var toEl = e.relatedTarget? e.relatedTarget: e.toElement; if ( mnu != toEl && !menuLayers.contained(toEl, mnu) ) menuLayers.hide(); }, // returns true of oNode is contained by oCont (container) contained: function(oNode, oCont) { if (!oNode) return; // in case alt-tab away while hovering (prevent error) while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true; return false; }, clearTimer: function() { if (menuLayers.timer) clearTimeout(menuLayers.timer); } } function PopHoro(id) { if(openpophoro == null) { document.getElementById(id).style.display = ''; openpophoro = 1; } else { document.getElementById(id).style.display = 'none'; openpophoro = null; } } function Login(id,url) { req = GetHTTPRequest(); req.open("GET", url); req.onreadystatechange = function() { if(req.readyState == 4) { if (req.status == 200) { document.getElementById(id).innerHTML = req.responseText; } } } req.send(null); } function rateAriticle(url,id,rid) { req = GetHTTPRequest(); req.open("GET", url, true); req.onreadystatechange = function() { if(req.readyState == 4) { if (req.status == 200) { document.getElementById(id).src = req.responseText; document.getElementById(rid).style.display = "none"; } } } req.send(null); } function PremiumMarquee(id,mdelay) { html = document.getElementById(id).innerHTML; document.getElementById(id).innerHTML = '' + html + ''; } function validatecaptcha(url,msg) { if(document.contactusform.confirm_code.value.length == 5) { req = GetHTTPRequest(); req.open("GET", url+'?confirmcode='+document.contactusform.confirm_code.value); req.onreadystatechange = function() { if(req.readyState == 4) { if (req.status == 200) { if(req.responseText == 1) { document.getElementById('submit').disabled = false; document.getElementById('confirm').disabled = true; } else { alert(msg); document.getElementById('submit').disabled = true; document.getElementById('confirm').disabled = false; } } } } req.send(null); } } function validateContactForm(msg1,msg2,msg3) { if (!validateInputBox(document.contactusform.f2.value,10)) { alert(msg1); return false; } else if (!validateInputBox(document.contactusform.f3.value,10)) { alert(msg2); return false; } else if (!validateEmail(document.contactusform.f5.value)) { alert(msg3); return false; } return true; } function validateInputBox(text,num) { return (text.length >= num); } function validateEmail(emailAddress) { if ((emailAddress == "") || (emailAddress.indexOf ('@') == -1) || (emailAddress.indexOf ('.') == -1)) return false; return true; } function openWin(url,wname) { window.open(url,wname,'fullscreen=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,left=0,top=0'); } function openPop(url,wname,w,h,sb,rs) { var w_left = (screen.width/2) - (w/2); var w_top = (screen.height/2) - (h/2)-30; window.open(url,wname,'fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars='+sb+',resizable='+rs+',directories=no,location=no,width='+w+',height='+h+',left='+w_left+',top='+w_top); } function mkFlash(id,reqVer,flaFile,flaWidth,flaHeight,flaBgcolor,noFlash) { /*no Flash*/ var noFla = ''; noFla += noFlash; /*Flash*/ var flaArea= ""; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; flaArea += ''; var FlaVerCk=false; var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0); if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 8) { FlaVerCk=true; } else if(navigator.userAgent && (navigator.userAgent.indexOf("MSIE") >= 0) && (navigator.userAgent.indexOf("Win") >= 0)){ /*measures Opera6*/ if(navigator.userAgent.indexOf("Opera") <= 0){ var flaVer=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion(); flaVer=Math.floor(flaVer / 0x10000); (flaVer >= reqVer) ? FlaVerCk=true : FlaVerCk=false; } }else{FlaVerCk=false;} if(FlaVerCk){ document.write(flaArea); } else { document.write(noFla); } }