// Shockwave javascript library
//


//------------------------------------------------------------------------
function CreatePopup( url )
{
	window.open( url, "SwitchIn.net IFrame", "menubar=0,resizable=0,width=600,height=300" );
}


//------------------------------------------------------------------------
function CalcWindowHeight()
{
	var myWidth = 0, myHeight = 0;

	if( typeof( window.innerWidth ) == 'number' )
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}

	return myHeight;
}


//------------------------------------------------------------------------
function HandleJerkoffs()
{
	var h = CalcWindowHeight();

	if( ( h < 575 ) && ( top.location != document.location ) )
	{
		top.location.replace( document.location );
	}
}


//------------------------------------------------------------------------
function EmbedShockwave( swID, swFile, swCode, swLoc )
{
	var str = '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"';
	str += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0"';
	str += ' id=' + swID + ' width=100% height=100%>\n';
	str += '<param name=src value="' + swFile + '">\n';
	str += '<param name=logo value=true>\n';
        str += '<param name=progress value=true>\n';
	str += '<param name=swStretchStyle value=stage>\n';
        str += '<param name=bgColor VALUE=#000000>\n';
	str += '<param name="sw9" value="' + swCode + '">\n';
	str += '<param name="sw8" value="' + swLoc + '">\n';
	str += '<param name=swRemote value="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '">\n';
	str += '<embed src="'+swFile+'"';
	str += 'sw9="' + swCode + '"';
	str += 'sw8="' + swLoc + '"';
	str += ' bgColor=#000000 logo=true progress=true width=100% height=100% swStretchStyle=stage ';
	str += ' swRemote="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '"';
	str += ' type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/">\n';
	str += '</embed></object>';
	document.write(str);
}


//------------------------------------------------------------------------
function InsertDCR( swID, swCrap, swCode )
{
	var str = '';

	if( swID == "si_client_2_0" )
	{
		str += '<center><iframe frameborder=0 scrolling=no width="100%" height="560" src="http://www.switchin.net/switchlaunch.php" align=top></iframe></center>';
	}
	else if( swID == "beez_client" )
	{
		str += '<center><iframe frameborder=0 scrolling=no width="100%" height="560" src="http://www.switchin.net/beezlaunch.php" align=top></iframe></center>';
	}
	else if( swID == "birdz_client" )
	{
		str += '<center><iframe frameborder=0 scrolling=no width="100%" height="560" src="http://www.switchin.net/birdzlaunch.php" align=top></iframe></center>';
	}
	else if( swID == "di_client" )
	{
		str += '<center><iframe frameborder=0 scrolling=no width="100%" height="560" src="http://www.switchin.net/diveinlaunch.php" align=top></iframe></center>';
	}

	document.write(str);
}

//------------------------------------------------------------------------
function EmbedClient( swID, swCrap, swCode )
{
	var swFile = AESDecryptCtr( swCrap, "hide_badly", 256 );
	var str = '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"';
	str += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0"';
	str += ' id=' + swID + ' width=100% height=100%>\n';
	str += '<param name=src value="' + swFile + '">\n';
	str += '<param name=logo value=true>\n';
        str += '<param name=progress value=true>\n';
	str += '<param name=swStretchStyle value=stage>\n';
        str += '<param name=bgColor VALUE=#000000>\n';
	str += '<param name="sw9" value="' + swCode + '">\n';
	str += '<param name=swRemote value="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '">\n';
	str += '<embed src="'+swFile+'"';
	str += 'sw9="' + swCode + '"';
	str += ' bgColor=#000000 logo=true progress=true width=100% height=100% swStretchStyle=stage ';
	str += ' swRemote="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '"';
	str += ' type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/">\n';
	str += '</embed></object>';
	document.write(str);
}


