// echeck, Ltrim functions are added on 3Jun, 2009 by Jyothi

function isEmpty(name)  //to check isempty of a specific field value
{	
	var invalid = " "; 
	if((name.value=="")||(name.value==invalid) || (name.value==0))
	{
		return true;
	}
	else 
	return false;
}

function check_url(address) 
{

	if (((address.indexOf ('http://') == -1) || (address.indexOf ('https://') == -1)) && (address.indexOf('.') == -1))
	{
 		
		return false; 
	}
	
	
	return true;

}
 
function emailCheck(email)
{
	var tmp = "" + email + "", s = tmp.replace(/^\s*|\s*$/g, "");
	var re = /^(\w|[^_]\.|[\-])+((\@){1}([^_]))(([a-z]|[\d]|[\-]|\.)+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i
	if (!re.test(s)) 
	{
		return false; 
	}
	re =	 /\.(a[c-gil-oq-uwz]|b[a-bd-jm-or-tvwyz]|c[acdf-ik-orsuvx-z]|d[ejkmoz]|e[ceghr-u]|f[i-kmorx]|g[abd-ilmnp-uwy]|h[kmnrtu]|i[delm-oq-t]|j[emop]|k[eg-imnprwyz]|l[a-cikr-vy]|m[acdghk-z]|n[ace-giloprtuz]|om|p[ae-hk-nrtwy]|qa|r[eouw]|s[a-eg-ort-vyz]|t[cdf-hjkm-prtvwz]|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[admrw]|com|edu|net|org|mil|gov|biz)$/i
	if (!re.test(s)) 
	{
		return false;
	}
	re = /\@\@/
	return(!re.test(s));
}

function FilterDigits()
{
	if (!(window.event.keyCode>=48 && window.event.keyCode <=57)) 
	{
		window.event.keyCode = 8
	} 
}

function IsFloat(sText)
{
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;
	
	var check = 0;
 	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i);
		
		if( (Char == ".") && (check==1))
			IsNumber = false;
		if(Char == ".")  
			check = 1;
		
		if (ValidChars.indexOf(Char) == -1) 
		{
			IsNumber = false;
		}
	}
   return IsNumber;
   
}

function WindowPopup(url, width_in, height_in) 
{
   	new_window = window.open(url,'window','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,top=50,left=100,scrollbars=yes,width=' + width_in + ',height=' + height_in);
	new_window.focus();
}


function CheckAll(frmNam)
{
	var intCounter = 0 ;
	var tot=0;
	tot = eval("document."+frmNam+".elements."+"length");
	box = eval("document."+frmNam+".elements");
	tot = tot - 1;
	var intCounter = 0 ;
	for(intCounter=0;intCounter<=tot;intCounter++) 
	{
		if(box[intCounter].type=="checkbox")
		{
			box[intCounter].checked=true;
		} 
	} 
		
}

function ClearAll(frmNam)
{
	var intCounter = 0 ;
	var tot=0;
	tot = eval("document."+frmNam+".elements."+"length");
	box = eval("document."+frmNam+".elements");
	tot = tot - 1;
	var intCounter = 0 ;
	for(intCounter=0;intCounter<=tot;intCounter++) 
	{
		if(box[intCounter].type=="checkbox")
		{
			box[intCounter].checked=false;
		} 
	} 
		
}

	function goCan(loc)
	{
		window.location = loc;
	}
function AllDigits()
{
	  if (!(window.event.keyCode>=48 && window.event.keyCode <=57)) 
		{
		window.event.keyCode = 8;
   		} 

}

function SmallCapsDigitsZip()
{
	  if (!(window.event.keyCode>=48 && window.event.keyCode <=57) &&  !(window.event.keyCode>=65 && window.event.keyCode <=90) &&!(window.event.keyCode>=97 && window.event.keyCode <=122)) 
		{
		window.event.keyCode = 8
   		} 

}

function PhoneDigits()
{
	  if (!(window.event.keyCode>=48 && window.event.keyCode <=57) && !(window.event.keyCode==32)&& !(window.event.keyCode==45)) 
		{
		window.event.keyCode = 8
   		} 

}


/*email Checking*/
function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false 
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
 		 return true					
	}
function LTrim(VALUE){
	var w_space = String.fromCharCode(32);
	if(v_length < 1){
		return"";
	}
	var v_length = VALUE.length;
	var strTemp = "";
	var iTemp = 0;
	while(iTemp < v_length){
		if(VALUE.charAt(iTemp) == w_space){
		}
		else{
			strTemp = VALUE.substring(iTemp,v_length);
			break;
		}
	iTemp = iTemp + 1;
	} //End While
	return strTemp;
} //End Function
function search()
{
	if(document.frmDefault.searchText.value=="" || document.frmDefault.searchText.value=="Search") 
	{
		alert("Please Enter search key word");
		document.frmDefault.searchText.focus();
		return false;
	}
	return true
}
function jump(str1)
{
	var strHref = window.location.href
	replaceChars(strHref,str1)
}

function replaceChars(entry,rep) {
	out = entry // replace this
	add = rep; // with this
	temp = "" + entry; // temporary holder
	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	window.location.href=temp;
}

// Function for calling popups in center of the screen. Added by Arun Thota on 22/10/07

