// JavaScript Document

//bookmark the page
var url = window.location.href;
var title = document.title;
function addToFavorites()
{
	 if (window.sidebar)  // Mozilla Firefox Bookmark		 
	  {
		 window.sidebar.addPanel(title,url,"");
	  }
	 if (window.external)
	  {
		window.external.AddFavorite(url,title) 
	  }
	 else
	 {
		alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
	 } 
 }
 
 
function show()
 {
	//show message as href 
 }
//quick link
function move_page(val)
{
	if(val==0)
		return false;
	if(val==1)
		document.location.href='ecommerce.shtml';
	if(val==2)
		document.location.href='sharepoint_solutions.shtml';
	if(val==3)
		document.location.href='crm_solutions.shtml';
	if(val==4)
		document.location.href='services.shtml';
	if(val==5)
		document.location.href='career.php';
	if(val==6)
		document.location.href='contact_us.php';
}


//validate emauil address

function validEmail(eAddr) 
{ 
   var goodAddr = false;
   var ndxAt = ndxDot = 0;

   ndxAt  = eAddr.indexOf("@");
   ndxDot = eAddr.indexOf(".");

   if ( (ndxDot < 0) || (ndxAt < 0) )
      goodAddr = false;
   else if ( eAddr.length <= (ndxDot + 2) )
      goodAddr = false;
   else
      goodAddr = true;
   return (goodAddr);                       
}



//validate career form
function validate(theForm)
{
  
if(theForm.first_name.value == "")
   {
     alert('Please enter first name ');
     theForm.first_name.focus();
	 return false;
   }

if(theForm.last_name.value == "")
   {
     alert('Please enter last name ');
     theForm.last_name.focus();
	 return false;
   }

if(theForm.email_address.value == '')
   {
     alert('Please enter e-mail address');
     theForm.email_address.focus();
	 return false;
   }
if(validEmail(theForm.email_address.value) == false)
   {
	 alert("Invalid Email address!");
     theForm.email_address.focus();
	 theForm.email_address.select();
	 return false;
   }

if (theForm.YourFile.value == "")
   {
     alert("Please press the Browse button and pick a file.")
     return false;
   }
else return true;
}

//reset captcha

  function reset_captcha()
  {
	document.getElementsByName("txtCaptcha").value="";
	with(document.getElementById('imgCaptcha')) 
	{
	src = "";
	src = 'includes/create_image.php?' + Math.random();
	}
 }

//end of reset captcha

//validate career page fields

 function validate_career()
  {
	if(document.getElementById('first_name').value == ''){
		alert('First Name is a mandatory field');
		document.getElementById('first_name').focus();
		return false;
	}
  	if(document.getElementById('last_name').value == ''){
		alert('Last Name is a mandatory field');
		document.getElementById('last_name').focus();
		return false;
	}
	if ((document.getElementById('txtEmail').value==null) || (document.getElementById('txtEmail').value=="")){
		alert("Please Enter your Email ID");
		document.getElementById('txtEmail').focus()
		return false;
	}
	if ((document.getElementById('txtEmail').value.indexOf('@')== -1) || (document.getElementById('txtEmail').value.indexOf('.') == -1)) {
		alert("Invalid Email ID");
		document.getElementById('txtEmail').focus();
		return false;
	}
	if(document.getElementById('txtCaptcha').value == ''){
		alert('Captacha is a mandatory field');
		document.getElementById('txtCaptcha').focus();
		return false;
	}
	else return true;
  }

//end of validate career page fields



//contact us form validate
function validate_contact()
  {
	dom=document.form1;
	var valid = " -()+0123456789";
	var ok = "yes";
	var temp;

	if(dom.uname.value == ''){
		alert('Name is a mandatory field');
		dom.uname.focus();
		return false;
	}
 	if ((dom.txtEmail.value==null) || (dom.txtEmail.value=="")){
		alert("Please Enter your Email ID");
		dom.txtEmail.focus()
		return false
	}
	if ((dom.txtEmail.value.indexOf('@')== -1) || (dom.txtEmail.value.indexOf('.') == -1)) {
		alert("Invalid Email ID");
		dom.txtEmail.focus();
		dom.txtEmail.select();
		return false
	}
	if(isNaN(dom.phone.value)){
		alert('Phone must be in numeric');
		dom.phone.focus();
		return false;
	}
	for (var i=0; i<dom.phone.value.length; i++)
	 {
		temp = "" + dom.phone.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1")
		 ok = "no";
	 }
	if (ok == "no")
	 {
		alert("Please enter correct phone number");
		dom.phone.focus();
		dom.phone.select();
		return false
	 }
	else return true;
  }

//end of validate contactus form
//fade up text code starts here
var msg=new Array()
msg[0]="Entellics SharePoint: Bringing Ideas, Information & People together through the...";
msg[1]="Entellics e-bizniz: Sophisticated E-Commerce for Today's Online Marketplace...";
msg[2]="Entellics CRM Solutions: CRM can be the most powerful method for...";

