// Begin Arcadiy Advanced Pop-Up Script
// To use this script, include the following sample code inside of the <A HREF=""> tag:
// javascript:openNewWindow('http://www.arcadiy.com/',760,500,'yes','yes','yes','yes','yes','yes');
// 
// The following settings can be configured in this order:
// 1) URL
// 2) Window Width (pixels)
// 3) Window Height (pixels)
// 4) Toolbar Visible (yes / no)
// 5) Location Bar Visible (yes / no)
// 6) Bottom Status Bar Visible (yes / no)
// 7) Menubar Visible (yes / no)
// 8) Scrollbars (yes / no)
// 9) Window Resizable (yes / no)
//
// ENJOY!

popWindow=null;
function openNewWindow(url,width,height,toolbar,location,status,menubar,scrollbars,resizable) {
  windowName="new_popup";
  leftCorner=screen.width/2 - width/2;
  topCorner=screen.height/2 - height/2;
  features=",screenX="+leftCorner+",screenY="+topCorner+",left="+leftCorner+",top="+topCorner;
  features=features+",toolbar="+toolbar+",location="+location+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable;
  //features=",toolbar="+toolbar+",location="+location+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable;
  
  if ((navigator.appVersion.indexOf('Win') != -1) && (navigator.appName == "Microsoft Internet Explorer")) {
     
     if (popWindow==null) {
        popWindow=open(url,'', "width="+width+",height="+height+ features);        
        popWindow.focus();
        }
     else {
        popWindow.close();
        popWindow=null;
        popWindow=open(url,'', "width="+width+",height="+height+features);
        popWindow.focus();        
    }
  }
  else {    
    popWindow=window.open(url,windowName, "width="+width+",height="+height+ features);
    popWindow.focus();
  }
}

popMenu=null;
function openMenuWindow(url,width,height,toolbar,location,status,menubar,scrollbars,resizable) {
  var leftCorner=screen.width/2 - width/2;
  var topCorner=screen.height/2 - height/2;
  var features=",screenX="+leftCorner+",screenY="+topCorner+",left="+leftCorner+",top="+topCorner;  
  features=features+",toolbar="+toolbar+",location="+location+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable;
  //features=",toolbar="+toolbar+",location="+location+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable;
      
  popMenu=window.open(url,"Menu", "width="+width+",height="+height+ features);
  //popMenu.resizeTo (width,height);
  popMenu.focus();
}


/* C.Chin; this function will redirect use to the help section; it's used for the KeyToRatings[vertical].htm pages */
function help()
{	
	window.opener.location = '/help/index.aspx' + window.location.search;self.close();
}

function OpenWindow(url, width, height, toolbar, location, status, menubar, scrollbars, resizable, reuse)
{

	leftCorner = screen.width/2 - width/2;
	topCorner = screen.height/2 - height/2;
	features = ",screenX="+leftCorner+",screenY="+topCorner+",left="+leftCorner+",top="+topCorner;
	features = features+",toolbar="+toolbar+",location="+location+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable;
  //features=",toolbar="+toolbar+",location="+location+",status="+status+",menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable;
  
  if (reuse==0)
  {
	popWindow=null;
	}
  
  if ((navigator.appVersion.indexOf('Win') != -1) && (navigator.appName == "Microsoft Internet Explorer")) {
     if (popWindow==null) {
        popWindow=open(url,'', "width="+width+",height="+height+ features);
        }
     else if (reuse=='1') {		
        popWindow.close();
        popWindow=null;
        popWindow=open(url,'', "width="+width+",height="+height+features);
    }
  }
  else {
	
	popWindow=window.open(url,'', "width="+width+",height="+height+ features);
    
    //popWindow.resizeTo (width,height);
    popWindow.focus();
    
  }
}
		   
function ViewAllPhoto(url){
var wHeight=520;
var wWidth=680;			
if (window.navigator.userAgent.toLowerCase().indexOf('firefox')>-1){wWidth=670;}
openNewWindow(url,wWidth,wHeight,'no','no','yes','no','yes','yes');}

function virtualtour(url){
width=348;
height=520;
leftCorner = screen.width/2 - width/2;
topCorner = screen.height/2 - height/2;
features = "width="+width+",height="+height+",screenX="+leftCorner+",screenY="+topCorner+",left="+leftCorner+",top="+topCorner;
features=features+",toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0";
tour=window.open(url,'tour', features);
}

function redirect(url)
{
opener.location.href=url
window.close()
}
