// JavaScript Document
window.onload=function()
{

//if (document.getElementById("ServicesList") == null) return; 

//if (document.getElementById("AEMList") == null) return;

//---------------------------------
var Path = window.location.href;
var hrefParts = Path.split('?show=');


var query = new String(hrefParts[1]);



	var Ext = Path.substring(Path.indexOf("."));
	var FileName = Path.substring(0,Path.indexOf(Ext));
	var LastChar = FileName.substring(FileName.length-1);
	
	
		if(!isNaN(LastChar))
	{
	FileName = FileName.substring(0,FileName.length-1);
	Path = FileName+Ext;
	}
//---------------------------------	


function getQueryVariable(variable) 

{
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) 
  {
    var pair = vars[i].split("=");
    if (pair[0] == variable) 
	 {
      return pair[1];
     }
  }
 
} 



 if(document.getElementById("ServicesList")!=null)
 
 {
	 var list = document.getElementById("ServicesList").getElementsByTagName("a");
     

 for(j=0;j<list.length;j++)
  {
	
	 if(list[j].href.indexOf(Path)>-1)
		
		{		
				
		list[j].style.color = "#fff";
		 
	    }
		
		
  }
 }



 if(document.getElementById("AEMList")!= null)

{
var aem_list = document.getElementById("AEMList").getElementsByTagName("a");

for(j=0;j<aem_list.length;j++)
  {
	
	if(aem_list[j].href.indexOf(query)>-1)
		{		
		
		aem_list[j].style.color = "#1c8ff9";	
		
	    }
	
  }
  
  

}

//------------------------------------
/*
MM_CheckFlashVersion('8,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?');
*/
}
function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}


function showLayer(id)
{
	document.getElementById(id).style.visibility = 'visible';
}

function hideLayer(id)
{
	document.getElementById(id).style.visibility = 'hidden';
}

function adjustPage()
{
   	    var b = document.documentElement.clientHeight;
		var f = document.getElementById('footer').offsetHeight;
		var h = document.getElementById('header').offsetHeight;
		var c = document.getElementById('content').offsetHeight;
		
		if ((b-h-f) > c)
		{
			var height = b-h-f
			document.getElementById('content').style.height = height+'px' ;
		}
}

function enableControls()
{
    $(".projectControl").attr("disabled", false);
}

function disableControls()
{
    $(".projectControl").attr("disabled", true);
}