﻿function GetHost()
{
	var prot = window.location.protocol;
	var host = window.location.host;
	var urllocation = prot + "//" + host;

	if(urllocation.indexOf("http://www") == -1)
	{
	urllocation = "http://mypc09.com";
	}

	return urllocation.toLowerCase();

}
function PrintCalendar(userguid)
{
	window.open('http://www.mypc09.com/pages/CalendarPrint.aspx', 'Print','Width=975,height=800,toolbar=yes');
}

function LoadSessionDetail()
{

	var navLocationLoad=location.pathname.toLowerCase();
	if (navLocationLoad.indexOf("members/sessiondetails.aspx") >= 0) 
	{
		if (queryString("src") == "fast") 
		{	
			var hlink = document.getElementById("myscsreturn");
			hlink.innerHTML ="Return to FAST Search";
		}
	}

}


function MySCSReturn(location) 
{
	if(location == "browser")
		history.back(1);
		//document.location.href="/pages/members/sessionbrowser.aspx";
	else
		document.location.href="/pages/members/mycalendar.aspx";
}

function ViewDFCDetails(sid, source)
{
	document.location.href="/pages/members/sessiondetails.aspx?sid=" + sid + "&owner=dfc&src=" + source;
}

function ViewDetails(sid, buttonid, source) 
{
	var hosturl = GetHost();
		
	if(document.images[buttonid].src.toLowerCase() == hosturl + "/publishingimages/btn_removesession_off.gif")
		owner = "1";
	else 
		owner = "0";

	document.location.href="/pages/members/sessiondetails.aspx?sid=" + sid + "&owner=" + owner + "&src=" + source;

}

function sessionaddremove(sid, buttonid, stype) 
{

	var hosturl = GetHost();
	stype = "";	
	if(document.images[buttonid].src.toLowerCase() == hosturl + "/publishingimages/btn_removesession_off.gif")
	{
		try
		{

			var qs = location.search;
			var sendurl = hosturl + "/pages/members/sessiondelete.aspx?id=" + sid + "&stype=" + stype;
			
			if (window.XMLHttpRequest) 
			{
				try
				{	
					req = new XMLHttpRequest();
	 			   	req.onreadystatechange = voteprocessUpdate;
			  		req.open("POST", sendurl, true);
			  		req.send("");
				}
				catch(e)
				{
					req = new XDomainRequest();
	 			   	req.onreadystatechange = voteprocessUpdate;
			  		req.open("POST", sendurl, true);
			  		req.send("");
				}
				document.images[buttonid].src = hosturl + '/PublishingImages/btn_addsession_off.gif';
			}
			else
			{
				if (window.ActiveXObject) 
				{
					req = new ActiveXObject('MSXML2.XMLHTTP.3.0');
			   		req.onreadystatechange = voteprocessUpdate;
			  		req.open("POST", sendurl, true);
					req.send("");
					document.images[buttonid].src = hosturl + '/PublishingImages/btn_addsession_off.gif';
				}
			}
		}
		catch(e)
		{
		}
	}
	else if(document.images[buttonid].src.toLowerCase() == hosturl + "/publishingimages/btn_addsession_off.gif")
	{
		try
		{
			var qs = location.search;
			var sendurl = hosturl + "/pages/members/sessionadd.aspx?id=" + sid + "&stype=" + stype + "&" + qs;
			if(window.XDomainrequst)
			{
			
			}
			else if (window.XMLHttpRequest) 
			{
				try
				{	
					req = new XMLHttpRequest();
	 			   	req.onreadystatechange = voteprocessUpdate;
			  		req.open("POST", sendurl, true);
			  		req.send("");
				}
				catch(e)
				{
					req = new XDomainRequest();
	 			   	req.onreadystatechange = voteprocessUpdate;
			  		req.open("POST", sendurl, true);
			  		req.send("");
				}
				document.images[buttonid].src = hosturl + '/PublishingImages/btn_removesession_off.gif';
			}
			else
			{
				if (window.ActiveXObject) 
				{
					// ...otherwise, use the ActiveX control for IE5.x and IE6.
					req = new ActiveXObject('MSXML2.XMLHTTP.3.0');
				   	req.onreadystatechange = voteprocessUpdate;
				  	req.open("POST", sendurl, true);
					req.send("");
					document.images[buttonid].src = hosturl + '/PublishingImages/btn_removesession_off.gif';
				}
			}		
		
		}
		catch(e)
		{
		}
	}
	else if(document.images[buttonid].src.toLowerCase() == hosturl + "/publishingimages/btn_evaluation_120.gif")
	{
		try
		{
			var sendurl = "/pages/myspc/spcevaluation.aspx?id=" + sid;
			window.location.href = sendurl;
		}
		catch(e)
		{
		}
	}

}


