function redo() {
	location.href=location.href;
}


function galleryPopup(caption,folder,filename,width,height,language) {
	myWin= open("", "gallery",popOptions(width + 36, height + 60));
	myWin.document.close();
	myWin.focus();
	var show = '<title>Acme-Ochs Image Gallery</title>';
	show+= '<body bgcolor="#FFFFFF"><center>\n';
	show+= '<font face="sans-serif" size="2">\n';
	show+= '<img src="/images/gallery/' + folder + '/L/' + filename +'" ';
	show+= 'width="' + width + '" height="' + height + '"><br>';
	show+= edit(caption) + '<br>\n';
	show+= '<a href="javascript:close()">';
	if (language == 'es') {
		show += '<b>Cerrar</b>';
	} else {
		show += '<b>Close</b>';
	}
	show+= '</a><p></p>\n';
	show+= '</center>\n</body></html>\n';
	myWin.document.write(show);
}

function showPanel(caption,filename,width,height,language) {
	myWin= open("", "panel",popOptions(width + 36, height + 60));
	myWin.document.close();
	myWin.focus();
	var show = '<title>Acme-Ochs: ' + caption + '</title>';
	show+= '<body bgcolor="#FFFFFF"><center>\n';
	show+= '<font face="sans-serif" size="2">\n';
	show+= '<img src="/images/panels/' + filename +'" ';
	show+= 'width="' + width + '" height="' + height + '"><br>';
	show+= edit(caption) + '<br>\n';
	show+= '<a href="javascript:close()">';
	if (language == 'es') {
		show += '<b>Cerrar</b>';
	} else {
		show += '<b>Close</b>';
	}
	show+= '</a><p></p>\n';
	show+= '</center>\n</body></html>\n';
	myWin.document.write(show);
}
function showProject(caption,filename,width,height,language) {
	myWin= open("", "project",popOptions(width + 36, height + 60));
	myWin.document.close();
	myWin.focus();
	var show = '<title>Acme-Ochs: ' + caption + '</title>';
	show+= '<body bgcolor="#FFFFFF"><center>\n';
	show+= '<font face="sans-serif" size="2">\n';
	show+= '<img src="/images/projects/' + filename +'" ';
	show+= 'width="' + width + '" height="' + height + '"><br>';
	show+= edit(caption) + '<br>\n';
	show+= '<a href="javascript:close()">';
	if (language == 'es') {
		show += '<b>Cerrar</b>';
	} else {
		show += '<b>Close</b>';
	}
	show+= '</a><p></p>\n';
	show+= '</center>\n</body></html>\n';
	myWin.document.write(show);
}

function showShape(caption,filename,width,height,language) {
	myWin= open("", "project",popOptions(width + 36, height + 60));
	myWin.document.close();
	myWin.focus();
	var show = '<title>Acme-Ochs: ' + caption + '</title>';
	show+= '<body bgcolor="#FFFFFF"><center>\n';
	show+= '<font face="sans-serif" size="2">\n';
	show+= '<img src="/images/specialShapes/' + filename +'" ';
	show+= 'width="' + width + '" height="' + height + '"><br>';
	show+= edit(caption) + '<br>\n';
	show+= '<a href="javascript:close()">';
	if (language == 'es') {
		show += '<b>Cerrar</b>';
	} else {
		show += '<b>Close</b>';
	}
	show+= '</a><p></p>\n';
	show+= '</center>\n</body></html>\n';
	myWin.document.write(show);
}



function popOptions(wid,hgt,scroll) {
	opt = 'resizable=no,width=' + wid + ',height=' + hgt + ',';
	opt += 'innerWidth=' + wid + ',innerHeight=' + hgt + ',';
	opt += 'marginWidth=0,marginHeight=0,leftmargin=0,topmargin=0,';
	opt += 'status=no,toolbar=no,menubar=no,';
	if (scroll) {
		opt += 'scrollbars=yes';
	} else {
		opt += 'scrollbars=no';
	}
	return opt;
}



function clearCookie(name) {
	var now=new Date();
	var expDate = new Date();
	expDate.setTime(now.getTime()+(7*86400*1000));
	var exp =  ' expires=' + expDate.toGMTString() + '; path=/';
	if(confirm('Clear all entries and start over?')) {
		document.cookie= '' + name + '=\;' + exp;
	}
	location.href=location.href;
}


function edit(tstring) {
	nstring='';
	if (tstring) {
		for(var i=0;i<=tstring.length;i++) {
			if (tstring.charAt(i)=='"') {
				nstring += ' in.';
			} else {
				nstring += tstring.charAt(i);
			}
		}
		return nstring;
	} else {
		return '';
	}
}

function convert(tstring) {
	nstring='';
	for(var i=0;i<=tstring.length;i++) {
		if (tstring.charAt(i)==' ') {
			nstring+= '+';
		} else {
			nstring += tstring.charAt(i);
		}
	}
	return nstring;
}