//------------------------------------------------------------------------
function EmbedSwitchin( swID, swFile, swCode, swRefer )
{
	var str = '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"';
	str += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0"';
	str += ' id=' + swID + ' width=100% height=100%>\n';
	str += '<param name=src value="' + swFile + '">\n';
	str += '<param name=logo value=true>\n';
        str += '<param name=progress value=true>\n';
	str += '<param name=swStretchStyle value=stage>\n';
        str += '<param name=bgColor VALUE=#000000>\n';
	str += '<param name="sw9" value="' + swCode + '">\n';
	str += '<param name="sw1" value="' + swRefer + '">\n';
	str += '<param name=swRemote value="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '">\n';
	str += '<embed src="'+swFile+'"';
	str += 'sw1="' + swRefer + '"';
	str += 'sw9="' + swCode + '"';
	str += ' bgColor=#000000 logo=true progress=true width=100% height=100% swStretchStyle=stage ';
	str += ' swRemote="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '"';
	str += ' type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/">\n';
	str += '</embed></object>';
	document.write(str);
}

//------------------------------------------------------------------------
function EmbedSwitchinD11_5( swID, swFile, swCode, swRefer )
{
	var str = '<object classid="clsid:233C1507-6A77-46A4-9443-F871F945D258"';
	str += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=11,5,8,612"';
	str += ' id=' + swID + ' width=100% height=100%>\n';
	str += '<param name=src value="' + swFile + '">\n';
	str += '<param name=logo value=true>\n';
        str += '<param name=progress value=true>\n';
	str += '<param name=swStretchStyle value=stage>\n';
        str += '<param name=bgColor VALUE=#000000>\n';
	str += '<param name="sw9" value="' + swCode + '">\n';
	str += '<param name="sw1" value="' + swRefer + '">\n';
	str += '<param name=swRemote value="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '">\n';
	str += '<param name=PlayerVersion value=11>\n';
	str += '<embed src="'+swFile+'"';
	str += 'sw1="' + swRefer + '"';
	str += 'sw9="' + swCode + '"';
	str += ' bgColor=#000000 logo=true progress=true width=100% height=100% swStretchStyle=stage ';
	str += ' swRemote="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '"';
	str += ' type="application/x-director" PlayerVersion=11 pluginspage="http://www.macromedia.com/shockwave/download/">\n';
	str += '</embed></object>';
	document.write(str);
}

//------------------------------------------------------------------------
function EmbedShockwaveObj( swID, swFile, sw1, sw2, sw3, sw4, sw5, sw6, sw7, sw8, sw9 )
{
	var str = '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"';
	str += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0"';
	str += ' id=' + swID + ' width=100% height=100%>\n';
	str += '<param name=src value="' + swFile + '">\n';
	str += '<param name=logo value=true>\n';
        str += '<param name=progress value=true>\n';
	str += '<param name=swStretchStyle value=stage>\n';
        str += '<param name=bgColor VALUE=#000000>\n';
	str += '<param name="sw9" value="' + sw9 + '">\n';
	str += '<param name="sw8" value="' + sw8 + '">\n';
	str += '<param name="sw7" value="' + sw7 + '">\n';
	str += '<param name="sw6" value="' + sw6 + '">\n';
	str += '<param name="sw5" value="' + sw5 + '">\n';
	str += '<param name="sw4" value="' + sw4 + '">\n';
	str += '<param name="sw3" value="' + sw3 + '">\n';
	str += '<param name="sw2" value="' + sw2 + '">\n';
	str += '<param name="sw1" value="' + sw1 + '">\n';
	str += '<param name=swRemote value="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '">\n';
	str += '<embed src="'+swFile+'"';
	str += 'sw9="' + sw9 + '"';
	str += 'sw8="' + sw8 + '"';
	str += 'sw7="' + sw7 + '"';
	str += 'sw6="' + sw6 + '"';
	str += 'sw5="' + sw5 + '"';
	str += 'sw4="' + sw4 + '"';
	str += 'sw3="' + sw3 + '"';
	str += 'sw2="' + sw2 + '"';
	str += 'sw1="' + sw1 + '"';
	str += ' bgColor=#000000 logo=true progress=true width=100% height=100% swStretchStyle=stage ';
	str += ' swRemote="';
	str += "swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='false' ";
	str += '"';
	str += ' type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/">\n';
	str += '</embed></object>';
	document.write(str);
}
