/******************************
/ Function: open_win
/ Args: url - URL to open
/		w - New window width
/		h - New window height
/ Description:
/ Open a URL in a new window
/ with an assigned width and
/ height
******************************/

function open_win(url,w,h) {
	agent = navigator.userAgent;
	windowName = "Sitelet";
		
	params  = "";
	params += "toolbar=0,";
	params += "location=0,";
	params += "directories=0,";
	params += "status=0,";
	params += "menubar=0,";
	params += "scrollbars=1,";
	params += "resizable=1,";
	params += "width=" + w + ",";
	params += "height=" + h;
		   
	win = window.open(url, windowName , params);
		
	if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
		win = window.open(url, windowName , params);
	}	
	if (!win.opener) {
		win.opener = window;
	}
	return;
}

/**************************************
/ Function: show_email
/ Args: foo - email name
/		bar - domain
/		frodo - display name
/ 		bilbo - 1/0 to show link
/ Description: 
/ Display an email address through
/ javascript
**************************************/

function show_email(foo, bar, frodo, bilbo) {
	if (bar == "") {
		bar = "rodpub.com";
	}
	// setup mailto
	if (bilbo == 1) {
		document.write("<a href='");
		document.write("mailto:");
		document.write(foo + "@");
		document.write(bar);
		document.write("'>");
	}
	// show mail or name
	if (frodo == "") {
		document.write(foo + "@");
		document.write(bar);
	} else {
		document.write(frodo);
	}
	// close mailto
	if (bilbo == 1) {
		document.write("</a>");
	}
}
		
		
/**************************************
/ Function: open_image
/ Args: img - image location
/		title - window title
/		w - window width
/ 		h - window height
/ Description: 
/ Open a new window with an image in it
/ with a certain width and height
**************************************/

function open_image(img, title, w, h) {
	window.open(img, title, config='width='+w+',height='+h);
}

