/******************************************************************************************************/
/* POPUP flash to js
/******************************************************************************************************/
var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=410,height=325';

function isUndefined(v)
{
    var undef;
    return v===undef;
}

function popup(url, target, features)
{
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target)) target = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
}

function pop(e)
{
	popup(e.href, e.target);
	return false;
}

/******************************************************************************************************/
/* RESIZING flash to js
/******************************************************************************************************/
function setSize(w, h)
{
	if (w) setWidth(w);
	if (h) setWidth(h);
}

function setWidth(w)
{
	if (w == '100%') w = getFullWidth();
	var el = document.getElementById('flashcontent');
	if (el) el.width = w;
}

function setHeight(h)
{
	if (h == '100%') h = getFullHeight();
	var el = document.getElementById('flashcontent');
	if (el) el.height = h;
}



/******************************************************************************************************/
/* SCROLLING flash to js
/******************************************************************************************************/
function scrollUp()
{
	scrollToY(0);
}

var contentHeight = '100%';
function scrollDown()
{
	var yPos = contentHeight;
	if (yPos == '100%')
	{
		yPos = getFullHeight();
	}
	scrollToY(yPos);
}

function scrollToY(yPos)
{
	if (!yPos)
	{
		yPos = 0;
	}
	window.scrollTo(0, yPos);
}

/******************************************************************************************************/
/* SOUND js to flash
/******************************************************************************************************/
function setVolume(vol)
{
	var volume = vol || 100;
	thisMovie("flashcontent").setVolume(volume);
}

function toggleMute()
{
	thisMovie("flashcontent").toggleMute();
}


/******************************************************************************************************/
/* HELPER FUNCTIONS
/******************************************************************************************************/
function thisMovie(movieName)
{
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        return window[movieName];
    } else {
        return document[movieName];
    }
}


function getInnerHeight()
{
	if (window.innerHeight)
	{
		// all except Explorer
		return window.innerHeight;
	} 
	var d = window.document;
	if (d.documentElement && d.documentElement.clientHeight)
	{ 
		// Explorer 6 Strict Mode
		return d.documentElement.clientHeight;
	} 
	// other Explorers
	return d.body.clientHeight;
}

function getInnerWidth()
{
	if (window.innerWidth)
	{ 
		// all except Explorer
		return window.innerWidth;
	}
	var d = window.document;
	if (d.documentElement && d.documentElement.clientWidth)
	{
		// Explorer 6 Strict Mode
		return d.documentElement.clientWidth;
	}
	// other Explorers
	return d.body.clientWidth; 
}

function getFullHeight()
{
	return Math.max(getInnerHeight(), 680);
}

function getFullWidth()
{
	return getInnerWidth() >= 1000 ? '100%' : 1000;
}



