﻿/*

*/
var currentTabid = 1;
var nexttabid = 2;
jQuery(document).ready(function (){showProjectFlashVideo();});
function showProjectFlashVideo()
{
	divprojectwatchvideo=jQuery('#projectwatchvideo');
	if(divprojectwatchvideo){
	var section=divprojectwatchvideo.attr('name');
	divprojectwatchvideo.append("&nbsp;<img src='/SiteCollectionImages/moreinfo_arrow.gif' alt=''/>");
	divprojectwatchvideo.bind('click',function(){if(ShowModal){ShowModal(section);}});
	}
}

function initalldrivers()
{
	
		var obj = document.getElementById("headersplitid1");
		//alert(obj);
		if( obj != null )
		{
			obj.style.display='none';
		}
	

}
function hiddenalldrivers()
{
	for( var i=1;i<=3;i++)
	{
		var obj = document.getElementById("headersplitid"+i);
		//alert(obj);
		if( obj != null )
		{
			obj.style.display='none';
		}
	}
}
function changeDriver(clicktabid)
{
	if( clicktabid == 1)
	{
		document.getElementById("headersplitid2").style.display="";
		document.getElementById("headersplitid3").style.display="";
	}
	if( clicktabid == 2)
	{
		
		document.getElementById("headersplitid3").style.display="";
	}
	if( clicktabid == 3)
	{
		
		document.getElementById("headersplitid1").style.display="";
	}
	if( clicktabid == 4)
	{
		document.getElementById("headersplitid2").style.display="";
		document.getElementById("headersplitid1").style.display="";
	}



}
function projectinfotabclick( clickTabid )
{
	hiddenalldrivers();
    if( currentTabid != clickTabid )
    {
    		changeDriver(clickTabid );
	    var clickTab = document.getElementById("projecttab"+clickTabid);
    	var s=s_gi("macfluor");
    	
		s.tl(this,'o',s_simplepagename + " | Project detail page | Tab | "+clickTab.innerHTML);
	    clickTab.className = clickTab.className.replace("unselectedtab","");
        clickTab.className = clickTab.className.replace("selectedtab","");
        clickTab.className= clickTab.className+ " selectedtab";
        
    	
	    var obj = "projecttab"+currentTabid;

        document.getElementById(obj).className = document.getElementById(obj).className.replace("unselectedtab","");
        document.getElementById(obj).className = document.getElementById(obj).className.replace("selectedtab","");       
        document.getElementById(obj).className= document.getElementById(obj).className+ " unselectedtab";
    	
	    
	    
	    if ( clickTabid == 4 )
        {
            nexttabid = 1;
            document.getElementById("projectnexttabdiv").style.display = "none";
        }
        else
        {
            nexttabid = clickTabid +1;   
            document.getElementById("projectnexttabdiv").style.display = "";     
        }
    	
        document.getElementById("tabcontent"+clickTabid).style.display = "";
        document.getElementById("tabcontent"+currentTabid).style.display = "none";
        
        currentTabid = clickTabid;
        
        SetNextTabText(document.getElementById("projecttab" + nexttabid).innerHTML);
    }
    else
    {
    	changeDriver(clickTabid );

    }
    
    
    
}

function ProjectGotoNextTab(obj)
{
    
    if ( currentTabid == 4 )
    {
        nexttabid = 1;
    }
    else
    {
        nexttabid = currentTabid +1;        
    }
    projectinfotabclick(nexttabid);
}
 
function SetNextTabText( tabtext )
{
    document.getElementById("ProjectGotoNextTabid").innerHTML = tabtext + "&nbsp;<img alt='' src='/SiteCollectionImages/moreinfo_arrow.gif' />";
}

var __PageTitle=null;
function OnChangePageTitle()
{
   	var docTitle=document.title.replace(/#\d{0,3}/g,'');
	if(docTitle!=''){document.title=document.title.replace(/#\d{0,3}/g,'');__PageTitle=document.title;}
	else{if(__PageTitle!=null){document.title=__PageTitle.replace(/#\d{0,3}/g,'');}}
}
function initCodaSlider()
{
	var csws=jQuery('div.csw');
    var order=10;
    var ordercount,btndisable,btnenable,sliderindex,btnPreviousDisabled,btnPreviousEn,btnNextDisabled,btnNextEn,omnitureButtonType;
	var omnitureType = "featuredprojectsbuttons";	    
    for(var i=0;i<=csws.length-1;i++)
    {
    	if(i==0){omnitureType = "featuredprojectsbuttons";}
    	if(i==1){omnitureType = "legacyprojectsbuttons";}
        order+=i;
        var settings={	ordercount:order, 
        				sliderindex:i,
        				btndisable:'/SiteCollectionImages/Pag_Box_2.gif',
        				btnenable:'/SiteCollectionImages/Pag_Box_1.gif',
        				btnPreviousDisabled:'/SiteCollectionImages/Pag_Left_Arrow_1.gif',
        				btnPreviousEn:'/SiteCollectionImages/Pag_Left_Arrow_2.gif',	
        				btnNextDisabled:'/SiteCollectionImages/Pag_Right_Arrow_1.gif',
        				btnNextEn:'/SiteCollectionImages/Pag_Right_Arrow_2.gif',
        				omnitureButtonType:omnitureType};
        jQuery("div#"+csws[i].id).codaSlider(settings);
    }	
}


