

//******************************************
//*****Function: popUp2
//*****Description: Opens up new popup window for given parameters.
//*****Ensures window is sized large enough to fit the given width and height variables.
//******************************************
function popUp2(id,url,width,height)
	{
	//set variables
	windowName = id + width + "x" + height;		//gives window an individual name (dependent upon dimensions)

	windowWidth = width;
	windowHeight = height;
	windowURL = url;
	scrollbars = 0;
	// set sizes
	if (width>=windowWidth-20){ windowWidth=width+20;}
	if (height>=windowHeight-100){windowHeight=height+100;}


	

	if (id=="topo")
		{
		windowWidth = 280;
		windowHeight = 300;
		windowURL = "topo.asp";
		scrollbars = 0;
		// set sizes
		if (width>=windowWidth-20){ windowWidth=width+20;}
		if (height>=windowHeight-100){windowHeight=height+100;}
		}

		if (id=="brands")
		{
		windowWidth = 300;
		windowHeight = 300;
		windowURL = "brandinfo.cfm";
		scrollbars = 1;
		// set sizes
		if (width>=windowWidth-20){ windowWidth=width+20;}
		if (height>=windowHeight-100){windowHeight=height+100;}
		}
	
		if (id=="jargon")
		{
		windowWidth = 400;
		windowHeight = 400;
		windowURL = "../trailwalk/static/jargonbuster.html";
		scrollbars = 1;
		// set sizes
		if (width>=windowWidth-20){ windowWidth=width+20;}
		if (height>=windowHeight-100){windowHeight=height+100;}
		}
	
	if (id=="gearguide")
		{
		windowWidth = 400;
		windowHeight = 400;
		windowURL = "../trailwalk/static/index.html";
		scrollbars = 1;
		// set sizes
		if (width>=windowWidth-20){ windowWidth=width+20;}
		if (height>=windowHeight-100){windowHeight=height+100;}
		}
	
	if (id=="route"){
		windowWidth = 280;
		windowHeight = 300;
		windowURL = "route.asp";
		scrollbars = 0;
		// set sizes
		if (width>=windowWidth-20){ windowWidth=width+20;}
		if (height>=windowHeight-100){windowHeight=height+100;}
	}

	if (id=="crag"){
		windowWidth = 280;
		windowHeight = 380;
		windowURL = "crag.asp";
		scrollbars = 0;
		// set sizes
		if (width>=windowWidth-20){ windowWidth=width+20;}
		if (height>=windowHeight-100){windowHeight=height+100;}
	}
	

	// error handling for oversize images
	if (height>=600){ windowHeight=600;scrollbars=1;}
	if (width>=700){ windowWidth=700;scrollbars=1;}
	

	if (url){
		windowURL = windowURL + url;
	}

	windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" +scrollbars+ ",resizable=0,copyhistory=0,width=" +windowWidth+ ",height=" +windowHeight+ ",left=0,top=0"

	newwindow = window.open(windowURL,windowName,windowProps);
	newwindow.focus();
	}
//******************************************


//******************************************
//*****Function: popUp
//*****Description: Opens up new popup window for given parameters.
//******************************************
function popUp(id,url)
	{
	windowName = id;

		
		
	if (id=="brands")
		{
		windowURL = "brandinfo.cfm";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=300,height=600,left=0,top=0"
		}
		
	

	if (id=="privacy")
		{
		windowURL = "../TermsConditions/privacy.asp";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=360,height=480,left=0,top=0"
		}
	
	if (id=="techspec2")
		{
		windowURL = "test2.asp";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=360,height=480,left=0,top=0"
		}
	
	if (id=="stages2")
		{
		windowURL = "stages2.asp";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=360,height=480,left=0,top=0"
		}				

	if (id=="paths")
		{
		windowURL = "paths.asp";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=360,height=480,left=0,top=0"
		}				
	
	if (id=="gradient")
		{
		windowURL = "gradient.asp";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=530,height=200,left=0,top=0"
		}
	
	if (id=="topo")
		{
		windowURL = "topo.asp";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=380,height=380,left=0,top=0"
		}

	
		
	if (id=="ordermap")
		{
		windowURL = "order_map.asp";
		if (url)
			{
			windowURL = windowURL + url;
			}
		windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=360,height=480,left=0,top=0"
		}
		
	newwindow = window.open(windowURL,windowName,windowProps);
	newwindow.focus();
	}
//******************************************


function popupMap(id,url,width,height)
	{
	windowName = id + width + "x" + height;		//gives window an individual name (dependent upon dimensions)
	windowProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=" + width + ",height=" + height + ",left=0,top=0";

	newwindow = window.open(url,windowName,windowProps);
	newwindow.focus();
	
	
}


