// Requires: mScreen.js if(typeof(mScreen) == "undefined") alert("mScreen Required"); // |||||||||||||||||||||||||||||||||||||||||||||||||| if(typeof(mWindow) == "undefined") mWindow = {}; mWindow.open = function(url,name,width,height,xpos,ypos,chrome,scroll,fullscreen){ var x, y, w, h, moveX=0, moveY=0, features=""; chrome = chrome ? "yes" : "no"; scroll = scroll ? "yes" : "no"; features += "toolbar="+chrome; features += ",menubar="+chrome; features += ",location="+chrome; features += ",status="+chrome; features += ",scrollbars="+scroll; features += ",resizable="+scroll; if(width) features += ",width="+width; if(height) features += ",height="+height; if(fullscreen) features += ",fullscreen=yes"; if(xpos){ w = mScreen.getWidth(); width = parseInt(width); switch(xpos){ case "left": x = 0; break; case "center": x = Math.round((w-width)/2); break; case "right": x = w-width; break; default: x = xpos; } features += ",screenX="+x+",left="+x; var moveX = x; } if(ypos){ h = mScreen.getHeight(); height = parseInt(height); switch(ypos){ case "top": y = 0; break; case "middle": y = Math.round((h-height)/2); break; case "bottom": y = h-height; break; default: y = ypos; } features += ",screenY="+y+",top="+y; var moveY = y; } mWindow.windowReference = window.open(url,name,features); }; mWindow.openScroll = function(url,name,width,height){ this.open(url,name,width,height,false,false,false,"scroll"); }; mWindow.openCenter = function(url,name,width,height){ this.open(url,name,width,height,"center","middle"); }; mWindow.openCenterResizable = function(url,name,width,height){ this.open(url,name,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+width+", height="+height) }; mWindow.openCenterScroll = function(url,name,width,height){ this.open(url,name,width,height,"center","middle",false,"scroll"); }; mWindow.openFull = function(url,name){ this.open(url,name,mScreen.getWidth(),mScreen.getHeight(),"0","0",false,false); }; mWindow.openCenterFull = function(url,name,width,height){ this.open(url,name,width,height,"center","middle",true,"scroll"); }; mWindow.openKiosk = function(url,name){ this.open(url,name,mScreen.getWidth(),mScreen.getHeight(),"0","0",false,false,true); };