// JavaScript Document
<!-- Ajax script for image validation on client side -->
function image_valid()
{
	image_code=document.getElementById('secCode').value
 	if (window.XMLHttpRequest)
	 {        
		 xmlHttp=new XMLHttpRequest();    
	 }
	 else
	 {                 
		 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
	 } 
	 if (xmlHttp) 
	 {   
		 xmlHttp.open("GET", "../inc/ajax_image_validation.php?secCode="+image_code, false);   
		 xmlHttp.send(null);
		 return xmlHttp.responseText;    
 	 }
	 else
	 {   
		 return false; 
	 }  
}
 function refreshImage()
{
	var url = "../inc/refresh_image.php?p=" + Math.random();
	document.getElementById("verImage").setAttribute('src', url);
}

// this function will hide all the arrow images. 
function Hide_Arrows(array)
{
 	count=array.length;
 	for(j=0; j < count;j++)
	{
 		tempvar = document.getElementById(array[j]).style.visibility='hidden';
	//	alert(document.getElementById(array[j]).style.visibility+ ' count'+j + array[j])
	}
}

function Replace_content(id,type)
{
 	var xmlHttp;
	try
	{
	 //Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch(e)
	{
	// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
 	 active_link(id);
	xmlHttp.onreadystatechange =function()
	{
		if(xmlHttp.readyState == 4)
		{
		   if (xmlHttp.responseText!="")
		   {
 			  document.getElementById('content').innerHTML=xmlHttp.responseText
		   }
		}
	}
 	if(type=='I')
	{
		xmlHttp.open("GET", "php/content_ajax.php?pg_id="+id, true);
	}
	else if (type=='')
	{	
		xmlHttp.open("GET", "content_ajax.php?pg_id="+id, true);
	}
	xmlHttp.send(null);
 }
function active_link(id)
{
	document.getElementById('reality_services').style.color='#fff';
	document.getElementById('directors').style.color='#fff';
	document.getElementById('advisors').style.color='#fff';
	document.getElementById('contact').style.color='#fff';
	document.getElementById('index').style.color='#fff';
	
 switch(id)
{
 	case 0:
		document.getElementById('index').style.color='#000';
		break;
	case 1:
		document.getElementById('reality_services').style.color='#000';
		break;
	case 4:
		document.getElementById('directors').style.color='#000';
		break;
	case 5:
		document.getElementById('advisors').style.color='#000';
		break;
	case 6:
		document.getElementById('contact').style.color='#000';
		break;
	//default: 0;	
 			
}
return;
}
