var delayb4scroll=2000 
var marqueespeed=1
var pauseit=1

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''


/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   
	if ((anchor.getAttribute("rel")!=null)||(anchor.getAttribute("rel"))){
	   if (anchor.getAttribute("href") && anchor.getAttribute("rel").indexOf("external") != -1)  
		 anchor.target = "_blank";
	}   
   

 }
}

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
if (cross_marquee != null) {
	cross_marquee.style.top=0
	marqueeheight=document.getElementById("marqueecontainer").offsetHeight
	actualheight=cross_marquee.offsetHeight
	if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
		cross_marquee.style.height=marqueeheight+"px"
		cross_marquee.style.overflow="scroll"
		return
	}
	setTimeout('lefttime=setInterval("scrollmarquee()",60)', delayb4scroll)
}
}

function addEvent(elm, evType, fn, useCapture){if(elm.addEventListener){elm.addEventListener(evType, fn, useCapture);return true;}else if (elm.attachEvent){var r = elm.attachEvent('on' + evType, fn);return r;}else{elm['on' + evType] = fn;}}

var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function landingPopUpWin(url, type, strWidth, strHeight){

	closeWin();
		
	type = type.toLowerCase();
	
	if (type == "fullscreen"){
		strWidth = screen.availWidth;
		strHeight = screen.availHeight;
	}
	var tools="";
	var scrW = screen.availWidth - strWidth;
	if (type == "standard") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width=60,height=60,top=60,left="+scrW;
	if (type == "console" || type == "fullscreen") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left="+scrW+",top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}


function popUpWin(url, type)
{	
	 closeWin();
  tools = "resizable,width=400,height=400,left=10,top=10";
	 newWindow = window.open(url, 'newWin', tools);
	 newWindow.focus();
}

function excelPopUp(url, type, strWidth, strHeight){
	
	closeWin();
		
	type = type.toLowerCase();
	
	if (type == "fullscreen"){
		strWidth = screen.availWidth;
		strHeight = screen.availHeight;
	}
	var tools="";
	if (type == "console") tools = "resizable,toolbar=no,location=0,scrollbars=yes,width=700,height=100,left=10,top=10";
	
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function doPopUp(e)
{
//set defaults - if nothing in rel attrib, these will be used
var t = "standard";
var w = "780";
var h = "580";
//look for parameters
attribs = this.rel.split(" ");
if (attribs[1]!=null) {t = attribs[1];}
if (attribs[2]!=null) {w = attribs[2];}
if (attribs[3]!=null) {h = attribs[3];}
//call the popup script
popUpWin(this.href,t,w,h);
//cancel the default link action if pop-up activated
if (window.event) 
	{
	window.event.returnValue = false;
	window.event.cancelBubble = true;
	} 
else if (e) 
	{
	e.stopPropagation();
	e.preventDefault();
	}
}

function findPopUps()
{
var popups = document.getElementsByTagName("a");
for (i=0;i<popups.length;i++)
	{
	if (popups[i].rel.indexOf("popup")!=-1)
		{
		// attach popup behaviour
		popups[i].onclick = doPopUp;
		// add popup indicator
		if (popups[i].rel.indexOf("noicon")==-1)
			{
			popups[i].style.backgroundImage = "url(pop-up.gif)";
			popups[i].style.backgroundPosition = "0 center";
			popups[i].style.backgroundRepeat = "no-repeat";
			popups[i].style.paddingLeft = "15px";
			}
		// add info to title attribute to alert fact that it's a pop-up window
		popups[i].title = popups[i].title + " [Opens in pop-up window]";
		}
	}
}

if (window.addEventListener) {
	window.addEventListener("load", initializemarquee, false)
	window.addEventListener("load", externalLinks, false)
	window.addEventListener("load", findPopUps, false)
} else if (window.attachEvent) {
	window.attachEvent("onload", initializemarquee)
	window.attachEvent("onload", externalLinks)
	window.attachEvent("onload", findPopUps)
} else if (document.getElementById) {
	window.onload=initializemarquee
	window.onload=externalLinks;
	window.onload=findPopUps;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function removeProj(targ,selObj,restore)
{
	 input_box = confirm("Are you sure you want to delete the project?");
  if (input_box == true)
  {
			 if(restore == 0)
				{
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
				}
				else
				{
					 location.href=selObj;
				}
//    if (restore) selObj.selectedIndex=0;
  }
}

var menu=new Array()
menu[0]='<a href="/members/view/">View All Projects</a>'
menu[1]='<a href="/members/view/track/" >Track Projects</a>'
menu[2]='<a href="/members/view/stats/">View Project Statistics</a>'
menu[3]='<a href="/members/view/grid/">Grid View</a>'

var menuwidth='' //default menu width
var menubgcolor='#CCCCCC'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

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()
}

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)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

