/*
 * Created on Juni 14th 2004.
 *
 * Copyright (C) 2004 Wolfram Fenske.
 *
 * All rights reserved. Alle Rechrte vorbehalten.
 *
 */

//<script language=jscript>
function showPic(uri, title, picWidth, picHeight)
{
	var winWidth = picWidth + 8;
	var winHeight = picHeight + 8;
	var popup = window.open("","picture","width=" + winWidth + ", height=" + winHeight + ", history=no, resizable=no, status=no, scrollbars=no, toolbar=no,location=no, menubar=no, directories=0, dependent=yes");
		popup.resizeTo(winWidth+8,winHeight+35);
		popup.document.open();
		popup.document.write('<html><head><title>Inmost Dense - ' + title + '</title><link rel="stylesheet" type="text/css" href="css/global.css"></head><body class="picture"><div style="text-align:center; vertical-align:middle;"><table width="100%" height="100%"><tr><td class="noborder"><a class="pic" href="javascript:self.close();"><img  class="bordergrey" src="'+uri+'" width="'+picWidth+'" height="'+picHeight+'" alt="Click anywhere to close."></a></td></tr></table></div></body></html>');
		popup.document.close();
		popup.moveTo((screen.width-winWidth)/2, (screen.height-winHeight)/2); 
		popup.focus()
}

function getContentFrame()
{
	var frame;
	frame = parent;
	if(frame.parent != null)
	{
		frame = frame.parent;
	}
	frame = frame.frames[2];
	return frame;
}

function getFramesetCode(category, page)
{
	return '<frameset cols="*, 142" border="0" frameborder="0" framespacing="0"><frame src="'+page+'" name="subcontent"><frame src="'+category+'nav.html" name="subnav"></frameset>';
}

function showSubPage(category, page)
{
	var content = getContentFrame();
	var framesetCode = getFramesetCode(category, page);
	
	content.document.open();
	content.document.write('<html><head><title>ContentFrame</title><link rel="stylesheet" type="text/css" href="css/global.css"></head>' + framesetCode + '</html>');
	content.document.close();
}

function getSubPageHref(category, page)
{
	return 'javascript:showSubPage(\''+category+'\', \''+page+'\')';
}

function makeSubPageLinks()
{
	for(var i=0; i < document.links.length; ++i)
	{
		var category = null;
 		if(document.links[i].href.match(/releases\w+\.html/))
			category = 'releases';
		if(document.links[i].href.match(/media\w+\.html/))
			category = 'media';
		if(category != null)
		{
			//alert(document.links[i].href + "\nis in category: " + category);
			//alert(document.links[i].target);
			document.links[i].href = getSubPageHref(category, document.links[i].href);
			document.links[i].target = '';
		}
	}
}
