http://rh.viacometa.com.br/Corpore.Net/sharedservices/clientscripts/windowutils.js?version=10_8_2026
1/*<RMJSDep>SharedServices\ClientScripts\BrowserUtils</RMJSDep>*/ 2//Fecha a janela aberta 3 4//Constantes para tamanho da janela padrão de 800x600 5var RMWDefaultWindowWidth = 793; 6var RMWDefaultWindowHeight = 471; 7 8function CloseWindowOpener() 9{ 10 if (IsWindowOpenerValid()) 11 window.close(); 12} 13 14//Verifica se o window.opener é valido 15function IsWindowOpenerValid() 16{ 17 try 18 { 19 if ((window.opener!=null) && 20 (!window.opener.closed)) 21 return true; 22 else 23 return false; 24 } 25 catch(e) 26 { 27 return false; 28 } 29} 30 31function OpenWindow(Url, WindowName, WindowFeatures) 32{ 33 return window.open(Url,WindowName,WindowFeatures); 34} 35 36/******************************************************** 37Funcao criada para adicionar 20px no Height da janela do NS 38já que a janela aberta pelo window.open do NS é menor que 39do IE 40O parametro AddNSHeight recebe um valor booleano 41********************************************************/ 42function SetWindowFeaturesHeight(pWindowFeatures) 43{ 44 var result; 45 result = pWindowFeatures.toUpperCase(); 46 47 if (isNS()) 48 { 49 var HeightConst = "HEIGHT"; 50 var StartPos; 51 var EndPos; 52 var HeightValue; 53 54 StartPos = result.indexOf(HeightConst); 55 56 if (StartPos!=-1) 57 { 58 EndPos = result.indexOf(",", StartPos); 59 if (EndPos!=-1) 60 { 61 HeightValue = result.substring(StartPos + 7, EndPos); 62 result = result.substring(0,StartPos) + result.substr(EndPos + 1); 63 } 64 else 65 { 66 HeightValue = result.substring(StartPos + 7); 67 result = result.substr(0,StartPos); 68 } 69 70 HeightValue = parseInt(HeightValue) + 20; 71 72 while((result.length>0) && 73 (result.substr(result.length-1)==" ")) 74 result = result.substring(0,result.length-1); 75 76 if ((result.length>0) && 77 (result.substr(result.length-1)!=",")) 78 result = result + ","; 79 80 result = result + HeightConst + "=" + HeightValue + "PX,"; 81 } 82 } 83 84 return result; 85} 86 87/* 88Retorna uma QueryString da URL 89*/ 90function GetQueryString(Key) 91{ 92 var UpperCaseUrl = location.href.toUpperCase(); 93 Key = Key.toUpperCase(); 94 95 var StartPos = UpperCaseUrl.indexOf("?" + Key + "="); 96 if (StartPos==-1) 97 StartPos = UpperCaseUrl.indexOf("&" + Key + "="); 98 99 if (StartPos!=-1) 100 { 101 StartPos += Key.length + 2; 102 var EndPos = UpperCaseUrl.indexOf('&',StartPos); 103 104 if (EndPos!=-1) 105 return location.href.substring(StartPos,EndPos); 106 else 107 return location.href.substr(StartPos); 108 } 109 else 110 { 111 return ""; 112 } 113} 114 115function GetCenterPositionTop(NewWindowHeight) 116{ 117 var result = (screen.availHeight - NewWindowHeight) / 2; 118 119 if (result > 0) 120 return result; 121 else 122 return 0; 123} 124 125function GetCenterPositionLeft(NewWindowWidth) 126{ 127 var result = (screen.availWidth - NewWindowWidth) / 2; 128 129 if (result > 0) 130 return result; 131 else 132 return 0; 133} 134 135//newWindowHeight: Tamanho da nova janela que será aberta 136//windowToolsTopHeight: Tamanho da área de janela de cima que não é incluído no newWindowHeight, por exemplo área de titulo, menus 137//windowToolsBottomHeight: Tamanho da área de janela de cima que não é incluído no newWindowHeight, por exemplo status 138//referenceWindow: Janela a qual o cascade deverá ser levado em consideração 139function GetCascadePostionTop(newWindowHeight, windowToolsTopHeight, windowToolsBottomHeight, referenceWindow) 140{ 141 var screenTop; 142 if (isNS()) 143 screenTop = referenceWindow.screenY; 144 else 145 screenTop = referenceWindow.screenTop; 146 var result = screenTop - windowToolsTopHeight; 147 148 if (result + newWindowHeight + windowToolsTopHeight + windowToolsBottomHeight > screen.availHeight) 149 result = 0; 150 else if (result + 10 + newWindowHeight + windowToolsTopHeight + windowToolsBottomHeight <= screen.availHeight) 151 result += 10; 152 153 return result; 154} 155 156function GetCascadePostionLeft(newWindowWidth, referenceWindow) 157{ 158 var windowBorderSize = 6; 159 var screenLeft; 160 if (isNS()) 161 screenLeft = referenceWindow.screenX; 162 else 163 screenLeft = referenceWindow.screenLeft; 164 165 var result = screenLeft - windowBorderSize; 166 167 if (result + newWindowWidth + (windowBorderSize*2) >
167 screen.availWidth) 168 result = 0; 169 else if (result + 10 + newWindowWidth + (windowBorderSize*2) <= screen.availWidth) 170 result += 10; 171 172 return result; 173}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.