function sw(URL) { width = 800; height = 375; x = 0; y = 0; supportwindow = window.open(URL,'support','width=' + width + ',height=' + height + ',menubar=yes,location=yes,resizable=yes,toolbar=yes,scrollbars=yes,status=yes,top='+y+',left='+x); supportwindow.focus(); } /** * Check browsers **/ var globalHTMLDirLevel = ""; function isWindows(){ return (navigator.appVersion.indexOf("Win") != -1) } function isMac() { return (navigator.appVersion.indexOf("Mac") != -1) } function isUnix(){ return (navigator.appVersion.indexOf("X11") != -1) } function isNav(){ return (navigator.appName == "Netscape") } function isMSIE(){ return (navigator.appName == "Microsoft Internet Explorer") } function isGeneration4(){ return (navigator.appVersion.charAt(0) == "4") } function isGeneration5or6(){ return (navigator.appVersion.charAt(0) >= "5") } function isNav4(){ return (isNav() && isGeneration4()); } function isNav6(){ return (isNav() && isGeneration5or6()); } function isGecko(){ return (navigator.userAgent.indexOf("Gecko") != -1); } /** * General popup window function **/ function openWindow(url, settings) { win = window.open(url, 'win', settings); if(!(isMSIE()&&isGeneration5or6())) win.window.focus(); } /** * Update parent window from popup **/ function updateParent(url){ window.opener.parent.location.href = url; } /** * One-click select and go for drop-downs **/ function selectAndGo(elementVal){ var urlElements = elementVal.split('|'); var windowLocation = urlElements[0]; var newURL = urlElements[1]; var settings = urlElements[2]; if(windowLocation == "popup"){ openWindow(newURL,settings); } else { top.location.href=newURL; } } /** * Open media player windows **/ function mediaOpen(path){ var width = 790; var height = 525; var atts = 'width=' + width + ',height=' + height + ',top=0,left=0,scrollbars,resizable'; var mediaWindow = window.open(path,'mediaWindow',atts); if(!(isMSIE()&&isGeneration5or6())) mediaWindow.window.focus(); } /** * Windows media player plugin detector **/ function detectPlugins(){ var pluginAvailable = false; if(isNav()){ var i,j; for(i=0;i 0) && (document.forms[i]) && (document.forms[i].elements.length > 0)) document.forms[i].elements[j].focus(); } /** * Help popups for things like Windows Media Player help **/ function webHelp(helpWindow){ var winl = (screen.width - 350) / 2; var wint = (screen.height - 350) / 2; var settings = "height=350,width=350,scrollbars=1,resizable=1,left="+winl+",top="+wint; var helpWin = window.open(helpWindow,'helpWin',settings); if(!(isMSIE()&&isGeneration5or6())) helpWin.window.focus(); } /** * Closes the help **/ function closeHelp(url) { window.open (url,'newwindow','location=1,menubar=1,resizable=1,status=1,toolbar=1,scrollbars=1') window.close(); } /** * Hides the window name that appears in title bar on popups while page is loading. * Often the window name is "null". **/ function placingRequest(){ var title = document.title; document.title = title; } /** * Preload images **/ var HomeOn = new Image(); var HomeOff = new Image(); var EmailOn = new Image(); var EmailOff = new Image(); var SearchGoOn = new Image(); var SearchGoOff = new Image(); var MapOn = new Image(); var MapOff = new Image(); var LoginOn = new Image(); var LoginOff = new Image(); var CloseOn = new Image(); var CloseOff = new Image(); var CloseOnBanner = new Image(); var CloseOffBanner = new Image(); var GoBackOn = new Image(); var GoBackOff = new Image(); function preLoadScreenImages(HTMLDirLevel){ globalHTMLDirLevel = HTMLDirLevel; HomeOn.src = HTMLDirLevel + 'images/HomeOn.gif'; HomeOff.src = HTMLDirLevel + 'images/HomeOff.gif'; EmailOn.src = HTMLDirLevel + 'images/EmailOn.gif'; EmailOff.src = HTMLDirLevel + 'images/EmailOff.gif'; LoginOn.src = HTMLDirLevel + 'images/LoginOn.gif'; LoginOff.src = HTMLDirLevel + 'images/LoginOff.gif'; MapOn.src = HTMLDirLevel + 'images/MapOn.gif'; MapOff.src = HTMLDirLevel + 'images/MapOff.gif'; SearchGoOn.src = HTMLDirLevel + 'images/SearchGoOn.gif'; SearchGoOff.src = HTMLDirLevel + 'images/SearchGoOff.gif'; CloseOn.src = HTMLDirLevel + 'images/CloseOn.gif'; CloseOff.src = HTMLDirLevel + 'images/CloseOff.gif'; CloseOnBanner.src = HTMLDirLevel + 'images/CloseOnBanner.gif'; CloseOffBanner.src = HTMLDirLevel + 'images/CloseOffBanner.gif'; GoBackOn.src = HTMLDirLevel + 'images/GoBackOn.gif'; GoBackOff.src = HTMLDirLevel + 'images/GoBackOff.gif'; } /** * Image rollover **/ function imageRollover(off,on){ document.images[off].src=on.src; return true; } /** * Request info popup window **/ function RequestInfo(call, referer){ var settings = 'width=450,height=565,resizable=1,scrollbars=1'; var page = 'http://www.mfgx.net/resources/svInfoReq.jsp?referer=mfgx.net%20support'; page += '&recipientList='; page += 'rzk@qad.com'; page += '&call='+call; openWindow(page,settings); } /** * Request info popup window function for use in the javascript menus **/ function RequestInfoMenu(){ var settings = 'width=450,height=565,resizable=1,scrollbars=1'; var page = 'http://www.mfgx.net/resources/svInfoReq.jsp?referer=mfgx.net%20support'; page += '&recipientList='; page += 'rzk@qad.com'; page += '&call=0'; openWindow(page,settings); } /** * no right-click view source **/ function noViewSource(e){ //right-click disabled! if (document.all){ if (event.button == 2 || event.button == 3){ //alert("Right-mouse click is disabled."); return false; } } if (document.layers){ if (e.which == 3){ //alert("Right-mouse click is disabled."); return false; } } } /** * no right-click function **/ function preventRightClick(noView){ if(noView == true){ if (document.layers){ document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=noViewSource; } } /** * show sv customer panel video **/ function customerPanel(){ var movie; if(isNav()||isGecko()){ movie = "http://66.97.134.83/qadmedia/mfgx/sv_panel/mmplayer_fs.html"; } else { movie = "http://66.97.134.83/qadmedia/mfgx/sv_panel/mmplayer.html"; } openNewWindow(movie,790,525,"top=0,left=0,scrollbars=1,resizable=1"); } /** * Special function for DHTML menus **/ function openNewWindow(winURL,winWidth,winHeight,winConfig){ mmConfig="" mmConfig="width="+winWidth+"," mmConfig+="height="+winHeight+"," mmConfig+=winConfig var mmWin=open(winURL,"",mmConfig); mmWin.focus(); } /** * Special function for DHTML menus **/ function reportError(msg,url,line){ if(msg && url && line){ alert("An error occurred at "+url+", line "+line+"\nThe error is: "+msg); return true; } } /** * check email function deprecated **/ function checkEmail(){ validateEmail(); } /** * Check email function **/ function validateEmail(){ var email = document.frmMailer.email.value; var re = /\S\b@{1}\b\S/; if(re.test(email)){ //ok } else { alert("Please provide a valid email."); return false; } return true; } /** * For use while testing javascript **/ function reportError(msg,url,line){ if(msg && url && line){ alert("An error occurred at "+url+", line "+line+"\nThe error is: "+msg); return true; } } /** * General do nothing function **/ function doNothing(){return true;} /** * For providing a polite javascript error on the ROI Calculator. * Some browsers just will not support it no matter what. **/ function politeError(){ alert("Sorry, an error has occurred. As a result, parts of the page might not work properly."); return true; } /** * Emulate full Array object support in browsers that * don't provide full support already, such as Mac IE5 **/ if(typeof Array.prototype.shift=='undefined') Array.prototype.shift=function(){ var firstElem=this[0]; for(i = 0;i < this.length-1;i++) this[i]=this[i+1]; this.length--; return firstElem; }; if(typeof Array.prototype.unshift=='undefined') Array.prototype.unshift=function(){ var firstElem=this[0]; this.length++; var arg = arguments[0]; for(i = 0;i < this.length-1;i++) this[i+1]=this[i]; this[0] = arg; }; if(typeof Array.prototype.pop=='undefined') Array.prototype.pop=function(){ var lastElem = this[this.length-1]; this.length--; return lastElem; }; if(typeof Array.prototype.push=='undefined') Array.prototype.push=function(){ this.length++; var lastElem = this[this.length-1]; var arg = arguments[0]; lastElem = arg; }; /** * Variables for the popup form processing alert **/ var winl = (screen.width - 350) / 2; var wint = (screen.height - 350) / 2; var formProcessingWindow = "height=250,width=250,scrollbars=1,resizable=1,left="+winl+",top="+wint; /** * sets a default status bar message **/ window.onload=window.defaultStatus='MFGx.net Support'; /** This moves the menu in front of flash movie * for those browsers that understand DOM **/ function clearMovie(){ if(document.getElementById && !isMSIE()){ var div = document.getElementById('moviediv'); if(div){ div.innerHTML = " "; img = document.createElement('img'); img.setAttribute('src','images/spacer_trans.gif'); img.setAttribute('height','150'); img.setAttribute('width','1'); div.appendChild(img); } } } /** This puts the movie back into the DOM * for those browsers that understand DOM **/ function addMovie(){ if(document.getElementById && !isMSIE()){ var div = document.getElementById('moviediv'); if(div){ div.innerHTML = " "; emb = document.createElement('embed'); emb.setAttribute('src','images/feature_wide.swf'); emb.setAttribute('width','580'); emb.setAttribute('height','150'); emb.setAttribute('type','application/x-shockwave-flash'); emb.setAttribute('pluginspage','http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'); emb.setAttribute('id','movie'); div.appendChild(emb); } } } /** * Open qad web account registration page **/ function registration(){ window.open('http://www3.qad.com/www/registration.nsf/MFGxAgreement','','width=650,height=400,scrollbars,resizable'); }