// JScript source code
//Mail Validation
//onload="callDynamic()";

      function validateEmail(str)
       {
       var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=eval(str.length)-1;
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1)
		{
		   alert("Invalid Email Id");
		   document.getElementById("email").focus();
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Id");
		    document.getElementById("email").focus();
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Id");
		   document.getElementById("email").focus();
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		     alert("Invalid Email Id");
		   document.getElementById("email").focus();
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Id");
		   document.getElementById("email").focus();
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Id");
		   document.getElementById("email").focus();
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Id");
		   document.getElementById("email").focus();
		    return false;
		 }


		
       } 
    
    
    //Form Validation
						function validation()
						{	
					        if(document.myform.name.value=="" || document.myform.name.value=="Enter your name")
						 {
							alert("Please Enter your name")
							document.myform.name.focus()
							return false;
						 }	
						  if(document.myform.email.value=="" || document.myform.email.value=="Enter Your E-Mail ID")
						 {
							alert("Please Enter your Emailid")
							document.myform.email.focus()
							return false;
						 }
						 else if(validateEmail(document.getElementById("email").value)==false)
                        {
                          return false;
                         }   
						 else
							return true;
						}


						<!--
						function OpenTYWindow()
						{
							strName = "../mwscnew/subscribe.asp?email="+document.myform.email.value+"&name="+document.myform.name.value
							window.open(strName,'TY','top=200,left=150,width=375,height=200');
						}
						// -->
                         function makeblank(con)
                         {
                         con.value="";
                         //document.myform.email.value="";
                         
                         }
       
 //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>';




 //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////



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=begintag+fcontent1[index1]+closetag
    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] + ")");
}


