/* Created on Nov 14, 2006
   Adds foundational javascript functionality for Lulu.com
 */


/* determine which javascript library is available */

library = 'MochiKit';

function toggleHelp(id){
	MochiKit.Visual.toggle(id, 'blind', {duration : .2});
	return false;
}

function popup(iUrl, iName, w, h, scroll, titlebar)
{
	if( !w ) {
		w = 650;
	}
	if( !h ) {
		h = 500;
	}
		if( !scroll ) {
				scroll = "yes";
		}
	if( scroll == "" ) {
		scroll = "yes";
	}
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'

	if (!this.winHandle) {
		this.winHandle=window.open(iUrl, iName, winprops);
	}
 	else {
 		if (this.winHandle && !this.winHandle.closed) {
 			this.winHandle.close();
 		}
 		this.winHandle=window.open(iUrl, iName, winprops);
 		this.winHandle.focus();
 	}
 	this.winHandle.focus();
}