function toggleSessionDiv(a,sid){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  //return false;
arrowswitch(sid)
}

function toggleDiv(a){
  var e=document.getElementById(a);
  
  if(document.getElementById("h_text"))
  {
  	var msg =  document.getElementById("h_text");
  	msg.value = "";
  }
  
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }

}

function togglePrivate(systemaccountname){
  var msg =  document.getElementById("h_text");
  var e = document.getElementById("AddMessage");
  var lm = document.getElementById("AddMessageLink");

  if(e.style.display=="none")
  {
  	msg.value = systemaccountname;
  	e.style.display="block"
  	lm.style.display="none"
  }
  else if(e.style.display=="block" && msg.value != "")
  {
  	msg.value = "";
  	e.style.display="none"
  	lm.style.display="block"
  } 
  else if(e.style.display=="block" && msg.value == "")
  {
  	msg.value = systemaccountname;
  } 
  else 
  {
  msg.value = "";
    e.style.display="none"
      	lm.style.display="block"
  }
}

function toggleReply(systemaccountname){
  var msg =  document.getElementById("h_privatetext");
  var e = document.getElementById("AddPrivateMessage");
 
  if(e.style.display=="none")
  {
  	msg.value = systemaccountname;
  	e.style.display="block"
   }
  else if(e.style.display=="block" && msg.value != "")
  {
  	msg.value = "";
  	e.style.display="none"
   } 
  else if(e.style.display=="block" && msg.value == "")
  {
  	msg.value = systemaccountname;
  } 
  else 
  {
  msg.value = "";
    e.style.display="none"
   }

}

function ShowTrack(a){
  var e=document.getElementById(a);
  var artrack = ['tr1', 'tr2', 'tr3', 'tr4', 'tr5', 'tr6', 'tr7'];

  if(!e)return true;
  for (var i=0; i<artrack.length; i++) 
  {
  	var el = document.getElementById(artrack[i]);
  	if(a == artrack[i])
  	{
	  if(e.style.display=="none")
	    e.style.display="block"
	  else
		e.style.display="none"
	}  	
	  else
		el.style.display="none"
  }
}

//**Session Functions**//


function populatesearchonload()
{

	var navLocationLoad=location.pathname.toLowerCase();
	if (navLocationLoad.indexOf("sessionbrowser.aspx") >= 0 && queryString("v") != "false" ) 
	{
	
		if (queryString("k").length > 0 & queryString("k") != "false" )
			document.getElementById('sessionsearchtext').value = queryString("k");


		if( queryString("d").length > 0);
		{	
			var Qsd = queryString("d");
			var objsearchday = document.getElementById('SearchDay');
		
			for(i=0; i < objsearchday.length; i++)
			{
				if( Qsd == objsearchday.options[i].value)
					objsearchday.options.selectedIndex = i;
			}
		}	
			
		if( queryString("tr").length > 0);
		{	
			var Qtr = queryString("tr");
			var objtr = document.getElementById('TrackCodePrefix');
		
			for(i=0; i < objtr.length; i++)
			{
				if( Qtr == objtr.options[i].value)
					objtr.options.selectedIndex = i;
			}
		}

		toggleDiv('advancesearch');
		toggleDiv('simplesearch'); 
		toggleDiv('timeslotviewlink');
	}
}	



