function resizeMe(w,h){if(document.all){window.top.resizeTo(w,h);}else{window.top.outerWidth=w;window.top.outerHeight=h;}
}
function centerMe(w,h){window.moveTo((screen.width-w)/2,(screen.height-h)/2);}
function focusMe(){window.focus();}
function closeMe(){window.close();}
function printMe(textIfManualPrint){if(window.print){window.print();}else{alert(textIfManualPrint);}
}
function saveMainWindow(topFrame){if(topFrame.name==""){topFrame.name="ippMainWindow";}
}
function debugDOM(doc){var frame=open();var writeDocument=frame.document;writeDocument.write('<html><head></head><body><table><tr><td nowrap>');debugDOMRec(writeDocument,"",doc);writeDocument.write('</td></tr></table></body></html>');return frame;}
function debugDOMRec(writeDocument,prefix,node){var children=node.childNodes;writeDocument.write(prefix+node+",&nbsp;name: "+node.nodeName+",&nbsp;value: "+node.nodeValue+",&nbsp;data: "+node.data);if(node.nodeType==1){for(var i=0;i<node.attributes.length;i++){if(node.attributes.item(i).nodeValue!=null){writeDocument.write(", "+node.attributes.item(i).nodeName+"=\""+node.attributes.item(i).nodeValue+"\"");}
}
}
writeDocument.write('<br>');for(var i=0;i<children.length;i++){debugDOMRec(writeDocument,prefix+"&nbsp;&nbsp;&nbsp;&nbsp;",children.item(i));}
}
function debugWrite(text){if(text==null)return;try{debugdoc.write(text+"<br>");}catch(exception){var frame=open();debugdoc=frame.document;debugdoc.write(text+"<br>");}
}
function disableFormsSetHourglass(newButtonText){return setDocumentEnabled(document,false,newButtonText,false);}
function setDocumentEnabled(documentToSetEnabled,enabled,newButtonText,recursively){try{if(documentToSetEnabled==null){documentToSetEnabled=document;}
var body=(documentToSetEnabled.getElementsByTagName('body').length==0)?null:documentToSetEnabled.getElementsByTagName('body')[0];if(body!=null){if(body.style.old_cursor==null){body.style.old_cursor=body.style.cursor;body.style.cursor='wait';}else{body.style.cursor=body.style.old_cursor;body.style.old_cursor=null;}
}
var inputElements=documentToSetEnabled.getElementsByTagName('input');for(var i=0;i<inputElements.length;i++){if(inputElements[i].type=="submit"){if(inputElements[i].old_value==null){if(newButtonText!=null){inputElements[i].old_value=inputElements[i].value;inputElements[i].style.old_cursor=inputElements[i].style.cursor;inputElements[i].value=newButtonText;inputElements[i].style.cursor='wait';}
}else{inputElements[i].value=inputElements[i].old_value;inputElements[i].style.cursor=inputElements[i].style.old_cursor;inputElements[i].old_value=null;inputElements[i].style.old_cursor=null;}
if(inputElements[i].old_disabled==null){inputElements[i].old_disabled=inputElements[i].disabled;inputElements[i].style.old_cursor=inputElements[i].style.cursor;inputElements[i].style.old_color=inputElements[i].style.color;inputElements[i].disabled="disabled";inputElements[i].style.cursor='wait';inputElements[i].style.color="#aca899";}else{inputElements[i].disabled=inputElements[i].old_disabled;inputElements[i].style.cursor=inputElements[i].style.old_cursor;inputElements[i].style.color=inputElements[i].style.old_color;inputElements[i].old_disabled=null;inputElements[i].style.old_cursor=null;inputElements[i].style.old_color=null;}
}
}
var aElements=documentToSetEnabled.getElementsByTagName('a');for(var i=0;i<aElements.length;i++){if(aElements[i].old_disabled==null){aElements[i].old_onclick=aElements[i].onclick;aElements[i].style.old_cursor=aElements[i].style.cursor;aElements[i].style.old_color=aElements[i].style.color;aElements[i].old_disabled=aElements[i].disabled;aElements[i].old_href=aElements[i].href;aElements[i].onclick="return false;";aElements[i].style.cursor='wait';aElements[i].style.color="#aca899";aElements[i].disabled="disabled";var href=aElements[i].getAttribute("href");if((href)&&(href!=null)&&(href!="")){aElements[i].removeAttribute('href');}
}else{aElements[i].onclick=aElements[i].old_onclick;aElements[i].style.cursor=aElements[i].style.old_cursor;aElements[i].style.color=aElements[i].style.old_color;aElements[i].disabled=aElements[i].old_disabled;aElements[i].setAttribute('href',aElements[i].old_href);aElements[i].old_onclick=null;aElements[i].style.old_cursor=null;aElements[i].style.old_color=null;aElements[i].old_disabled=null;aElements[i].old_href=null;}
}
if(recursively){for(var i=0;i<documentToSetEnabled.frames.length;i++){setDocumentEnabled(documentToSetEnabled.frames[i].document,enabled,newButtonText,recursively);}
}
}catch(exception){}
return true;}
function newDlg(url,target,width,height,options){if(options!=""){options+=", ";}
options+="width="+width+", height="+height;if((options.indexOf("left")==-1)||(options.indexOf("top")==-1)){var screenX=(screen.width-width)/2;var screenY=(screen.height-height)/2;options+=", left="+screenX+", top="+screenY;}
var dlg=window.open(url,target,options);if(dlg!=null){dlg.focus();}
return dlg;}
function toggleQuickSearchComboBox(designName){var miniImage=document.getElementById('quicksearchmini');var quicksearchselect=document.getElementById('quicksearchselect');var invisibleImage=document.getElementById('callbackImage');if(quicksearchselect.style.display=="none"){quicksearchselect.style.display="inline";miniImage.src='../images/design/'+designName+'/icons/mini_minus.gif';invisibleImage.src="../callbackServlet?callback=genericQuickSearchComboBox&set=1";}else{quicksearchselect.style.display="none";miniImage.src='../images/design/'+designName+'/icons/mini_plus.gif';invisibleImage.src="../callbackServlet?callback=genericQuickSearchComboBox&set=0";}
}
function framesetResizedHandler(frameset){var framesetSize=(frameset.cols)?frameset.cols:frameset.rows;var framesetName=frameset.getAttribute("name");var ietkTop;var newFrameSize;if(framesetName=="underToolbarFrameset"){ietkTop=(self.ietktop)?self.ietktop:parent.ietktop;newFrameSize=framesetSize.split(",")[0];userSettingsCallback(ietkTop,"resizedTreeFrame",newFrameSize);}
if(framesetName=="imagepartlistframeset"){ietkTop=(parent.ietktop)?parent.ietktop:parent.parent.ietktop;newFrameSize=findImagePercentage(framesetSize);if(newFrameSize!=null){userSettingsCallback(ietkTop,"resizedDiagramFrame",newFrameSize);}
}
}
function findImagePercentage(framesetSize){var frameSetSizes=framesetSize.split(",");for(var i=0;i<frameSetSizes.length;i++){var frameSize=frameSetSizes[i];if(frameSize.indexOf("%")>0){frameSize=frameSize.substring(0,frameSize.indexOf("%"));return(frameSize * 1);}
}
return null;}
function delayFrameResizedHandler(frameset){var timeoutId=frameset.getAttribute("timeoutId");if(timeoutId){clearTimeout(timeoutId);}
frameset.setAttribute("timeoutId",setTimeout(function(){framesetResizedHandler(frameset);},1000));}
function eventTarget(event){return(window.Event)?event.target:event.srcElement;}
function userSettingsCallback(ietkToolbarDoc,cbAction,cbVal){var callbackIFrame=ietkToolbarDoc.document.getElementById("invisibleTarget");if(callbackIFrame!=null){callbackIFrame.src="../callbackServlet?callback="+cbAction+"&set="+cbVal;}
}
function adjustAssyTreePixel(){var availWidth=screen.availWidth;var assyTreeFrameset=document.getElementById("underToolbarFrameset");if(assyTreeFrameset!=null){var assyTreeColsSize=assyTreeFrameset.cols;var assyTreeSize=assyTreeColsSize.split(",")[0];if(((assyTreeSize * 1)+50)>=availWidth){assyTreeSize=availWidth-50;assyTreeFrameset.cols=assyTreeSize+",*";}
}
}
function isNumeric(str){str=trim(str);str=str.replace(/,/,".")
var regexLiteral=/^[0-9]+[\.]?[0-9]*$/;return regexLiteral.test(str);}
