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 toggleBlock(d, i)
{
	var e = MM_findObj(d);
	if(i){
		var img = MM_findObj(i);
	}
	if (!e) return;
	if (e.style.display == "block"){
		e.style.display = "none";
		if(img != null) img.src = "images/icon_expand.gif";
	} else {
		e.style.display = "block";
		if(img != null) img.src = "images/icon_colapse.gif";
	}
}

function toggleBlockOff(d, i)
{
	var e = MM_findObj(d);
	if(i){
		var img = MM_findObj(i);
	}
	if (!e) return;
	if (e.style.display == "block"){
		e.style.display = "none";	
	} 
}

function toggleBlockOn(d, i)
{
	var e = MM_findObj(d);
	if(i){
		var img = MM_findObj(i);
	}
	if (!e) return;
	if (e.style.display == "none"){
		e.style.display = "block";	
	} 
}

function gotoURL(url)
{
	document.location.href=url;
}

function setsessionbigblock(d)
{
	session("bigblock")=d;
}
function setsessionsmallblock(d)
{
	session("smallblock")=d;
}

function OpenChallenge()
{
 var w = 800;
 var h = 600;
 var left = screen.width/2 - w/2;
 var top = screen.height/2 - h/2;
 window.open('ChallengeYourself.aspx','','scrollbars=1,width='+w+',height='+h+',left='+left+',top='+top)
 }

