function loadFlash(swf,width,height,wmode,bgcolor,FlashVars)
{
	AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
		'width', width,
		'height', height,
		'src', swf,
		'quality', 'high',
		'pluginspage', 'http://www.adobe.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'showall',
		'devicefont', 'false',
		'id', swf,
		'bgcolor', bgcolor,
		'wmode',wmode,
		'name', swf,
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'movie', swf,
		'FlashVars', FlashVars,
		'salign', ''
		);


	document.write('<noscript>');
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width='+width+' height='+height+' id="'+swf+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="false" />');
	document.write('<param name="movie" value="'+swf+'.swf" /><param name="quality" value="high" /><param name="wmode" value="'+wmode+'" /><param name="bgcolor" value="'+bgcolor+'" />');
	document.write('<embed src="'+swf+'.swf" quality="high" wmode="'+wmode+'" bgcolor="'+bgcolor+'" width='+width+' height='+height+' name="header01" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />');
	document.write('</object>');
	document.write('</noscript>');

}

function noflash()
{
	document.write('no flash!');
}

function header()
{
	var rnd_header = "header0"+((Math.floor(Math.random()*6))+1);
	document.write('<div style="height:150px">');
	if (GetSwfVer()<8) noflash()
	else loadFlash("gfx/headers/"+rnd_header,559,150,"transparent");
	document.write('</div>');
}

var mainURL="";
if (location.href.substring(0,44)=="http://www.culturepointstudios.com/index.php" || location.href.substring(0,40)=="http://culturepointstudios.com/index.php")
{
	mainURL="http://"+location.host+"/index.php";
}
else
	mainURL="http://"+location.host+"/";

function loadPage(page)
{
	top.location.href=mainURL+"#"+page;
	top.frame_cont.location.href=page+'.php';
}

window.onresize = function()

{
	top.document.getElementById('la_tabla').style.height=0;	
	top.document.getElementById('la_tabla').style.height=top.getDocHeight();
	top.document.getElementById('la_tabla').style.height=top.document.body.offsetHeight;
}


function frame_resize()
{
	var exceso=0;
	if (navigator.appName.indexOf("Microsoft")!=-1) exceso=4

	top.document.getElementById('frame_cont').style.height=0;
	top.document.getElementById('la_tabla').style.height=0;	
	top.document.getElementById('frame_cont').style.height=top.frame_cont.getDocHeight();
	top.document.getElementById('la_tabla').style.height=top.getDocHeight()-exceso;
}

function getDocHeight()
{
	var D = document;
	return Math.max
	(
		Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
		Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
		Math.max(D.body.clientHeight, D.documentElement.clientHeight)
	);
}


function popupPic(sPicURL)
{
	window.open("pub/image_window.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
} 

function gotoPage()
{
	if (location.href==mainURL+"#news") top.frame_cont.location.href='news.php';
	if (location.href==mainURL+"#about") top.frame_cont.location.href='about.php';
	if (location.href==mainURL+"#projects") top.frame_cont.location.href='projects.php';
	if (location.href==mainURL+"#links") top.frame_cont.location.href='links.php';
	if (location.href==mainURL+"#contact") top.frame_cont.location.href='contact.php';
}

