
var classname_container="";

//********************************************************************//
//********************************************************************//
//16:25 PM 2/21/2009: Sarup:  For Ajax object initialization          //
//********************************************************************//
//********************************************************************//

function createObject()
{
  if(window.XMLHttpRequest)
	{
    var obj	= new XMLHttpRequest();
	}	
  else
  	{
    var obj	= new ActiveXObject('Microsoft.XMLHTTP');
	}
 return obj;
}
var httpobj	= createObject();
// End:  For Ajax object initialization  // 

//********************************************************************//
//********************************************************************//
//12:25 PM 2/27/2009: Sarup:  Ajax responce for news Title and details//
//********************************************************************//
//********************************************************************//
function GetPager(idobj)
{
	var curid = document.getElementById('tt').value
	var url='ajax_pager_response.php?curid='+curid;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = HandlePager;
	httpobj.send(null);
}
function HandlePager()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('showpager').innerHTML = text;
	 }
}
 
function GetPager1(idobj)
{
	var curid = document.getElementById('tt').value
	var url='ajax_pager1_response.php?curid='+curid;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = HandlePager1;
	httpobj.send(null);
}

function HandlePager1()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('showpager').innerHTML = text;
	 }
}

function GetPager2(idobj)
{
	var curid = document.getElementById('tt').value
	var url='ajax_pager2_response.php?curid='+curid;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = HandlePager2;
	httpobj.send(null);
}

function HandlePager2()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('showpager').innerHTML = text;
	 }
}



//********************************************************************//
//********************************************************************//
//12:25 PM 2/27/2009: Sarup:  Ajax responce for news Title and details//
//********************************************************************//
//********************************************************************//

function newsdetails(objid)
{
	GetNews(objid);
}

function GetNews(idobj)
{
	var id = idobj.id;
	var url='ajax_news_response.php?details=1&id='+id+'&clsname='+classname_container;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = handleNews;
	httpobj.send(null);
}

function handleNews()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('shownewsdetail').innerHTML = text;
	 }
}

function GetnewsTitle(idobj)
{
	var id = idobj.id;
	var url='ajax_news_response.php?title=1&id='+id;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = HandleNewsTitle;
	httpobj.send(null);
}

function HandleNewsTitle()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('shownewstitle').innerHTML = text;
		 //document.getElementById('shownewsdetail').innerHTML = "<div class='content2' ><a class='servicetext' href='#'>Click image to view details.</a></div>";

	 }
}
//End : Ajax responce for news Title and details//

//********************************************************************//
//********************************************************************//
//10:25 PM 2/27/2009: Sarup:  Detail window scroller buttons handling.//
//********************************************************************//
//********************************************************************//

scrollStep=1;
timerLeft="";
timerRight="";
function toLeft(id)
{
  document.getElementById(id).scrollLeft=0;
}

function scrollDivLeft(id)
{
  clearTimeout(timerRight);
  document.getElementById(id).scrollLeft+=scrollStep;
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10);
}

function scrollDivRight(id)
{
  clearTimeout(timerLeft);
  document.getElementById(id).scrollLeft-=scrollStep;
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10);
}

function toRight(id)
{
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth;
}

function stopMe()
{
  clearTimeout(timerRight);
  clearTimeout(timerLeft);
}

//End : Detail window scroller buttons handling//

//************************************************************************//
//************************************************************************//
//12:25 PM 2/27/2009: Sarup:  Ajax responce for services Title and details//
//************************************************************************//
//************************************************************************//

function servicesdetails(objid)
{
	Getservices(objid);
}

function Getservices(idobj)
{
	var id = idobj.id;
	var url='ajax_services_response.php?details=1&id='+id+'&clsname='+classname_container;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = handleservices;
	httpobj.send(null);
}

function handleservices()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('showservicedetails').innerHTML = text;
	 }
}

function GetservicesTitle(idobj)
{
	var id = idobj.id;
	var url='ajax_services_response.php?title=1&id='+id;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = HandleservicesTitle;
	httpobj.send(null);
}

