
var winReference=null;function openPositionedWindow(url,name,width,height,x,y,status,scrollbars,moreProperties,openerName){var agent=navigator.userAgent.toLowerCase();if(agent.indexOf("mac")!=-1&&agent.indexOf("msie")!=-1&&(agent.indexOf("msie 4")!=-1||agent.indexOf("msie 5.0")!=-1)){height+=(status)?17:2;}
width+=(scrollbars!=''&&scrollbars!=null&&agent.indexOf("mac")==-1)?16:0;var properties='width='+width+',height='+height+',screenX='+x+',screenY='+y+',left='+x+',top='+y+((status)?',status':'')+',scrollbars'+((scrollbars)?'':'=no')+((moreProperties)?','+moreProperties:'');var reference=openWindow(url,name,properties,openerName);return reference;}
function openCenteredWindow(url,name,width,height,status,scrollbars,moreProperties,openerName){var x,y=0;if(screen){x=(screen.availWidth-width)/2;y=(screen.availHeight-height)/2;}
if(!status)status='';if(!openerName)openerName='';var reference=openPositionedWindow(url,name,width,height,x,y,status,scrollbars,moreProperties,openerName);return reference;}
function openCenteredOnOpenerWindow(url,name,width,height,status,scrollbars,moreProperties,openerName){var centerX=0;var centerY=0;if(window.screenX!=null&&window.outerWidth){centerX=window.screenX+(window.outerWidth/2);centerY=window.screenY+(window.outerHeight/2);}
else if(window.screenLeft){if(document.documentElement){centerX=window.screenLeft+(document.documentElement.offsetWidth/2);centerY=window.screenTop+(document.documentElement.offsetHeight/2);}
else if(document.body&&document.body.offsetWidth){centerX=window.screenLeft+(document.body.offsetWidth/2);centerY=window.screenTop+(document.body.offsetHeight/2);}}
if(centerX==0){openCenteredWindow(url,name,width,height,status,scrollbars,moreProperties,openerName);}
var x=parseInt(centerX-(width/2));var y=parseInt(centerY-(height/2));if(!status)status='';if(!openerName)openerName='';var reference=openPositionedWindow(url,name,width,height,x,y,status,scrollbars,moreProperties,openerName);return reference;}
function openMaxedWindow(url,name,scrollbars,openerName){var x,y=0;var width=600;var height=800;if(screen){if(screen.availLeft){x=screen.availLeft;y=screen.availTop;}
width=screen.availWidth-6;height=screen.availHeight-29;}
var reference=openPositionedWindow(url,name,width,height,x,y,false,scrollbars,openerName);return reference;}
function openFullChromeWindow(url,name,openerName){return openWindow(url,name,'directories,location,menubar,resizable,scrollbars,status,toolbar');}
function openSizedFullChromeWindow(url,name,width,height,openerName){return openCenteredWindow(url,name,width,height,true,true,'directories,location,menubar,resizable,toolbar',openerName)}
function openWindow(url,name,properties,openerName){var agent=navigator.userAgent.toLowerCase();if(agent.indexOf("msie 4")!=-1&&agent.indexOf("win")!=-1&&url.indexOf('http://')==0){winReference=window.open('about:blank',name,properties);setTimeout('if (winReference && !winReference.closed) winReference.location.replace("'+url+'")',300);}
else{winReference=window.open(url,name,properties);}
setTimeout('if (winReference && !winReference.closed) winReference.focus()',200);if(openerName)self.name=openerName;return winReference;}
function closeDialog(dialog){if(dialog&&dialog.closed!=true)dialog.close();}
function closeParentDialog(){if(top.opener&&isWindowPopup(top.opener)){root=top.opener.top.opener;top.opener.close();top.opener=root;}}
function isWindowPopup(win){return((win.opener)?true:false);}
function openPopup(url){openCenteredWindow(url,'popup',651,504,'',true);}
function openShoppingWithDymoPopup(url){openCenteredWindow(url,'popup',631,504,'',true);}
function openGuaranteePopup(url){openCenteredWindow(url,'popup',631,200,'',true)}