function SessionsSearch(ismember)
{ 
		
		var searchtext = document.getElementById('sessionsearchtext').value;

		var objsearchday = document.getElementById('SearchDay');
		var searchday = objsearchday.options[objsearchday.options.selectedIndex].value;

		var objtrackcodeprefix = document.getElementById('TrackCodePrefix');
		var trackcodeprefix = objtrackcodeprefix.options[objtrackcodeprefix.options.selectedIndex].value;
				
		var searchtype = "bydate";
		var viewtype = document.getElementsByName('displayby'); 
		  for (var i=0; i<viewtype.length; i++) { 
		    if (viewtype[i].checked) { 
		      searchtype = viewtype[i].value; 
		      break; 
		    } 
		  }
		  
	  	var navLocationLoad=location.pathname.toLowerCase();
		if (navLocationLoad.indexOf("sessionbrowser.aspx") >= 0) 
			sendto = '/pages/members/sessionbrowser.aspx';
		else
			sendto = '/pages/tracksandsessions.aspx';

	
		sendto = sendto + '?v=' + searchtype;
		if (searchtext.length > 0)
			sendto = sendto + '&k=' + searchtext;
		if (searchday != "all")
			sendto = sendto + '&d=' + searchday;
		if (trackcodeprefix != "all")			
			sendto = sendto + '&tr=' + trackcodeprefix;

		window.location.href = sendto;

	}


	


function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}
//**Session Functions**//


function SubmitPost(){ 

	var posttext = escape(document.getElementById('bulletintext').value);
	var sendto = "";

	if (posttext.length > 0)
	{
		if (queryString("accountname")=='false')
		{
			sendto = '/pages/myspc/spcpostbulletin.aspx?t=' + posttext;
			if (document.getElementById('postfrommysite').value == "1")
			{
				sendto = sendto + "&my=1";
			}
		}
		else
		{
			sendto = '/pages/myspc/spcpostbulletin.aspx?t=' + posttext + "&accountname=" + queryString("accountname");
			if (document.getElementById('postfrommysite').value == "1")
			{
				sendto = sendto + "&my=1";
			}

		}
		window.location.href = sendto;
	}
	else 		
		return false;
	}



function loadNAV () {
	var navLocationLoad=location.pathname.toLowerCase();
	if (navLocationLoad.indexOf(SPCdefault) >= 0) {
		document.images['home'].src = ImgStay[0].src; 
		}
	if (navLocationLoad.indexOf('/pages/tracks/') >= 0) {
		document.images['tracks'].src = ImgStay[1].src; 
		}
	if (navLocationLoad.indexOf('/pages/community/') >= 0) {
		document.images['community'].src = ImgStay[2].src; 
		}
	if (navLocationLoad.indexOf('/pages/speakers/') >= 0) {
		document.images['speakers'].src = ImgStay[3].src; 
		}
	if (navLocationLoad.indexOf('/pages/venue') >= 0) {
		document.images['venue'].src = ImgStay[4].src; 
		}
	if (navLocationLoad.indexOf('/pages/sponsors') >= 0) {
		document.images['sponsors'].src = ImgStay[5].src; 
		}
	if (navLocationLoad.indexOf('/pages/agenda') >= 0) {
		document.images['agenda'].src = ImgStay[7].src; 
		}
	return true; 
}