function HandleservicesTitle()
{
	 if(httpobj.readyState==4)
	 {
		 text = httpobj.responseText;
		 document.getElementById('showservicestitle').innerHTML = text;
		 //document.getElementById('showservicedetails').innerHTML = "<div class='content2' ><a class='servicetext' href='#'>Click image to view details.</a></div>";

	 }
}
//End : Ajax responce for services Title and details//

//************************************************************************//
//************************************************************************//
//12:25 PM 2/27/2009: Sarup:  Ajax responce for people Title and details//
//************************************************************************//
//************************************************************************//

function peopledetails(objid)
{
	Getpeople(objid);
}

function Getpeople(idobj)
{
	var id = idobj.id;
	var url='ajax_people_response.php?details=1&id='+id+'&clsname='+classname_container;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = handlepeople;
	httpobj.send(null);
}

function handlepeople()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('showpeopledetail').innerHTML = text;
	 }
}

function GetpeopleTitle(idobj)
{
	var id = idobj.id;
	var url='ajax_people_response.php?title=1&id='+id;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = HandlepeopleTitle;
	httpobj.send(null);
}

function HandlepeopleTitle()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('showpeopletitle').innerHTML = text;
		 //document.getElementById('showpeopledetail').innerHTML = "<div class='content2' ><a class='servicetext' href='#'>Click image to view details.</a></div>";

	 }
}
//End : Ajax responce for people Title and details//

//************************************************************************//
//************************************************************************//
//12:25 PM 2/27/2009: Sarup:  Ajax responce for portfolio Title and details//
//************************************************************************//
//************************************************************************//

function portfoliodetails(objid)
{
	Getportfolio(objid);
}

function Getportfolio(idobj)
{
	var id= idobj.id;
	var url='ajax_portfolio_response.php?details=1&id='+id+'&clsname='+classname_container;
	redirect = url;
	//alert(url);
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = handleportfolio;
	httpobj.send(null);
}

function handleportfolio()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('showportfoliodetail').innerHTML = text;
		//alert(document.getElementById('showportfoliodetail').innerHTML);

	 }
}
function GetportfolioTitle(idobj)
{
	var id = idobj.id;
	var url='ajax_portfolio_response.php?title=1&id='+id;
	//alert(url);
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = HandleportfolioTitle;
	httpobj.send(null);
	//onComplete:Getportfolio(id);
}

function HandleportfolioTitle()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 //alert(text);
		 document.getElementById('showportfoliotitle').innerHTML = text;
		 //document.getElementById('showportfoliodetail').innerHTML = "<div class='content2' ><a class='servicetext' href='#'>Click image to view details.</a></div>";
	 }
}
//End : Ajax responce for portfolio Title and details//


//************************************************************************//
//************************************************************************//
//1:07 PM 3/2/2009: Sarup:  Ajax responce for new headlines               //
//************************************************************************//
//************************************************************************//

function GetHeadlines()
{
	var url='ajax_headlines_response.php?newid='+i;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = Handleheadlines;
	httpobj.send(null);
	return;
}

function Handleheadlines()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('newstext').innerHTML = text;
	 }
	 return;
}


//************************************************************************//
//************************************************************************//
//6:53 PM 3/13/2009: Sarup:  Ajax response for weblink                    //
//************************************************************************//
//************************************************************************//

function Getweblink(idobj)
{
	var id = idobj;
	var url='ajax_weblink_response.php?id='+id;
	redirect = url;
	httpobj.open('get',redirect);
	httpobj.onreadystatechange = handleweblink;
	httpobj.send(null);
}

function handleweblink()
{
	 if(httpobj.readyState==4)
	 {
		 text=httpobj.responseText;
		 document.getElementById('weblink').innerHTML = text;
	 }
}

function IsNumeric(sText)
{
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	  { 
	  Char = sText.charAt(i); 
	  if (ValidChars.indexOf(Char) == -1) 
		 {
		 IsNumber = false;
		 }
	  }
	return IsNumber;
}

