// JScript source code
//Mail Validation
//onload="callDynamic()";

      
       
 //Function for ajax loading                        
function callDynamic()
 {
   
  

 
  var xmlhttpN;
  copyspeed=pausespeed;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttpN=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttpN=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  //window.location="unsuscribedetails.asp?emailid="+document.getElementById("txtEmail").value+"";
  //alert("Your browser does not support XMLHTTP!");
  }
  xmlhttpN.onreadystatechange=function()
  {
  if(xmlhttpN.readyState==4)
  {
  fcontent1=(xmlhttpN.responseText).split("$#");
  changecontent1();
 // document.getElementById("newscont").innerHTML=xmlhttpN.responseText;
 // initializemarquee();
 // marqueespeed=1;
 // copyspeed=1;
  }
  
 
  }
xmlhttpN.open("GET","content/company/news/newslist.asp",true);
xmlhttpN.send(null);



 var xmlhttpE;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttpE=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttpE=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  //window.location="unsuscribedetails.asp?emailid="+document.getElementById("txtEmail").value+"";
  //alert("Your browser does not support XMLHTTP!");
  }
  xmlhttpE.onreadystatechange=function()
  {
  if(xmlhttpE.readyState==4)
  {
  document.getElementById("eventcont").innerHTML=xmlhttpE.responseText;
   
  }
  
 
  }
xmlhttpE.open("GET","content/company/events/eventlist.asp",true);
xmlhttpE.send(null);




 var xmlhttpM;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttpM=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttpM=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  //window.location="unsuscribedetails.asp?emailid="+document.getElementById("txtEmail").value+"";
  //alert("Your browser does not support XMLHTTP!");
  }
  xmlhttpM.onreadystatechange=function()
  {
  if(xmlhttpM.readyState==4)
  {
  document.getElementById("mediacont").innerHTML=xmlhttpM.responseText;
   
  }
  
 
  }
xmlhttpM.open("GET","content/company/mediacenter/medialist1.asp",true);
xmlhttpM.send(null);


 var xmlhttpP;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttpP=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttpP=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  //window.location="unsuscribedetails.asp?emailid="+document.getElementById("txtEmail").value+"";
  //alert("Your browser does not support XMLHTTP!");
  }
  xmlhttpP.onreadystatechange=function()
  {
  if(xmlhttpP.readyState==4)
  {
  document.getElementById("presscont").innerHTML=xmlhttpP.responseText;
   
  }
  
 
  }
xmlhttpP.open("GET","content/company/pressrelease/presslist1.asp",true);
xmlhttpP.send(null);

/*

var xmlhttpR;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttpR=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttpR=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  //window.location="unsuscribedetails.asp?emailid="+document.getElementById("txtEmail").value+"";
  //alert("Your browser does not support XMLHTTP!");
  }
  xmlhttpR.onreadystatechange=function()
  {
  if(xmlhttpR.readyState==4)
  {
  document.getElementById("rightscroll").innerHTML=xmlhttpR.responseText;
   
  }
  
 
  }
xmlhttpR.open("GET","rightscroll.asp",true);
xmlhttpR.send(null);
 */ 
/*
var xmlhttpEI;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttpEI=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttpEI=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  //window.location="unsuscribedetails.asp?emailid="+document.getElementById("txtEmail").value+"";
  //alert("Your browser does not support XMLHTTP!");
  }
  xmlhttpEI.onreadystatechange=function()
  {
  if(xmlhttpEI.readyState==4)
  {
 
   document.getElementById("mycrawler2").innerHTML=xmlhttpEI.responseText;
   
   marqueeInit({
	uniqueid: 'mycrawler2',
	style: {
		'padding': '0px 5px 0px 5px',
		'width': '703',
		'height': ''
	},
	inc:5, //speed - pixel increment for each iteration of this marquee's movement
	mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
	moveatleast: 2,
	neutral: 150,
	savedirection: true
    });
   
  }
  
 
  }
xmlhttpEI.open("GET","content/company/events/eventimages.asp",true);
xmlhttpEI.send(null);
*/
 

 }
 
 
 //Code For News Fadein-Fade Out
var startcolor1= new Array(255,255,255); // start color (red, green, blue)
var endcolor1=new Array(100,100,100);
begintag1='<div style="padding: 5px;">'; //set opening tag, such as font declarations
closetag1='</div>';

var fwidth='180px'; //set scroller width
var fheight='150px'; //set scroller height

var fadelinks=1;

var delay = 3500; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step


 //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////

var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;

var index1=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent1(){
  if (index1>=eval(fcontent1.length)-1)
    index1=0
  if (DOM2){
    document.getElementById("fscroller1").style.color="rgb("+startcolor1[0]+", "+startcolor1[1]+", "+startcolor1[2]+")"
    document.getElementById("fscroller1").innerHTML=begintag1+fcontent1[index1]+closetag1
    if (fadelinks)
      linkcolorchange1(1);
    colorfade1(1, 15);
  }
  else if (ie4)
    document.all.fscroller1.innerHTML=begintag1+fcontent1[index1]+closetag1;
  index1++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange1(step){
  var obj=document.getElementById("fscroller1").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor1(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter1;
function colorfade1(step) {
  if(step<=maxsteps) {	
    document.getElementById("fscroller1").style.color=getstepcolor1(step);
    if (fadelinks)
      linkcolorchange1(step);
    step++;
    fadecounter1=setTimeout("colorfade1("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter1);
    document.getElementById("fscroller1").style.color="rgb("+endcolor1[0]+", "+endcolor1[1]+", "+endcolor1[2]+")";
    setTimeout("changecontent1()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor1(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor1[i]-endcolor1[i]);
    if(diff > 0) {
      newcolor[i] = startcolor1[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor1[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}



