var testpopup2;

var FromMap;

function initCap(str) { 
/* First letter as uppercase, rest lower */ 
var str = str.substring(0,1).toUpperCase() + str.substring(1,str.length).toLowerCase(); 
return str; 
} 

function addOption(selectbox,text,value ) {
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}


function tapeMaster(afile) {
	

	FromMap = 1;
	
	newText = afile.replace(".html", ""); 
	newText = newText.replace("/divs/", "");
	newText = newText.replace(/\_/g, " ");

		
	document.getElementById('welcome').innerHTML="welcome to <b>" + newText +"</b>!";
	document.getElementById('welcome').style.visibility = 'visible';

	
document.getElementById("filename").value = afile;
//	document.forms[0].elements["filename"].value  = afile;	

//	document.getElementById('pics').innerHTML="";
//	document.getElementById('belt').innerHTML="";
//	
//	 document.getElementById('pics').innerHTML='<script type="text/javascript" 	src="/divs.js"></script>';
//
//var d = document.getElementById('pics');
//var s = document.createElement('SCRIPT');
//s.type = 'text/javascript';
//s.src = 'divs.js';
//d.appendChild(s);

var d1 = document.getElementById('pics1');

//if ( d1.hasChildNodes() )
//{
//    while ( d1.childNodes.length >= 1 )
//    {
//        d1.removeChild( d1.firstChild );       
//    } 
//}


var s1 = document.createElement('SCRIPT');
s1.type = 'text/javascript';
s1.src = '/js/thumbnailviewer.js';

var b1 = document.createElement('br');
d1.appendChild(s1);


// return false;	
	// document.write('<script type="text/javascript" 	src="divs.js"></script>'); 
	// <script src="/js/thumbnailviewer.js" type="text/javascript"></script>


};



function DressWin1(afile) {
	testpopup2 = new PopupWindow("testdiv1");
	// testpopup2.offsetY = 25;
	// testpopup2.autoHide();
	
	//testpopup2 = new PopupWindow();
	testpopup2.offsetX=100;
	testpopup2.offsetY=50;
	testpopup2.setSize(820,220);
	testpopup2.autoHide();
//	testpopup2.populate("<B>THIS IS A TEST</B>");
	testpopup2.setUrl("/test.html");	
		
//	testpopup3 = new PopupWindow("testdiv2");
//	testpopup3.offsetY=20;
//	
//	testpopup4 = new PopupWindow();
//	testpopup4.setSize(200,200);
//	testpopup4.autoHide();
//	testpopup4.setUrl("http://www.cnn.com/");	
	
	
	
//// Create an object for a WINDOW popup
//var win = new PopupWindow(); 
//
//// Create an object for a DIV window using the DIV named 'mydiv'
////var win = new PopupWindow('mydiv'); 
//
//// Set the window to automatically hide itself when the user clicks 
//// anywhere else on the page except the popup
//// win.autoHide(); 
//
//// Show the window relative to the anchor name passed in
//win.showPopup('test');
//
//// Hide the popup
//// win.hidePopup();
//
//// Set the size of the popup window (only applies to WINDOW popups
//win.setSize(850,240);
//
//// Populate the contents of the popup window that will be shown. If you 
//// change the contents while it is displayed, you will need to refresh()
//win.populate('ddddddddddddddddddd');
//
//// set the URL of the window, rather than populating its contents
//// manually
//// win.setUrl("/test.html");
//
//// Refresh the contents of the popup
//// win.refresh();
//
//// Specify how many pixels to the right of the anchor the popup will appear
//win.offsetX = 50;
//
//// Specify how many pixels below the anchor the popup will appear
//win.offsetY = 100;

/*
NOTES:
1) Requires the functions in AnchorPosition.js
2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>
3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.
4) When a PopupWindow object is created, a handler for 'onmouseup' is
   attached to any event handler you may have already defined. Do NOT define
   an event handler for 'onmouseup' after you define a PopupWindow object or
   the autoHide() will not work correctly.
*/ 


// toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=420,height=400,left=430,top=23  return false;
//	newWin = open(afile, 0, "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=820,height=220,left=30,top=30"); 
//	newWin.focus();
//	return false;

};


