function OpenWindow(url,w,h){
	window.open(url,'','width='+w+',height='+h+',left='+(screen.availWidth-w-12)/2+',top='+(screen.availHeight-h-59)/2+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}

function openApp(url) {
	var w = Math.min(900,screen.availWidth)-12;
	var h = screen.availHeight-38;
	window.open(url,'','width='+w+',height='+h+',left='+(screen.availWidth-w-12)/2+',top=0,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}

function openVideo(url) {
	var w = 800-11;
	var h = 600-62;
	OpenWindow(url,w,h);
}

function openHelp(e,topic) {
	var ie4 = document.all&&navigator.userAgent.indexOf("Opera")==-1;

	if(ie4) {
		x=window.screenLeft-document.body.scrollLeft;
		y=window.screenTop-document.body.scrollTop+20;
	}
	else
	{
		x=window.screenX-window.pageXOffset;
		y=window.screenY-window.pageYOffset+42;
	}

	for(j=e; j; j=j.offsetParent)
		x+=j.offsetLeft;
	x=Math.min(x,screen.availWidth-418);

	for(j=e; j; j=j.offsetParent)
		y+=j.offsetTop;
	y=Math.min(y,screen.availHeight-490);
	
	window.open(topic,'','width=400,height=450,left='+x+',top='+y+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}

function Expand(item) {
	var n;

	if(item.sourceIndex==undefined)
		for(n=0;n<document.all.length&&document.all[n]!=item;n++);
	else
		n=item.sourceIndex;

	if(item.innerHTML=="Close") {
		var more = document.all[n-2];
		var div = document.all[n-1];
		more.innerHTML = "More...";
		div.className = "collapse";
	}
	else {
		var more = item;
		var div = document.all[n+1];
		more.innerHTML = "";
		div.className = "expand";
	}
}

