                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

if(typeof vp=="undefined"){var vp={};}
vp.win=function(){};vp.win.childWindows=[];vp.win._checkForWindow=function(oWindow,sFunc){if(!oWindow){throw new Error("Call to vp.win."+sFunc+"() with a null window reference.");}
if(!oWindow.resizeTo||!oWindow.moveTo){throw new Error("Call to vp.win."+sFunc+"() with a non-window argument.");}};vp.win.verifyWindow=function(oWindow)
{if(!oWindow)
{return false;}
try
{if(oWindow.closed)
{return false;}
if(!oWindow.resizeTo||!oWindow.moveTo)
{return false;}
var sUrl=oWindow.document.location.href;return true;}
catch(ex)
{return false;}};vp.win.center=function(oWindow){oWindow=oWindow||window;this._checkForWindow(oWindow);var iWidth=0,iHeight=0;if(oWindow.dialogWidth){iWidth=parseInt(oWindow.dialogWidth);iHeight=parseInt(oWindow.dialogHeight);}else if(typeof oWindow.innerWidth=="number"){iWidth=oWindow.innerWidth;iHeight=oWindow.innerHeight;}else if(document.documentElement){iWidth=document.documentElement.offsetWidth;iHeight=document.documentElement.offsetHeight;}else if(document.body){iWidth=document.body.clientWidth;iHeight=document.body.clientHeight;}
if(oWindow.dialogWidth){oWindow.dialogLeft=((screen.availWidth/2)-(iWidth/2))+"px";oWindow.dialogTop=((screen.availHeight/2)-(iHeight/2))+"px";}else{oWindow.moveTo((screen.availWidth/2)-(iWidth/2),(screen.availHeight/2)-(iHeight/2));}};vp.win.close=function(oWindow){oWindow=oWindow||window;this._checkForWindow(oWindow,"close");oWindow.top.close();};vp.win.closeChildWindows=function(){for(var i=0,c=this.childWindows.length;i<c;i++){try{this.childWindows[i].close();}
catch(ex){}}};vp.win.isPopup=function(oWindow){oWindow=oWindow||window;this._checkForWindow(oWindow,"isPopup");return!!oWindow.top.opener;};vp.win.open=function(sUrl,sName,sFeatures,bDisablePopupBlockingWarning,bIsCrossDomain){try
{var oWin=window.open(sUrl,sName,sFeatures);if(!oWin)
{if(!bDisablePopupBlockingWarning)
{alert(vp.LangMap["PopupBlockerWarning"]);}
return null;}
if(!bIsCrossDomain)
{var oTemp=oWin.document;}
this.childWindows[this.childWindows.length]=oWin;oWin.focus();return oWin;}
catch(ex)
{return null;}};vp.win.openCentered=function(sUrl,sName,iWidth,iHeight,bResizable,bScrolling,bIsCrossDomain){iWidth=Math.min(iWidth,screen.width);iHeight=Math.min(iHeight,screen.height);var sFeatures="width="+iWidth+",height="+iHeight;var iLeft=screen.width/2-iWidth/2;var iTop=screen.height/2-iHeight/2;sFeatures+=",left="+iLeft+",top="+iTop;sFeatures+=",resizable="+(bResizable?"yes":"no")+",scrollbars="+(bScrolling?"yes":"no");return vp.win.open(sUrl,sName,sFeatures,bIsCrossDomain);};vp.win.resizeAndCenter=function(iWidth,iHeight,oWindow)
{if(!oWindow)
{oWindow=window;}
var bBodyAvailable=(oWindow&&oWindow.document&&oWindow.document.body)?true:false;if(!iHeight&&bBodyAvailable)
{iHeight=oWindow.document.body.scrollHeight+5;}
else if(!iHeight)
{throw new Error("vp.win.resizeAndCenter(): document.body not available- call resize window from vp.events.addToOnLoad()");}
if(!iWidth)
{iWidth=oWindow.document.body.scrollWidth;}
else if(!iWidth)
{throw new Error("vp.win.resizeAndCenter(): document.body not available- call resize window from vp.events.addToOnLoad()");}
var MAX_HEIGHT=600;var MAX_WIDTH=800;if(iWidth>MAX_WIDTH)
{iWidth=MAX_WIDTH;}
if(iHeight>MAX_HEIGHT)
{iHeight=MAX_HEIGHT;}
if(oWindow.dialogHeight)
{oWindow.dialogHeight=iHeight+"px";oWindow.dialogWidth=iWidth+"px";if(oWindow.document.body.offsetHeight<iHeight)
{oWindow.dialogHeight=(parseInt(oWindow.dialogHeight)+(iHeight-oWindow.document.body.offsetHeight))+"px";}
vp.win.center(oWindow);return;}
var fnTimeout=function()
{try
{oWindow.resizeTo(iWidth,iHeight);}
catch(err)
{}
if(bBodyAvailable)
{var oBody=oWindow.document.body;if(oBody.scrollHeight>oBody.clientHeight||oBody.scrollWidth>oBody.clientWidth){oWindow.resizeBy(0,(oBody.scrollHeight-oBody.clientHeight)+20);}}
vp.win.center(oWindow);};setTimeout(fnTimeout,10);};vp.win.getCallbackHandler=function(iCallbackID,oWin)
{if(!oWin)
{if(window.parent&&window.parent!=window)
{oWin=window.parent;}
else if(window.opener)
{oWin=window.opener;}
else
{throw new Error("vp.win.getCallbackHandler: unable to reach parent window.");}}
return oWin.__callbackHandlers[iCallbackID];};vp.win.createCallbackHandler=function(fnHandler)
{if(!window.__callbackHandlers)
{window.__callbackHandlers=[];}
var iIndex=-1;for(var i=0;i<window.__callbackHandlers.length;i++)
{try
{if(window.__callbackHandlers[i]==fnHandler)
{iIndex=i;break;}}
catch(e)
{window.__callbackHandlers.remove(i);i--;}}
if(iIndex!=-1)
{return iIndex;}
window.__callbackHandlers.add(fnHandler);return window.__callbackHandlers.length-1;};vp.win.resizeIFrameToContent=function(vIFrame,bHeight,bWidth)
{if(typeof(vIFrame)=="string")
{vIFrame=parent.document.getElementById(vIFrame);}
if(vIFrame)
{var frameDoc=vIFrame.contentDocument||vIFrame.contentWindow.document;var x,y;var scroll=frameDoc.body.scrollHeight;var offset=frameDoc.body.offsetHeight;if(scroll>offset)
{x=frameDoc.body.scrollWidth;y=frameDoc.body.scrollHeight;}
else
{x=frameDoc.body.offsetWidth;y=frameDoc.body.offsetHeight;}
if(bHeight)
{vIFrame.style.height=y+'px';}
if(bWidth)
{vIFrame.style.width=x+'px';}}};vp.win.waitForLoadAndNavigate=function(oWin,sURL)
{if(!oWin)
{return;}
else if(!oWin.document)
{var fnRetry=function()
{vp.win.waitForLoadAndNavigate(oWin,sURL);};setTimeout(fnRetry,500);}
else
{oWin.document.location.replace(sURL);}};