﻿function FN_openWin(thisPage, preWidth, preHeight){

	screenHeight=screen.height*.7;
	myScrollBars=1;
	myWidth=preWidth+20;

	myX=(screen.width-myWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myY=(screen.height-screenHeight)/2 // center on page

	newPage=thisPage

	commands='toolbar=0,location=0,statusbar=0,scrollbars='
	commands+=myScrollBars
	commands+=',width='
	commands+=myWidth
	commands+=',height='
	commands+=preHeight
	commands+=',resizable=1'

	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}

function addzero(num){
	if (num<10) return "0"+num
	return num;
}

function FN_getNewWin(thisPage){
	var xname="";
		Stamp = new Date();
		xname += addzero(Stamp.getHours());
		xname += addzero(Stamp.getMinutes());
		xname += addzero(Stamp.getSeconds());

	offset=80;
	myWidth=774+offset;
	myHeight=424+offset;

	commands='toolbar=0,location=0,statusbar=0,scrollbars=1'
	commands+=',width='
	commands+=myWidth
	commands+=',height='
	commands+=myHeight
	commands+=',resizable=1'

	
	NewWindow = window.open(thisPage, xname, commands)

	myX=(screen.width-myWidth) / 2 
	myY=20 // compensate for mac/windows bars
	myY=(screen.height-myHeight)/2
		NewWindow.moveTo(myX,myY);
		NewWindow.focus();	
}


function FN_audioWin(thisPage){

	parts=thisPage.split(" ");
	if (parts.length>1){
		thisPage=parts.join("&MED[]=")
	}



	screenHeight=screen.height/2;
	myWidth=465;

	fakWidth=myWidth;


	myX=(screen.width-fakWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myWidth+=20;


	myY=(screen.height-screenHeight)/2 // center on page
	

	newPage="http://site.paracletepress.com/forms/audioPop.php?MED[]="+thisPage;

	commands='toolbar=0,location=0,scrollbars='
	commands+=0
	commands+=',width='
	commands+=myWidth
	commands+=',height='
	commands+=220
	commands+=',resizable=1'

	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}

function FN_audioExWin(thisPage,texts){

	parts=thisPage.split(" ");
	if (parts.length>1){
		thisPage=parts.join("&MED[]=")
	}


	parts=texts.split("~");
	if (parts.length>1){
		texts=parts.join("&TXT[]=")
	}


	screenHeight=screen.height/2;
	myWidth=465;

	fakWidth=myWidth;


	myX=(screen.width-fakWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myWidth+=20;


	myY=(screen.height-screenHeight)/2 // center on page
	

 	newPage="http://site.paracletepress.com/forms/audioExternalPop.php?MED[]="+thisPage+"&TXT[]="+texts;

	commands='toolbar=0,location=0,scrollbars='
	commands+=0
	commands+=',width='
	commands+=myWidth
	commands+=',height='
	commands+=220
	commands+=',resizable=1'

	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}

function FN_videoWin(thisPage){

	parts=thisPage.split(" ");
	if (parts.length>1){
		thisPage=parts.join("&MED[]=")
	}

	screenHeight=screen.height/2;

	myHeight=360;
	myWidth=465;

	fakWidth=myWidth;


	myX=(screen.width-fakWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myWidth+=20;


	myY=(screen.height-screenHeight)/2 // center on page
	

	newPage="http://site.paracletepress.com/forms/videoPop.php?MED[]="+thisPage;

	commands='toolbar=0,location=0,scrollbars='
	commands+=0
	commands+=',width='
	commands+=myWidth
	commands+=',height='
	commands+=myHeight
	commands+=',resizable=1'


	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}

function FN_videoWinUT(thisPage){

	parts=thisPage.split(" ");
	if (parts.length>1){
		thisPage=parts.join("&MED[]=")
	}


	screenHeight=screen.height/2;

	myHeight=418;
	myWidth=580;

	fakWidth=myWidth;


	myX=(screen.width-fakWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myWidth+=20;


	myY=(screen.height-screenHeight)/2 // center on page
	

	newPage="http://site.paracletepress.com/forms/videoPopUT.php?MED[]="+thisPage;

	commands='toolbar=0,location=0,scrollbars='
	commands+=0
	commands+=',width='
	commands+=myWidth
	commands+=',height='
	commands+=myHeight
	commands+=',resizable=1'

	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}



function FN_catalogWin(thisPage){

	screenHeight=screen.height/2;
	myWidth=465;

	fakWidth=myWidth;


	myX=(screen.width-fakWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myWidth+=20;


	myY=(screen.height-screenHeight)/2 // center on page
	

	newPage="http://site.paracletepress.com/forms/"+thisPage;

	commands='toolbar=0,location=0,scrollbars='
	commands+=0
	commands+=',width='
	commands+=510
	commands+=',height='
	commands+=480
	commands+=',resizable=1'

	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}

function FN_download(thisPage){

	screenHeight=screen.height/2;
	myWidth=465;

	fakWidth=myWidth;


	myX=(screen.width-fakWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myWidth+=20;


	myY=(screen.height-screenHeight)/2 // center on page
	

	newPage="http://site.paracletepress.com/forms/"+thisPage;

	commands='toolbar=0,location=0,scrollbars='
	commands+=0
	commands+=',width='
	commands+=320
	commands+=',height='
	commands+=400
	commands+=',resizable=1'

	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}

function FN_contactWin(who){

	screenHeight=screen.height/2;
	myWidth=470;

	fakWidth=myWidth;


	myX=(screen.width-fakWidth) / 2 
	myY=20 // compensate for mac/windows bars

	myWidth+=20;


	myY=(screen.height-screenHeight)/2 // center on page

	page="http://paracletewebdesign.com/paraclete-contact-form/emailer.php?m=";
	newPage=page;
	newPage+=who;

	commands='toolbar=0,location=0,scrollbars='
	commands+=0
	commands+=',width='
	commands+=myWidth
	commands+=',height='
	commands+=460
	commands+=',resizable=1'

	NewWindow = window.open(newPage, "windowname", commands)

	NewWindow.moveTo(myX,myY);
	NewWindow.focus();

}
// -->
