/* 4/3/2007 - 5/6/2009 Written by David L. Greene, 111 Park Street, Apt 6D, New Haven, CT 06511-5429, Tel 203-624-6860, Fax 203-624-9795, Dave@DLGreene.com */function dlg_VrObject(){this.AdjustWidthHeight=function(){var sWidth=this.width.toFixed(0);var sHeight=this.height.toFixed(0);this.objHTML=this.objHTML.replace(/style="([^"]*)/i,'style="width:'+sWidth+'px;height:'+sHeight+'px;"');};this.CalcWidthHeight=function(_divObj,_width,_height){this.width=_width.toInt();this.height=_height.toInt();var vrWidthWrite=this.width;var vrHeightWrite=this.height;var winWidth=window.getWidth();var winHeight=window.getHeight()-_divObj.getTop();if((0<winWidth)&&(0<winHeight)){winWidth*=0.9;winHeight*=0.95;if(winWidth>this.width)vrWidthWrite=winWidth;if(winHeight>this.height)vrHeightWrite=winHeight;}if((vrWidthWrite<=this.width)||(vrHeightWrite<=this.height)){vrWidthWrite=this.width;vrHeightWrite=this.height;}if(vrWidthWrite>1024)vrWidthWrite=1024;if(vrHeightWrite>768)vrHeightWrite=768;this.width=vrWidthWrite.round();this.height=vrHeightWrite.round();};this.CheckVersion=function(_VerCheckArr,_VerTargetArr,_Count){var bRet=null==_VerCheckArr&&null==_VerTargetArr;if(!bRet&&!(null==_VerCheckArr||null==_VerTargetArr)){var chk=new dlg_CheckVersion(_VerCheckArr,_VerTargetArr);bRet=chk.Check(_Count);}return bRet;};this.NavigatorHasPlugin=function(_Name,_MimeType,_VerArr){var bRet=false;if(navigator.plugins){if(navigator.plugins.refresh)navigator.plugins.refresh();var tmpMimeType;for(var i=0;!bRet&&i<navigator.plugins.length;i++){if(navigator.plugins[i].name.indexOf(_Name)>-1){tmpMimeType=navigator.plugins[i][_MimeType];if(tmpMimeType&&tmpMimeType.enabledPlugin){var VerArr=navigator.plugins[i].description.match(/\d+/g);if(VerArr)bRet=this.CheckVersion(VerArr,_VerArr,-1);else bRet=true;}}}}return bRet;};} function dlg_CheckVersion(_VerCheckArr,_VerTargetArr){this.VerCheckArr=_VerCheckArr;this.VerTargetArr=_VerTargetArr;this.MaxCompare=Math.min(this.VerCheckArr.length,this.VerTargetArr.length);this.Check=function(iCount){if(0>iCount)iCount=this.MaxCompare;var bRet=((iCount==this.MaxCompare)&&(0==iCount));if(!bRet&&0<this.MaxCompare&&this.MaxCompare<=iCount){this.MaxCompare=iCount;bRet=this._Check(0);}return bRet;};this._Check=function(Idx){var bRet=false;var VerCheck=this.VerCheckArr[Idx].toInt();var VerTarget=this.VerTargetArr[Idx].toInt();if(VerCheck>=VerTarget){bRet=true;if((VerCheck==VerTarget)&&((Idx+1)<this.MaxCompare))bRet=this._Check(Idx+1);}return bRet;};}