/***********************************************
* Show Hint script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
		
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

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 iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth, hintID){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

// Ajax handling
var xmlHttp
var theDiv;

function exportAs(type,urn,val)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		url="/test/includes/export_as.php?type="+type+"&urn="+urn+"&val="+val;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function showMyProjects(uid,term)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('myprojects').innerHTML="<img src=\"/test/images/tracking.gif\" alt=\"Drawing Graphs\"/>";
		url="/test/includes/show_my_projects.php?uid="+uid+"&term="+term;
  xmlHttp.onreadystatechange=stateChanged3;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function getGridTerm(t,urn,r)
{
 	xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('gridTable').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Drawing Graphs\"/>";
		url="/includes/members_view_grid.php?t="+t+"&urn="+urn+"&r="+r;
  xmlHttp.onreadystatechange=stateChanged5;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function getTerm(g,t)
{
 	xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('showGraphs').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Drawing Graphs\"/>";
		url="/includes/draw_graphs.php?g="+g+"&t="+t;
  xmlHttp.onreadystatechange=stateChanged2;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function showGraph(g)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('showGraphs').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Drawing Graphs\"/>";
		url="/includes/draw_graphs.php?g="+g;
  xmlHttp.onreadystatechange=stateChanged2;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function comparisonGraph(g)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('showGraphs').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Drawing Graphs\"/>";
		url="/includes/draw_graphs.php?g="+g+"&c=1&comp=1";
  xmlHttp.onreadystatechange=stateChanged2;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function compareFiveGraph(g)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('showGraphs').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Drawing Graphs\"/>";
		url="/includes/draw_graphs.php?g="+g+"&c=1&quickCompare=1";
  xmlHttp.onreadystatechange=stateChanged2;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function typeChart(g,type,term)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('showGraphs').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Drawing Graphs\"/>";
		url="/includes/draw_graphs.php?g="+g+"&type="+type+"&t="+term;
  xmlHttp.onreadystatechange=stateChanged2;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function dialog(type,g,term,uid,four,comp)
{
	 $("#dialog_window").dialog("open");
				
  xmlHttp = GetXmlHttpObject();
			
		if (xmlHttp == null)
		{
				alert("Your browser does not support AJAX!");
				return;
		}
			
		document.getElementById("dialog_window").innerHTML = "<img src=\"/images/tracking.gif\" alt=\"Preparing Worksheet\"/>";
		var url="/includes/export_as.php?type="+type+"&g="+g+"&term="+term+"&uid="+uid+"&recent="+four+"&comp="+comp;
		xmlHttp.onreadystatechange = dialogChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);

}
function dialogGrid(type,gridterm,uid)
{
	 $("#dialog_window").dialog("open");
				
  xmlHttp = GetXmlHttpObject();
			
		if (xmlHttp == null)
		{
				alert("Your browser does not support AJAX!");
				return;
		}
			
		document.getElementById("dialog_window").innerHTML = "<img src=\"/images/tracking.gif\" alt=\"Preparing Worksheet\"/>";
		var url="/includes/export_as.php?type="+type+"&gridterm="+gridterm+"&uid="+uid;
		xmlHttp.onreadystatechange = dialogChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);

}
function dialogChanged() 
{
	 if (xmlHttp.readyState == 4)
	 {
		  document.getElementById("dialog_window").innerHTML = xmlHttp.responseText;
	 }
}

function trackProjects(urn)
{ 
  yg = document.getElementById('yearg').value;
		term = document.getElementById('term').value;
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('viewTracked').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Tracking Projects\"/>";
  var url="/includes/track_projects.php";
  url=url+"?urn="+urn+"&yg="+yg+"&term="+term;
  xmlHttp.onreadystatechange=stateChanged;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function projNavigation(urn,start,page,records,cyg,cltp,csbj,cxc,cec,cecm,cxcd,destination)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('availProjs').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Navigating Grid\"/>";
		url="/includes/members_view.php?urn="+urn+"&s="+start+"&p="+page+"&r="+records+"&cyg="+cyg+"&cltp="+cltp+"&csbj="+csbj+"&cxc="+cxc+"&cec="+cec+"&cecm="+cecm+"&cxcd="+cxcd+"&destination="+destination;
  xmlHttp.onreadystatechange=stateChanged6
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}

function gridNavigation(urn,start,page,records)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('gridTable').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Navigating Grid\"/>";
		url="/includes/members_view_grid.php?urn="+urn+"&s="+start+"&p="+page+"&r="+records;
  xmlHttp.onreadystatechange=stateChanged5;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function gridTermNavigation(urn,start,page,records,t)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('gridTable').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Navigating Grid\"/>";
		url="/includes/members_view_grid.php?urn="+urn+"&s="+start+"&p="+page+"&r="+records+"&t="+t;
  xmlHttp.onreadystatechange=stateChanged5;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function fullDetails (oid)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('orderDetails').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Refreshing Orders\"/>";
		url="/includes/orderdetails.php?oid="+oid;
  xmlHttp.onreadystatechange=stateChangedOrder;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function linkToProject(id)
{
  window.location="/members/view/project/"+id+"/";
}

function stateChanged() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('viewTracked').innerHTML=xmlHttp.responseText;
  }
}
function stateChanged2() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('showGraphs').innerHTML=xmlHttp.responseText;
  }
}
function stateChanged3() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('myprojects').innerHTML=xmlHttp.responseText;
  }
}
function stateChanged4() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('multiscript').innerHTML=xmlHttp.responseText;
  }
}
function stateChanged5() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('gridTable').innerHTML=xmlHttp.responseText;
  }
}
function stateChanged6() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('availProjs').innerHTML=xmlHttp.responseText;
  }
}
function stateChangedOrder() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('orderDetails').innerHTML=xmlHttp.responseText;
  }
}

function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
  {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
  }
  catch (e)
  {
    // Internet Explorer
    try
    {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return xmlHttp;
}

function dropObj(url,section,title,page_title,id)
{
  input_box = confirm("Are you sure you want to delete "+title+"?");
  if(input_box == true)
  {
			 if(url != '')
				{
		    location.href=url+id+"/"
				}
				else
				{
				  return true;
				}
		}
		else
		{
			 return false;
		}
}

function showHide(id)
{
  var e = document.getElementById(id);
  if(e.style.display == 'block')
    e.style.display = 'none';
  else
    e.style.display = 'block';
}

function compareEC(ec)
{
	 if(document.getElementById(ec).checked == true)
		{
			 if(ec == "ent3")
				{
		    document.getElementById("plts1").checked = true;
				}
				if((ec == "ent4") || (ec == "ent5"))
				{
		    document.getElementById("plts2").checked = true;
				}
				if(ec == "ent6")
				{
		    document.getElementById("plts3").checked = true;
				}
		}
		
		if(document.getElementById(ec).checked == false)
		{
		  if(ec == "ent3")
				{
		    document.getElementById("plts1").checked = false;
				}
				if(ec == "ent4")
				{
					 if(document.getElementById("ent5").checked == false)
						{
					   document.getElementById("plts2").checked = false;
						}
				}
				if(ec == "ent5")
				{
					 if(document.getElementById("ent4").checked == false)
						{
					   document.getElementById("plts2").checked = false;
						}
				}
				if(ec == "ent6")
				{
		    document.getElementById("plts3").checked = false;
				}
		}
}

function comparePLTS(plts)
{
	 if(document.getElementById(plts).checked == true)
		{
			 if(plts == "plts1")
				{
		    document.getElementById("ent3").checked = true;
				}
				if(plts == "plts2")
				{
		    document.getElementById("ent4").checked = true;
						document.getElementById("ent5").checked = true;
				}
				if(plts == "plts3")
				{
		    document.getElementById("ent6").checked = true;
				}
		}
		
		if(document.getElementById(plts).checked == false)
		{
		  if(plts == "plts1")
				{
		    document.getElementById("ent3").checked = false;
				}
				if(plts == "plts2")
				{
		    document.getElementById("ent4").checked = false;
						document.getElementById("ent5").checked = false;
				}
				if(plts == "plts3")
				{
		    document.getElementById("ent6").checked = false;
				}
		}
}

function featureScreen(feature)
{
	 xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
    alert ("Your browser does not support AJAX!");
    return;
  }
		document.getElementById('featurescreen').innerHTML="<img src=\"/images/tracking.gif\" alt=\"Refreshing Screen\"/>";
		url="/includes/featurescreen_load.php?f="+feature;
  xmlHttp.onreadystatechange=stateChangedFeature;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
}
function stateChangedFeature() 
{ 
  if (xmlHttp.readyState==4)
  { 
    document.getElementById('featurescreen').innerHTML=xmlHttp.responseText;
  }
}
