﻿var ClickFlag = 'True';

function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
   
}

var homeSubNavImage = "images/photo_1.jpg";

function resetHomeImage()
{
	// TODO:  
	//  The following line is causing an error because home_image cannot be found.  
	//  I'm commenting it out for until we can find a fix for this.
	//  Carlos Barichello, 31OCT2008.

	//document.getElementById('home_image').src = homeSubNavImage;
}

 function changeHomeSubNav(subNavItem, image)
{
	for(var x = 1; x < 6; x++)
	{
		if(subNavItem == "home_sub_nav_" + x)
		{
			document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav_active");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav_active");
			homeSubNavImage = image;
		}
		else if (document.getElementById("home_sub_nav_" + x))
		{
			document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav");
		}
	}
}

//Bipin : 06 Nov 09 : Added function to change the Image and Div.
function changeImageOnmouseover(subNavItem, image, divCount)
{
	for(var x = 1; x < divCount; x++)
	{
		if(subNavItem == "home_sub_nav_" + x)
		{
			document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav_active");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav_active");
			homeSubNavImage = image;
			
			document.getElementById("photo_wrapper" + x).style.display="block";
			document.getElementById(x).style.display="inline";
		}
		else if (document.getElementById("home_sub_nav_" + x))
		{
			document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav");
			
			document.getElementById("photo_wrapper" + x).style.display="none";
			document.getElementById(x).style.display="none";
		}
	}
	
	// TODO:  
	//  The following line is causing an error because home_image cannot be found.  
	//  I'm commenting it out for until we can find a fix for this.
	//  Carlos Barichello, 31OCT2008.
	// document.getElementById('home_image').src = homeSubNavImage;

}
function Next(divCount)
{
	for(var x = 1; x < divCount; x++)
	{
		if(document.getElementById(x).style.display == "inline")
		{
		    if (x != (divCount-1))	
		    {		    
		    document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav");
		    document.getElementById("photo_wrapper" + x).style.display="none";		    	    
		    document.getElementById(x).style.display="none";
		    x++;
		    document.getElementById("photo_wrapper" + x).style.display="block";
			document.getElementById(x).style.display="inline";
			
			document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav_active");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav_active");
			}
		}
		else
		{
		    document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav");
		
		    document.getElementById("photo_wrapper" + x).style.display="none";	
			document.getElementById(x).style.display="none";
		}
	}
}

function Previous(divCount)
{
	for(var x = divCount; x > 1 ; x--)
	{
		if(document.getElementById(x).style.display == "inline")
		{
		    if (x != 1)	
		    {
		    document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav");
		    document.getElementById("photo_wrapper" + x).style.display="none";		    
		    document.getElementById(x).style.display="none";
		    x--;
		    document.getElementById("photo_wrapper" + x).style.display="block";	
			document.getElementById(x).style.display="inline";
			document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav_active");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav_active");
			}
		}
		else
		{
		    document.getElementById("home_sub_nav_" + x).setAttribute("class", "home_sub_nav");
			document.getElementById("home_sub_nav_" + x).setAttribute("className", "home_sub_nav");
		
		    document.getElementById("photo_wrapper" + x).style.display="none";	
			document.getElementById(x).style.display="none";
		}
	}
}





