// PopOpen version 1.2  2009/01/12 02:23:24  DragonAss

// Move Window JavaScript companion (facilitates the old "move_site" function)
// Copyright 2002 Jared Pipher (aka DragonAss) Bust-n-Buns, Inc. [ <--- historical]

// Still using this file too... but currently will also be using 
// the OverLib.js along with Smarty (trying it on for size anyway).
// okay... we're back.  The OverLib is only for tooltip-style popups.
// (from what I can tell) ... so we're gonna use this file afterall.
// To avoid conflicting names, er, we call this "PopOpen"
function Clean()
	{
	if(window.popupWin) { popupWin.close(); }
	}

function popOpen(SiteURL,vert_pixels,horz_pixels,status,resizable,scrollbars,left,top)
	{
	 //= 450;	 = 500;



	//winFeatures = 'null';
	winFeatures = 'width='+horz_pixels+',height='+vert_pixels;
	//winFeatures += ',status=no,resizable=yes,scrollbars=yes';
	//winFeatures += ',status=no,resizable=no,scrollbars=no';
	winFeatures += ',location=no,toolbar=no,menubar=no,titlebar=no,directories=no,fullscreen=no';
	winFeatures += ',status='+status+',resizable='+resizable+',scrollbars='+scrollbars;

	mozFeatures = 'dialogWidth:'+horz_pixels+'px;';
 	mozFeatures += ' dialogHeight:'+vert_pixels+'px;';
	mozFeatures +=' status:'+status+'; resizable:'+resizable+'; scroll:'+scrollbars+';';
	mozFeatures +=' location:no; toolbar:no; menubar:no; titlebar:no; directories:no; fullscreen:no;';
	mozFeatures +=' edge:sunken; help:no;';

	//mid_left = ( (screen.availWidth/2) - (200) );
	//mid_top = ( (screen.availHeight/2) - (100) );

	if(left == 'center')
		{
		mid_left = ( ( (screen.availWidth - horz_pixels) / 2)  );
		}
	else
		{
		mid_left = left;
		}
	if(top == 'center')
		{
		mid_top = ( ( (screen.availHeight - vert_pixels) / 2) );
		}
	else
		{
		mid_top = top;
		}

		winFeatures += ',left='+mid_left+',top='+mid_top;
		mozFeatures += 'screenX: '+mid_left+'; screenY: '+mid_top+';';
		//sFeatures += 'dialogLeft: '+mid_left+'px; dialogTop: '+mid_top+'px;';
		//sFeatures += ' center: yes;';


	if(navigator.appName.indexOf("Microsoft")>=0) 
		{
		sFeatures = winFeatures;
		}
	else
		{
		sFeatures = mozFeatures;
		}

	Clean();
	// if(window.moverWin) { moverWin.close(); }

	//formURL = 'move_form.php?siteID='+SiteID+'&sort_key='+java_sort_key+'&post_action='+java_post_action;

	popupWin = window.open(SiteURL,'PopUpDialog',sFeatures);
	// deleteMe  popWinTest = window.open(SiteURL,'PopTest','location=no,toolbar=no,menubar=no,titlebar=no,status=0');
	//popupWin = window.open('home.php','PopUpDialog',winFeatures); //
	//popupWin.write(SiteURL);
		//	window.showModelessDialog('move_form.php?siteID='+SiteID,SiteID,sFeatures); 
	//window.showModalDialog('move_form.php?siteID='+SiteID,SiteID,sFeatures); 
	}

function PopUp(SiteURL)
	{
	// Basically just a popOpen, but only need give a URL + we'll pick some defaults...	
	// This function replaces the once separate popup.js 
	var vert_pixels = 400;
	var horz_pixels = 500;
	var status = "no";
	var resizable = "yes";
	var scrollbars = "yes";
	var left = 100;
	var top = 50;
	popOpen(SiteURL,vert_pixels,horz_pixels,status,resizable,scrollbars,left,top);
	}