function cordysOpenPopupPage(url,height,width) {

     //Get center pos of the screen
     var top=(screen.height-height)/2;
     var left=(screen.width-width)/2;
     win=window.open(url,"referPage","left=" + left + ",top=" + top + ",width="+width+",height="+height );
     if(win) {
          win.focus()
     }
	}



function rollover()
{
  if(!document.getElementById || !document.createTextNode){return;}
  var n=document.getElementById('customerlist_nav');
  if(!n){return;}
  var lis=n.getElementsByTagName('li');
  for (var i=0;i<lis.length;i++)
  {
    lis[i].onmouseover=function()
    {
      this.className=this.className?'cur':'over';
    }
    lis[i].onmouseout=function()
    {
       this.className=this.className=='cur'?'cur':'';
    }
  }
  showIndustry();
}

function showIndustry()
{
	var ind = document.location;

	var showInd = String(ind).split("?");
	var showInd2 = String(showInd[1]).split("#");

	if(showInd2[0] != "" && showInd2[0] == "business")
	{
		//alert(showInd2[0]);
	showhide('content_4','content_2','content_3','content_1');	
	document.location.href = ind;
	}
	
}

window.onload=rollover;	
// General Javascipt Document Created on 12-5-2009 by A.Vinay Kumar


//Accordian menu Home page Script created on 12-5-2009 by A.Vinay Kumar
$(document).ready(function(){
	$("#firstpane div.accordion_head").click(function()
		{
			$(this).next("div.accordion_body").slideToggle(300).siblings("div.accordion_body").slideUp("slow");
			$(this).siblings();
		});
});
	
//Right Side Customer Video Slider for Home page Script created on 12-5-2009 by A.Vinay Kumar

jQuery(function($) {
var timer_home;
function button1_flash(event)
{
$(".flash_slide").css("visibility","hidden");
$("#flash1").css("visibility","visible");
$("#flash1").css("opacity","0");
$("#flash1").animate({"opacity":2},1000, "linear", null);
$("#flash1").animate({"opacity":2},1000, "linear", null);
clearTimeout(timer_home);
timer_home = setTimeout(eval("button2_flash"),"5000");
$("#flash1").animate({"opacity":2},1000, "linear", null);
}

function button2_flash(event)
{
$(".flash_slide").css("visibility","hidden");
$("#flash2").css("visibility","visible");
$("#flash2").css("opacity","0");
$("#flash2").animate({"opacity":2},1000, "linear", null);
$("#flash2").animate({"opacity":2},1000, "linear", null);
clearTimeout(timer_home);
timer_home = setTimeout(eval("button1_flash"),"5000");
$("#flash2").animate({"opacity":2},1000, "linear", null);
}

var timer;
function button1_click(event)
{
$(".slide").css("visibility","hidden");
$("#image1").css("visibility","visible");
$("#image1").css("opacity","0");
$("#image1").animate({"opacity":1},300, "linear", null);
$("#image1").animate({"opacity":1},300, "linear", null);
clearTimeout(timer);
timer = setTimeout(eval("button2_click"),"3000");
$("#image1").animate({"opacity":1},300, "linear", null);
}

function button2_click(event)
{
$(".slide").css("visibility","hidden");
$("#image2").css("visibility","visible");
$("#image2").css("opacity","0");
$("#image2").animate({"opacity":1},300, "linear", null);
$("#image2").animate({"opacity":1},300, "linear", null);
clearTimeout(timer);
timer = setTimeout(eval("button3_click"),"3000");
$("#image2").animate({"opacity":1},300, "linear", null);
}

function button3_click(event)
{
$(".slide").css("visibility","hidden");
$("#image3").css("visibility","visible");
$("#image3").css("opacity","0");
$("#image3").animate({"opacity":1},300, "linear", null);
$("#image3").animate({"opacity":1},300, "linear", null);
clearTimeout(timer);
timer = setTimeout(eval("button1_click"),"3000");
$("#image3").animate({"opacity":1},300, "linear", null);
}


function OnLoad(event)
{
clearTimeout(timer_home);
timer_home = setTimeout(eval("button2_flash"),"5000");

clearTimeout(timer);
timer = setTimeout(eval("button2_click"),"3000");

}

OnLoad();
});

//Home page Tabs Script created on 12-5-2009 by A.Vinay Kumar

function showhide()
			{
				for(i=1;i<arguments.length;i++)
				{
					document.getElementById(arguments[i]).style.display = 'none';
					document.getElementById("link_"+arguments[i]).setAttribute('class','');
					document.getElementById("link_"+arguments[i]).setAttribute('className','');
				
				}
				if(document.getElementById(arguments[0]).style.display == 'none')
				 {
					document.getElementById(arguments[0]).style.display = '';
					var position = "tabContainer tabposition_"+arguments[0];
					var tabhead = "tab-header headposition_"+arguments[0];
					//alert(position);
					document.getElementById("tabContainer").setAttribute('class',position);
					document.getElementById("tab-header").setAttribute('class',tabhead);
					document.getElementById("link_"+arguments[0]).setAttribute('class','current');
					document.getElementById("tabContainer").setAttribute('className',position);
					document.getElementById("tab-header").setAttribute('className',tabhead);
					document.getElementById("link_"+arguments[0]).setAttribute('className','current');
					//document.getElementById("tabMain").setAttribute('className',position);
		
				 }
		}

