	var showcontentcontainertimeout = '';
	var cacheImage = document.createElement('img');
	cacheImage.src = 'layout_graphics/14off.png';
	var mouseOverPicture = false;
	var dt = 0;
	var gintervalleft;
	var gintervalright;
	function showcontentcontainer() {
		$("div#contentcontainer").show();
		$("div#contentbottomicons").show();
	}
	function gchange(leftright) {
		if (leftright == "right") $("#g").animate({left: 720},120);
		else $("#g").animate({left: 630},120);
	}
	function startgchangeright() {
		gintervalright = setInterval('gchange("right")',60000);
	}
	$(document).ready(function() {
		$("div#device_uppermiddlelogo").click(function() {});
		$("div#device_lowermiddlepower").click(function() {
			//use php to test for cookies? intro and/or first load versus using javascript to check the page filename?
			if ($(this).css("background-image").indexOf('14on') != -1) {
				$(this).css("background-image","url(layout_graphics/14off.png)");
				$("div#contentcontainer").fadeOut("fast");
				$("div#contentbottomicons").fadeOut("fast");
				if (showcontentcontainertimeout != '') clearTimeout(showcontentcontainertimeout);
				$("#device_centercontent").append('<div id="offscreen" style="width: 600px; height: 800px;"></div>');
				$("#devicecontainer").append('<div id="g" style="position: absolute; left: 720px; top: 905px;"><a href="games.php"><img src="graphics/c.png" width="50" height="50" border="0" alt="" /></a></div>');
				swfobject.embedSWF("flashmo_130_stack_gallery.swf", "offscreen", "600", "800", "9.0.0");
				gintervalleft = setInterval('gchange("left")',60000);
				setTimeout('startgchangeright()',1500);
			} else {
				clearInterval(gintervalleft);
				clearInterval(gintervalright);
				gvisible = false;
				$(this).css("background-image","url(layout_graphics/14on.png)");
				$("#offscreen").remove();
				$("#g").remove();
				showcontentcontainertimeout = setTimeout('showcontentcontainer()',300);
			}
		});
		$("div.contactwidget img").mouseover(function() {
			var newsrc = $(this).attr("osrc");
			var oldsrc = $(this).attr("src");
			if (newsrc != null && newsrc != "") {
				$(this).attr("src",newsrc);
				$(this).attr("osrc",oldsrc);
			}
		});
		$("div.contactwidget img").mouseout(function() {
			var newsrc = $(this).attr("osrc");
			var oldsrc = $(this).attr("src");
			if (newsrc != null && newsrc != "") {
				$(this).attr("src",newsrc);
				$(this).attr("osrc",oldsrc);
			}
		});
		/*$.idleTimeout('#dialog', 'div.ui-dialog-buttonpane button:first', {
			idleAfter: 5,
			pollingInterval: 2,
			keepAliveURL: 'keepalive.php',
			serverResponseEquals: 'ok',
			onTimeout: function(){
				//?
			},
			onIdle: function(){
				$("div#device_lowermiddlepower").trigger('click');
			},
			onCountdown: function(counter){
				//$countdown.html(counter); // update the counter
			}
		});*/
	});
