
var w1 = null; 

/* open popup width=w, height=h pixels. 
   Pops up in upper right corner.
   pageLink is an optional string of any value to accept src as link without http prefix as in advetiser link.
   Window will close automatically when unloading page with:  <body onunload = "w1.close();" > 
*/     
function openWin( src, w, h, pageLink )  
{										
	if( !w) w = screen.availWidth-25; 
	
	if( screen.width < 810 ) {
		if(h>500) h=500;
	}
	if(w1)w1.close(); 
	var aW = w+25;
	
	if(pageLink){ 
	if( src.indexOf('http://') < 0 ) {
		src = 'http://' + src;
	}}
	
	w1 = window.open( src, 'temp1', 'width='+w+', height=' +h+ ', left='+(screen.availWidth-aW)+', top=30, scrollbars=yes, status=no, resizable=yes');
	w1.focus(); 
}
function openWinWarning( src, w, h, pageLink )  
{										
	wx = screen.availWdith-25; 
	
	left = parseInt( wx / 2); 
	
	if(w1)w1.close(); 
	
	w1 = window.open( src, 'temp1', 'width='+w+', height=' +h+ ', left=500, top=300, scrollbars=no, status=no, resizable=no');
	w1.focus(); 
}
/* changes all nodes with color attribute to black */	
function changeNodesToBlack( obj ) {
	var c = obj.childNodes;
	for( var j=0; j < c.length; j++ ) {
		//if( c[j].color )  { c[j].color = 'black'; }
		if( c[j].style ) { c[j].style.color = 'black'; } 
		changeNodesToBlack( c[j] ); 
	}
	
}

/*Prefixes url with http, if not already there; needed for user input of url as they typically will leave off http://*/
function returnUrlLink( link ){
	if( !link ){ var link = document.getElementById("urlLink").value; }

	if( link.indexOf('http://') < 0 ) {
		link = 'http://' + link;
	}
	return link; 
}

function openWin2( src, w, h, pageLink )  
{										
	if( !w) w = screen.availWdith-25; 
	
	if( screen.width < 810 ) {
		if(h>500) h=500;
	}
	if(w2)w2.close(); 
	var aW = w+25;
	
	if(pageLink){ 
	if( src.indexOf('http://') < 0 ) {
		src = 'http://' + src;
	}}
	
	w2 = window.open( src, 'temp2', 'width='+w+', height=' +h+ ', left='+(screen.availWidth-aW)+', top=30, scrollbars=yes, status=no, resizable=yes');
	w2.focus(); 
}