function tabrollover(iName, iImageNum) {
	var navLocation=location.pathname.toLowerCase();
	if ((navLocation.indexOf('/pages/news.aspx') >= 0) || (navLocation.indexOf('/pages/searchresults.aspx') >= 0) || (navLocation.indexOf('/pages/myspc/') >= 0) || (navLocation.indexOf('/') >= 0)) {
		document.images[iName].src = ImgOver[iImageNum].src;
		}
	else {
		if ((navLocation.indexOf(SPCdefault) >= 0) && (!(iName == 'home'))) {
			document.images[iName].src = ImgOver[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/tracks/') >= 0) && (!(iName == 'tracks'))) {
			document.images[iName].src = ImgOver[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/community/') >= 0) && (!(iName == 'community'))) {
			document.images[iName].src = ImgOver[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/speakers/') >= 0) && (!(iName == 'speakers'))) {
			document.images[iName].src = ImgOver[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/venue/') >= 0) && (!(iName == 'venue'))) {
			document.images[iName].src = ImgOver[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/sponsors/') >= 0) && (!(iName == 'sponsors'))) {
			document.images[iName].src = ImgOver[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/agenda/') >= 0) && (!(iName == 'agenda'))) {
			document.images[iName].src = ImgOver[iImageNum].src; 
			}
		}
	return true; 
}

function tabrollout(iName, iImageNum) {
	var navLocation=location.pathname.toLowerCase();
	if ((navLocation.indexOf('/pages/news.aspx') >= 0) || (navLocation.indexOf('/pages/searchresults.aspx') >= 0) || (navLocation.indexOf('/pages/myspc/') >= 0) || (navLocation.indexOf('/') >= 0)) {
		document.images[iName].src = ImgNormal[iImageNum].src;
		}
	else {
		if ((navLocation.indexOf(SPCdefault) >= 0) && (!(iName == 'home'))) {
			document.images[iName].src = ImgNormal[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/tracks/') >= 0) && (!(iName == 'tracks'))) {
			document.images[iName].src = ImgNormal[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/community/') >= 0) && (!(iName == 'community'))) {
			document.images[iName].src = ImgNormal[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/speakers/') >= 0) && (!(iName == 'speakers'))) {
			document.images[iName].src = ImgNormal[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/venue/') >= 0) && (!(iName == 'venue'))) {
			document.images[iName].src = ImgNormal[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/sponsors/') >= 0) && (!(iName == 'sponsors'))) {
			document.images[iName].src = ImgNormal[iImageNum].src; 
			}
		if ((navLocation.indexOf('/pages/agenda/') >= 0) && (!(iName == 'agenda'))) {
			document.images[iName].src = ImgNormal[iImageNum].src; 
			}
		}
	return true; 
}

function highlightover(cellN, contentN) {
	try {
    document.getElementById('1_title').className = 'newsout';
    document.getElementById('2_title').className = 'newsout';
    document.getElementById('3_title').className = 'newsout';
    document.getElementById('4_title').className = 'newsout';
    document.getElementById('1_body').style.visibility = 'hidden';
    document.getElementById('2_body').style.visibility = 'hidden';
    document.getElementById('3_body').style.visibility = 'hidden';
    document.getElementById('4_body').style.visibility = 'hidden';
    document.getElementById(cellN).className = 'newsover';
    document.getElementById(contentN).style.visibility = 'visible';
    } catch (err) { }
}

function highlightout(cellN, contentN) {
    document.getElementById(cellN).className = 'newsout';
    //document.getElementById(contentN).style.visibility = 'hidden';
}
//function highlightovertrack(cellN, contentN) {
//    document.getElementById('1_tracktitle').className = 'trackout';
//    document.getElementById('2_tracktitle').className = 'trackout';
//    document.getElementById('3_tracktitle').className = 'trackout';
//    document.getElementById('4_tracktitle').className = 'trackout';
//    document.getElementById('5_tracktitle').className = 'trackout';
//    document.getElementById('6_tracktitle').className = 'trackout';
//    document.getElementById('1_trackbody').style.visibility = 'hidden';
//    document.getElementById('2_trackbody').style.visibility = 'hidden';
//    document.getElementById('3_trackbody').style.visibility = 'hidden';
//    document.getElementById('4_trackbody').style.visibility = 'hidden';
//    document.getElementById('5_trackbody').style.visibility = 'hidden';
//    document.getElementById('6_trackbody').style.visibility = 'hidden';
//    document.getElementById(cellN).className = 'trackover';
//    document.getElementById(contentN).style.visibility = 'visible';
//}

//function highlightouttrack(cellN, contentN) {
//    document.getElementById(cellN).className = 'trackout';
//    //document.getElementById(contentN).style.visibility = 'hidden';
//}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){

if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)


if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"

}

return clickreturnvalue();
tabrollover('community','2');

}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu();
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay);
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

// Sessions Page Functions //
function arrowswitch(imgid) {

	var hosturl = GetHost();
	if (document.images[imgid].src.toLowerCase() == hosturl + "/publishingimages/arrowrightsub.gif") {
		document.images[imgid].src = hosturl + "/PublishingImages/ArrowDownsub.gif";
	}
	else if (document.images[imgid].src.toLowerCase() == hosturl + "/publishingimages/arrowdownsub.gif") {
		document.images[imgid].src = hosturl + "/PublishingImages/ArrowRightsub.gif";
	}
}


function abstractsubmit(sid) {

	var hosturl = GetHost();
		
	toggleAbstractSubmit (sid);
	document.getElementById("suggestlink_"+sid).disabled = true;
	var submitURL = hosturl + "/Pages/Tracks/SPCabstractsuggest.aspx";
	req = new XMLHttpRequest();
   	req.onreadystatechange = voteprocessUpdate;
  	req.open("POST", submitURL, true);
	req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	req.send("abstractsend="+document.getElementById('abstractDesc_'+sid).value+"&emailsend="+document.getElementById('abstractEmail_'+sid).value+"&titlesend="+document.getElementById('abstractTitle_'+sid).value);
}

function votecount(title,sid) {

	var hosturl = GetHost();
	
	if (document.images[sid].src.toLowerCase() == hosturl + "/publishingimages/btnvoteon.gif") {
		createCookie (sid,'1',365);
		var voteURL = hosturl + "/Pages/Tracks/SPCsessionvote.aspx";
try{
			req = new XMLHttpRequest();
		   	req.onreadystatechange = voteprocessUpdate;
		  	req.open("POST", voteURL+"?st="+title, true);
			req.send("");
	}
catch(e){}
	}
	document.images[sid].src='/images/btnvoteoff.gif';
}

function voteprocessUpdate()
{
	return;
}

function SPC_ExpGroupBy(formObj)
{

	if (browseris.nav)
		return;
	if ((browseris.w3c) && (!browseris.ie)) {
		document.all=document.getElementsByTagName("*");
	}
	docElts=document.all;
	numElts=docElts.length;
	images=formObj.getElementsByTagName("IMG");
	img=images[0];
	srcPath=img.src;
	index=srcPath.lastIndexOf("/");
	imgName=srcPath.slice(index+1);
	if (imgName.toLowerCase() =='arrowright.gif')
	{
		fOpen=true;
		displayStr="block";
		img.src='/images/TracksBanners/ArrowDown.gif';
	}
	else
	{
		fOpen=false;
		displayStr="none";
		img.src='/images/TracksBanners/ArrowRight.gif';
	}
	oldName=img.name;
	img.name=img.alt;
	img.alt=oldName;
	spanNode=img;
	while(spanNode !=null)
	{
		spanNode=spanNode.parentElement;
		if (spanNode !=null &&
			spanNode.id !=null &&
			spanNode.id.length > 5 &&
			spanNode.id.substr(0, 5)=="group")
			break;
	}
	parentNode=spanNode;
	while(parentNode !=null)
	{
		parentNode=parentNode.parentElement;
		if (parentNode !=null &&
			parentNode.tagName=="TABLE")
			break;
	}
	lastNode=null;
	if (parentNode !=null)
	{
		lastNode=parentNode.lastChild;
		if (lastNode !=null && lastNode.tagName=="TBODY")
			lastNode=lastNode.lastChild;
		if (lastNode !=null && lastNode.tagName=="TR" && lastNode.lastChild !=null)
			lastNode=lastNode.lastChild;
	}
	for(var i=0;i<numElts;i++)
	{
		var childObj=docElts(i);
		if (childObj==spanNode)
			break;
	}
	ID=spanNode.id.slice(5);
	for(var j=i+1; j<numElts; j++)
	{
		var childObj=docElts(j);
		if (childObj.id.length > 5 &&
			childObj.id.substr(0, 5)=="group")
		{
			curID=childObj.id.slice(5);
			if (curID <=ID)
				return;
		}
		parentNode=childObj;
		while(parentNode !=null)
		{
			parentNode=parentNode.parentElement;
			if (parentNode==spanNode)
				break;
		}
		if (parentNode==spanNode)
			continue;
		if (childObj !=img &&
			childObj.tagName=="IMG" &&
			childObj.src &&
			childObj.src.slice(childObj.src.length - 36).toLowerCase() =='/images/tracksbanners/arrowright.gif')
		{
			childObj.src='/images/TracksBanners/ArrowDown.gif';
			oldName=childObj.name;
			childObj.name=childObj.alt;
			childObj.alt=oldName;
		}
		if (childObj.tagName==spanNode.tagName &&
			childObj.id !="footer")
		{
			childObj.style.display=displayStr;
		}
		if ((childObj.tagName=="TABLE" && lastNode==null) || childObj==lastNode)
			break;
	}
}

function toggleMe(a,b){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  arrowswitch(b);
  return false;
}
function toggleAbstract(a,sid){
	if (document.getElementById("ItemBubbleAbstractThanks_"+sid).style.display=="none") {
	  var e=document.getElementById(a);
	  if(!e)return true;
	  if(e.style.display=="none"){
	    e.style.display="block"
	  } else {
	    e.style.display="none"
	  }
	}
	else {
		document.getElementById("suggestlink_"+sid).disabled = true;
	}
  return false;
}

function toggleAbstractSubmit(sid){
	toggleAbstract("ItemBubbleAbstract_"+sid,sid);
	var ItemName = "ItemBubbleAbstractThanks_"+sid;
  var e=document.getElementById(ItemName);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return false;
}

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 = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

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 checkVotesLoad() {
	
	var hosturl = GetHost();

	var navLocationLoad=location.pathname.toLowerCase();
	ExpandSelectedTrack ();
	if (navLocationLoad.indexOf(SPCvote) >= 0) {

		 var imgs,i;
		 imgs=document.getElementsByTagName('img');
		 for(i in imgs)
		 {
			if(imgs[i].src.toLowerCase() == hosturl + "/publishingimages/btnvoteon.gif") {
			   	if (readCookie (imgs[i].name) == "1") {
			    	imgs[i].src="/images/btnvoteoff.gif";
				}
			}
		  }	
	}
}

function ExpandSelectedTrack () {
	if (queryString("tr") == "BAS") {
		SPC_ExpGroupBy(document.getElementById("Arrow_Business Applications and Solutions"));
	}
	else if (queryString("tr") == "CSC") {
		SPC_ExpGroupBy(document.getElementById("Arrow_Collaboration and Social Computing"));
	}
	else if (queryString("tr") == "DM") {
		SPC_ExpGroupBy(document.getElementById("Arrow_Deployment and Migration"));
	}
	else if (queryString("tr") == "ECM") {
		SPC_ExpGroupBy(document.getElementById("Arrow_Enterprise Content Management and Search"));
	}
	else if (queryString("tr") == "MG") {
		SPC_ExpGroupBy(document.getElementById("Arrow_Administration and Governance"));
	}
	else if (queryString("tr") == "OA") {
		SPC_ExpGroupBy(document.getElementById("Arrow_Interoperability and Business Process"));
	}
	return false;
}

function PageQuery(q) {
	if(q.length > 1) this.q = q.substring(1, q.length);
	else this.q = null;
	this.keyValuePairs = new Array();
	if(q) {
	for(var i=0; i < this.q.split("&").length; i++) {
	this.keyValuePairs[i] = this.q.split("&")[i];
	}
	}
	this.getKeyValuePairs = function() { return this.keyValuePairs; }
	this.getValue = function(s) {
	for(var j=0; j < this.keyValuePairs.length; j++) {
	if(this.keyValuePairs[j].split("=")[0] == s)
	return this.keyValuePairs[j].split("=")[1];
	}
	return false;
	}
	this.getParameters = function() {
	var a = new Array(this.getLength());
	for(var j=0; j < this.keyValuePairs.length; j++) {
	a[j] = this.keyValuePairs[j].split("=")[0];
	}
	return a;
	}
	this.getLength = function() { return this.keyValuePairs.length; } 
}

function queryString(key){
	var page = new PageQuery(window.location.search); 
	return unescape(page.getValue(key)); 
}
