﻿// General Function
function resizepage()
{

  if (readCookie("noscroll") == null)
  {
    
      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;
      }
      
	    b = document.getElementById("pagebody");
	    b.style.height = myHeight - 290 + "px";
	}
	else
	{
		b = document.getElementById("pagebody");
	    b.style.height = null;
	}
}
	
function noScroll(enable)
{
	var obj= document.getElementById("pagebody");

    if (enable)
    {
    	obj.style.overflow = "visible";
	    createCookie("noscroll", '1', 30);
    }
    else
    {
    	obj.style.overflow = "auto";
		eraseCookie("noscroll");
    }
    
    resizepage();
}

function SetScroll()
{
	if (readCookie("noscroll") != null)
	{
		noScroll(true);
    }
	resizepage();
}

function createCookie(name,value,days)
{
    
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	var ck = name+"="+value+expires+"; path=/";
	//if (days != -1) alert('Cookie\n' + ck + '\ncreated');
	document.cookie = ck;
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i<ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}

function getMovie(movieName) {
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    return (isIE) ? window[movieName] : document[movieName];
}

function getBlog_tab()
{

    document.write('<object name="flashtab" id="flashtab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="104">');
    document.write('<param name="movie" value="tab_blog.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<PARAM NAME="FlashVars" VALUE="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') +  '">');
    document.write('<embed src="tab_blog.swf" FlashVars="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') + '" width="620" height="104" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}


function getProjects_tab()
{

    document.write('<object name="flashtab" id="flashtab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="29">');
    document.write('<param name="movie" value="tab_projects.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<PARAM NAME="FlashVars" VALUE="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') +  '">');
    document.write('<embed src="tab_projects.swf" FlashVars="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') + '" width="620" height="29" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function getGames_tab()
{

    document.write('<object name="flashtab" id="flashtab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="29">');
    document.write('<param name="movie" value="tab_games.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<PARAM NAME="FlashVars" VALUE="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') +  '">');
    document.write('<embed src="tab_games.swf" FlashVars="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') + '" width="620" height="29" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function getStuff_tab()
{

    document.write('<object name="flashtab" id="flashtab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="29">');
    document.write('<param name="movie" value="tab_stuff.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<PARAM NAME="FlashVars" VALUE="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') +  '">');
    document.write('<embed src="tab_stuff.swf" FlashVars="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') + '" width="620" height="29" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function getAbout_tab()
{

    document.write('<object name="flashtab" id="flashtab" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="620" height="29">');
    document.write('<param name="movie" value="tab_about.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<PARAM NAME="FlashVars" VALUE="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') +  '">');
    document.write('<embed src="tab_about.swf" FlashVars="setnoscroll=' + (readCookie("noscroll") != null ? 'true' : 'false') + '" width="620" height="29" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
}

function getImageLoader(groupname)
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="720" height="405">');
    document.write('<param name="movie" value="images.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<PARAM NAME="FlashVars" VALUE="groupname=' + groupname + '">');
    document.write('<embed src="images.swf" FlashVars="groupname=' + groupname + '" width="720" height="405" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
    document.write('</object>');
      
}

function getVideo(id)
{

    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="425" height="360">');
    document.write('<param name="movie" value="video.swf" />');
    document.write('<param name="quality" value="high" />');
    document.write('<PARAM NAME="FlashVars" VALUE="videoid=' + id + '">');
    document.write('<embed src="video.swf" FlashVars="videoid=' + id + '" width="425" height="360" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>');
    document.write('</object>');
}