// set your first set of colors.  Use as many or as few as you wish.
var colors1=new Array("193854", "193854", "193854", "193854", "193854", "193854", "193854",
"193854", "193854", "193854", "193854", "193854", "193854", "193854", "193854", "193854")

//set your second set of colors
// *** must have exactly the same number of colors as the array above ***
var colors2=new Array("0066CC", "0066CC", "0066CC", "0066CC", "0066CC", "0066CC", "0066CC",
"0066CC", "0066CC", "0066CC", "0066CC", "0066CC", "0066CC", "0066CC", "0066CC", "0066CC")

//set the height of the display in pixels
high=10;

//set the width of the display in pixels
wide=8;

//set the pixel coordinates for the upper left hand corner of the display
Xpos=150;
Ypos=72;

// move the display away from the edges of the background
pad=10;

// set the background color of the display
bgcol="ffffff";

//add a background image if you want.
// *** for no image, just leave empty quotes (ex. cellbg=""; ) ***
cellbg="images/prd_bg_strip_insidepage.jpg";

// set the font
fntFam="Arial, Helvetica, sans-serif";
fntSize=11;

// set how how many seconds you want the message to stay remain at totality.
pause=2.5;


// Do not edit these values below!!!

icolor=0;
mcolor=1;
imsg=0;
spWidth=wide-(2*pad);
totality=false;
glowing=true;
var theMsg="";
var cellcontent="";
pause=pause*1000;
//if(cellbg.length>2){cellbg=" background="+cellbg}
//else{cellbg="";}

function doPause(){
   totality=false; t=setTimeout("changecolor()",pause);
   }
function initiate(){
   getContentColor();
   getMsg();
   //getCellContent();
   if(document.all){
   msgbg.innerHTML=cellcontent;   
   msgfade.innerHTML=theMsg;
   msgbg.style.posLeft=Xpos;
   msgbg.style.posTop=Ypos;
   msgfade.style.posLeft=Xpos+pad;
   msgfade.style.posTop=Ypos+pad;
   t=setTimeout("changecolor()",50);}
   if(document.layers){
   document.msgbg.document.write(cellcontent);
   document.msgbg.document.close();
   document.msgfade.document.write(theMsg);
   document.msgfade.document.close();
  
   document.msgbg.left=Xpos;
   document.msgbg.top=Ypos;
   document.msgfade.left=Xpos+pad;
   document.msgfade.top=Ypos+pad;
   t=setTimeout("changecolor()",50);}
   }
function changecolor(){
   if(totality==true){doPause();}
   else{
   getMsg();
   getContentColor();
   if(document.all){
   msgfade.innerHTML=theMsg;
   t=setTimeout("changecolor()",50);}
   if(document.layers){
   document.msgfade.document.write(theMsg);
   document.msgfade.document.close();
   t=setTimeout("changecolor()",70);}
   }
   }
function getFadeColor(){
   icolor=icolor-1;
   if(mcolor==1){contentcolor=colors1[icolor];}
   else{contentcolor=colors2[icolor];}
   }
function getGlowColor(){
   icolor=icolor+1;
   if(mcolor==1){contentcolor=colors1[icolor];}
   else{contentcolor=colors2[icolor];}
   }
function changemsg(){
   if(imsg==msg.length-1){imsg=0; mcolor=1;}
   else if(imsg != msg.lenght-1 && mcolor==1){imsg=imsg+1; mcolor=0;}
   else{imsg=imsg+1; mcolor=1;}
   }
function getContentColor(){
   if(icolor==colors1.length-1 && glowing==true){
   getFadeColor(); glowing=false; totality=true;}
   else if(icolor < colors1.length && glowing==true){
   getGlowColor();}
   else if(icolor < 1 && glowing==false){changemsg(); getGlowColor(); glowing=true;}
   else{getFadeColor();}
   }
function getMsg() {
   theMsg="<span style='font-size:"+fntSize+"px; font-family:"+fntFam+";vertical-align:top;'>"
   if(imsg==0)
   theMsg+="<B><font color="+contentcolor+">"+msg[imsg]+"</font></B><span class='comon_text_blue' style='padding:0px 20px 5px 70px;position:fixed;float:right; vertical-align:top;'><a href='test1.html'>read more</a></span> "
   if(imsg==1)
   theMsg+="<B><font color="+contentcolor+">"+msg[imsg]+"</font></B><span class='comon_text_blue' style='padding:0px 20px 5px 83px;position:fixed;float:right; vertical-align:top;'><a href='test2.html'>read more</a></span> "
   theMsg+="</span>"
  if(imsg==2)
   theMsg+="<B><font color="+contentcolor+">"+msg[imsg]+"</font></B><span class='comon_text_blue' style='padding:0px 20px 5px 77px;position:fixed;float:right; vertical-align:top;'><a href='test3.html'>read more</a></span> "
   }
function getCellContent(){
   cellcontent="<TABLE height="+high+
   " width="+wide+" bgcolor="+bgcol+" cellpadding=0 cellspacing=0><TR><TD"+cellbg+"> </TD></TR></TABLE>"}
