var popUp; 
var newwin = null;
function muestraSp(p)
{
	if (document.getElementById(p).style.display == "")
	{
		document.getElementById(p).style.display = "none" ;	
	}
	else
	{
		document.getElementById(p).style.display = "" ;
	}	
	//return true;
	
}

function ShowYear()
{
	if (document.getElementById("ddlStatus").value == "C")
	{
		document.getElementById("ddlYear").style.display = "";	
	}
	else
	{
		document.getElementById("ddlYear").style.display = "none";	
	}	
	//return true;
}

function SwapImg(p)
{
	if (document.getElementById(p).src == "../Images/Interface/Icons/plus.gif")
	{
		document.getElementById(p).src = "../Images/Interface/Icons/minus.gif" ;	
	}
	else
	{
		document.getElementById(p).src = "../Images/Interface/Icons/plus.gif" ;
	}	
	//return true;
	
}

function muestraThemes()
{
	if (document.getElementById("ThemeCluster").style.display == "")
	{
		document.getElementById("ThemeCluster").style.display = "none" ;
		document.getElementById("ThemeClusterData").style.display = "none" ;
		document.getElementById("ThemeCategory").style.display = "none" ;
		document.getElementById("ThemeCategoryData").style.display = "none" ;
		document.getElementById("ThemeActivity").style.display = "none" ;
		document.getElementById("ThemeActivityData").style.display = "none" ;
	}
	else
	{
		document.getElementById("ThemeCluster").style.display = "" ;
		document.getElementById("ThemeClusterData").style.display = "" ;
		document.getElementById("ThemeCategory").style.display = "" ;
		document.getElementById("ThemeCategoryData").style.display = "" ;
		document.getElementById("ThemeActivity").style.display = "" ;
		document.getElementById("ThemeActivityData").style.display = "" ;
	}	
	//return true;
}

function muestraThemesActivity()
{
	if (document.getElementById("ThemeCluster").style.display == "")
	{
		document.getElementById("ThemeCluster").style.display = "none" ;
		document.getElementById("ThemeClusterData").style.display = "none" ;
		document.getElementById("ThemeCategory").style.display = "none" ;
		document.getElementById("ThemeCategoryData").style.display = "none" ;
		document.getElementById("ThemeActivity").style.display = "none" ;
		document.getElementById("ThemeActivityData").style.display = "none" ;
		document.getElementById("ThemePoA").style.display = "none" ;
		document.getElementById("ThemePoAData").style.display = "none" ;		
		
	}
	else
	{
		document.getElementById("ThemeCluster").style.display = "" ;
		document.getElementById("ThemeClusterData").style.display = "" ;
		document.getElementById("ThemeCategory").style.display = "" ;
		document.getElementById("ThemeCategoryData").style.display = "" ;
		document.getElementById("ThemeActivity").style.display = "" ;
		document.getElementById("ThemeActivityData").style.display = "" ;
		document.getElementById("ThemePoA").style.display = "" ;
		document.getElementById("ThemePoAData").style.display = "" ;				
	}	
	//return true;
}

if(top.location != window.location)
  top.location.replace(window.location.href);

function popup(url, wid, hi, scroll) {
  new_spec = wid + "_" + hi + scroll;
  scrolling = scroll? "yes": "no";
  if (scroll && document.all && (navigator.userAgent.indexOf("Mac") > -1)) wid = wid+17;
  newwin=window.open(url,new_spec,"WIDTH=" + wid + ",HEIGHT=" + hi + ",status=yes,menubar=yes,toolbar=yes,scrollBars=" + scrolling + ",resizable=yes,screenX=100,screenY=100,left=100,top=100");
  newwin.focus();
}

function launchwin(winurl,winname,winfeatures) {
  newwin = window.open(winurl,winname,winfeatures);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchFullWin(winurl,winname) {
  var winl = 0;//screen.width / 2;
  var wint = 0;//screen.height / 2;
  newwin = window.open(winurl,winname,'scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,top=' + wint + ',left=' + winl + ',width=' + screen.availWidth + ',height=' + screen.availHeight);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchCenteredWin(url, name, width, height, otherfeatures) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;
    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  newwin = window.open(url, name, str + ',' + otherfeatures);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchNewsWin(winurl,winname) {
  newwin = window.open(winurl,winname,'scrollbars=yes,resizable=yes,width=800,height=600');
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchStoreWin() {
  newwin = window.open('http:\/\/www.2advanced.com/equipment/index.html','Equipment','scrollbars=yes,resizable=yes,width=790,height=385');
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchWallpaper(winurl,winname) {
  newwin = window.open(winurl,winname,'scrollbars=no,resizable=no,width=515,height=385');
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function OpenCalendar(idname, postBack)
{
	popUp = window.open('../Scripts/Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=165,height=240,left=200,top=250');
}

function SetDate(formName, id, newDate, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newDate;
	/*if (postBack)
		__doPostBack(id,'');*/
}	

function popupAnswer(url, wid, hi, scroll) {
  new_spec = wid + "_" + hi + scroll;
  scrolling = scroll? "yes": "no";
  if (scroll && document.all && (navigator.userAgent.indexOf("Mac") > -1)) wid = wid+17;
  newwin=window.open(url,new_spec,"WIDTH=" + wid + ",HEIGHT=" + hi + ",scrollBars=" + scrolling + ",menubar=no,toolbar=no,resizable=no,screenX=100,screenY=100,left=100,top=100");
  newwin.focus();
}
	
function VerifyAnswer(p)
{
	for (var i = 0; i < 4; i++)
	{
		if (document.getElementById("rdlAnswers_" + i).checked == true)
		{
			if (document.getElementById("rdlAnswers_" + i).value == document.getElementById("txtAnswerCorrect").value )
			{
				popupAnswer('SecPRESSCENTRE/QuizAnswerCorrect.aspx?Cmmt=' + document.getElementById("txtQuestionComment").value,440 , 132 , false)
			}
			else
			{
				popupAnswer('SecPRESSCENTRE/QuizAnswerInCorrect.aspx?Cmmt=' + document.getElementById("txtQuestionComment").value,440 , 132 , false)
			}
		}
		document.getElementById("rdlAnswers_" + i).disabled = true
	}
}

function CourseMemberFound(p)
{
	window.opener.location.href = "CourseAdminMembersModify.aspx?CrI=" + document.getElementById("txtCourse_Id").value +"&MtI=" + document.getElementById("txtCourseMemberType_Id").value + "&Acc=F&CI=" + p
}

function popupVentanaDos(url, wid, hi, scroll) {
  new_spec = wid + "_" + hi + scroll;
  scrolling = scroll? "yes": "no";
  if (scroll && document.all && (navigator.userAgent.indexOf("Mac") > -1)) wid = wid+17;
  newwin=window.open(url,new_spec,"WIDTH=" + wid + ",HEIGHT=" + hi + ",status=yes,menubar=yes,toolbar=yes,scrollBars=" + scrolling + ",resizable=yes,screenX=320,screenY=240,left=320,top=240");
  newwin.focus();
}