// JavaScript Document
<!-- popup window
function LaunchWindow(url, name, w, h, r, s, m, wint, winr, winb, winl) {
	if(winb!=null && winb!=''){
		var wint = (screen.height-h)-winb;
	} else if(wint==null || wint==''){
		var wint = (screen.height-h)/3; 
	} else {
		var wint = wint;
	}
	if(winr!=null && winr!=''){
		var winl = (screen.width-w)-winr;
	} else if(winl==null || winl==''){
		var winl = (screen.width-w)/2;
	} else {
		var winl = winl;
	}
	newwindow=window.open(url,name, 'toolbar=no,menubar=' + m + ',location=no,scrollbars=' + s + ',status,yes,resizable=' + r + ',width=' + w + ',height=' + h + ',top=' + wint + ',left=' + winl); 
	if (window.focus) {newwindow.focus()}
}
//-->

// image swap
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

	
// jQuery
$(function($) {
	
	
	//alert("The main height is " + $("#main").height() + "px. The sideCol height is " + $("#sideCol").height() + "px.");
	//setTimeout($(columReSize()),2000);
	//$(columReSize());
	
	// alt row colour for buy bids table
	//$('#bidTbl tbody tr:even').addClass('altRow');
	
	
	/*$('#hideButton').click(function() {
		$('#disclaimer').fadeOut(5000);
	});*/
	
	//$('<input type="button" value="toggle" id="toggleButton">').insertAfter('#disclaimer');
	
	$('#loginForm').hide();
	/*$('#joinFree').hide();
	$('#tabLogin').removeClass('tab');
	$('#tabRegister').addClass('tab');
	$('.sideBtnRed').hide();*/
	
	$('#tabLogin').click(function() {
		//$('#disclaimer').toggle('slow');
		$('#joinFree').fadeOut('slow');
		$('#member').animate( 
			{
			  height:'-=80px'
			},
			{
			  duration:'slow', 
			  easing:'swing',
			  complete: function(){
				$('#loginForm').fadeIn('slow', function() { //with call back function
					$('#tabLogin').removeClass('tab');
					$('#tabRegister').addClass('tab');
				});
			  },
			  queue: false
			}
		);
	});
	
	//display enlarged example game
	$("#imgExample").hide();
	$("#imgEnlarge").click(
		function () {
			$("#imgExample").fadeIn(1000);
		}
	);
	$("#imgExample").click( 
		function () {
			$("#imgExample").fadeOut(1000);
		}
	);

	
	/*
	$('<strong>START!</strong>').prependTo('#disclaimer');
	$('<strong>END!</strong>').appendTo('#disclaimer');
	
	$('#no-script').remove();
	
	$('p:first').html('<strong>Warning!</strong> Text has been replaced … ');
	$('h2:last').text('<strong>Warning!</strong> Title elements can be …');
	*/
	//alert($('h2:first').text());
	
	/*$('#celebs tr').mouseover(function() {
		$(this).addClass('zebraHover');
	});
	$('#celebs tr').mouseout(function() {
		$(this).removeClass('zebraHover');
	});
	$('#celebs tbody tr').hover(function() {
		$(this).addClass('zebraHover');
	}, function() {
		$(this).removeClass('zebraHover');
	});
	
	$('#celebs tbody tr').click(function() {
		$(this).toggleClass('zebraHover');
	});
	
	$('.spoiler').hide();
	$('<span class="revealer">Tell me!</span>').insertBefore('.spoiler');
	$('.revealer').click(function() {
		$(this).hide();
		$(this).next().fadeIn();
	});*/


  	/*$('#clock').jclock();
	var options = {
		timeNotation: '24h',
		fontFamily: 'Arial, Helvetica, sans-serif',
		fontSize: '14px',
		foreground: '#FFFF99',
		fontWeight: 'normal'
	}
	$('#clock').jclock(options);
  	*/
	
});
// column resize (main, sidepanel)
function columReSize () {
	if( $("#main").height() < $("#sideCol").height() ) {
		$("#main").height( $("#sideCol").height()+10 );
	}
	//$('#mH').text("main height is " + $("#main").height() + "px");
	//$('#sH').text("side height is " + $("#sideCol").height() + "px");
	//alert("columReSize");
};
$(columReSize());
setTimeout(columReSize,1000);
setTimeout(columReSize,5000);
