var xmlHttp

function ajax_getfiledetails()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="webpages/getfiledetails.asp";
xmlHttp.onreadystatechange=stateChanged_getfileval;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged_getfileval()
{ 
if (xmlHttp.readyState==4)
{ 
var myString = xmlHttp.responseText;
 }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function jumpTo(URL_List) {
// Change "_blank" to something like "newWindow" to load all links in the same new window
if(URL_List.options[URL_List.selectedIndex].value=='')
{

}
else
{

var newWindow = window.open(URL_List.options[URL_List.selectedIndex].value, '_blank');
newWindow.focus();
}
return false;
}
function dbStoreAjax(a)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="webpages/livehelp_page_hits_ajax.asp";
url=url+"?pagename="+document.location.href+"&langname="+a+"&ajaxcountry="+document.getElementById('cyreserve').value+"&ajaxstate="+document.getElementById('rgreserve').value+"&ajaxcity="+document.getElementById('ctreserve').value;
 
xmlHttp.open("post",url,true);
xmlHttp.send(null);
}
function ChartStoreAjax()
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
var url="charts/charts_data.asp";
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

setTimeout("ChartStoreAjax()", 300000);


  /* Ajax Live Price*/
  var enableCache = false;
    var jsCache = new Array();
    var AjaxObjects = new Array();

    function ShowContent(divId,ajaxIndex,url)      {
	        document.getElementById(divId).innerHTML = AjaxObjects[ajaxIndex].response;
	        if(enableCache){
		        jsCache[url] = 	AjaxObjects[ajaxIndex].response;
	        }
	        AjaxObjects[ajaxIndex] = false;
        }

    function Ajax(divId,url)     {
	        if(enableCache && jsCache[url]){
		        document.getElementById(divId).innerHTML = jsCache[url];
		        return;
	        }	
	        var ajaxIndex = AjaxObjects.length;
	        AjaxObjects[ajaxIndex] = new sack();
	        AjaxObjects[ajaxIndex].requestFile = url;
	        AjaxObjects[ajaxIndex].onCompletion = function(){ ShowContent(divId,ajaxIndex,url); };
	        AjaxObjects[ajaxIndex].runAJAX();
        }
		
function xml_file(a,b)
{ 
document.getElementById(a).value= b;
 Ajax('flash_price','webpages/live_chart_price.asp?comm_sym='+b+'');  
	if (a=="chartname_left")
	{
		var so_left = new SWFObject("charts/line_chart.swf", "amline", "550", "127", "8");
		so_left.addVariable("path", "charts/");
		so_left.addVariable("settings_file", encodeURIComponent("charts/line_chart_settings.xml"));
		so_left.addVariable("data_file", encodeURIComponent("charts/"+document.getElementById(a).value+".xml"));
  		so_left.addVariable("preloader_color", "#FFFFFF");							
		so_left.addParam("wmode", "transparent");							
		so_left.write("flashcontent_left");
	}	
}

function showChart(chNo) {
	  var hrefIDVal;	 
	  
	  for (var i=1;i<8;i++) {	   
	 	  hrefIDVal="gifChartAnc"+i;		 
			  document.getElementById(hrefIDVal).className="none";			 
	  	}
 	   hrefIDVal="gifChartAnc"+chNo;
    	   document.getElementById(hrefIDVal).className="current";
	  }
   function openwebsitesurvey(){
 					lnk="webpages/website_survey.asp"
					var win=window.open(lnk,"","width=720,height=570,toolbars=0,scrollbars=1,resizable=no")
					}


	var timerID = setInterval(startLoading,20);
	function startLoading() 	{
		var elem = document.getElementById('invet_camp');
		}
	function showIsPageLoading() {
		this.clearInterval(timerID);
		document.getElementById("invet_camp").style.display=''; 
		}
  function closeGreeting()    {
	   if (document.getElementById("invet_camp").style.display=='') {
		   	document.getElementById("invet_camp").style.display='none';
			}
	  }   
var newwindow;
function poplivehelp(url)
{
	newwindow=window.open("http://202.85.175.154/kappsoftlivehelp/"+url,'name','width=600, height=420, toolbars=0, scrollbars=1' );
	if (window.focus) {newwindow.focus()}
}

function banner_left()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="488" height="141">');
document.write('<param name="movie" value="webimages/swf/banner_left.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<embed src="webimages/swf/banner_left.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="488" height="141"></embed>');
document.write('</object>');
}
function banner_right()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="427" height="114">');
document.write('<param name="movie" value="webimages/swf/banner_right.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<embed src="webimages/swf/banner_right.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="427" height="114"></embed>');
document.write('</object>');
}

function business_news()
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="330" height="145">');
document.write('<param name="movie" value="charts/news.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<embed src="charts/news.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="330" height="145"></embed>');
document.write('</object>');
}
