                function validation() 
                { 
                  var name=document.contactus.name.value;
                  var telephone=document.contactus.telephone.value;
                  var email=document.contactus.email.value;
                  var security_code=document.contactus.security_code.value;

                  name=name.replace(/^\s*|\s*$/g,"");
                  telephone=telephone.replace(/^\s*|\s*$/g,"");
                  email=email.replace(/^\s*|\s*$/g,"");
                  security_code=security_code.replace(/^\s*|\s*$/g,"");

                  if (name == '') {
                  alert("Please Fill Proper Name!");
                  document.contactus.name.focus();
                  return false;
                  }
                  if (telephone=='') {
                  alert("Please Fill Proper Telephone!");
                  document.contactus.telephone.focus();
                  return false;
                  }

                  if (email == '' || isValidEmail(email)==false) {
                  alert("Please Fill Proper Email!");
                  document.contactus.email.focus();
                  return false;
                  }
                  if (security_code=='') {
                  alert("Please Enter Exact Security Code provided in the image above!");
                  document.contactus.security_code.focus();
                  return false;
                  }

                }
                function isValidEmail(str) {
                return (str.indexOf(".") > 1) && (str.indexOf("@") > 0);

                }
 
  
  



  function rfpvalidation() 
{ 
var rf_type=document.rfpform.rf_type.value;
var name=document.rfpform.name.value;
var telephone=document.rfpform.telephone.value;
var email=document.rfpform.email.value;
var script_lang=document.rfpform.script_lang.value;
var server=document.rfpform.server.value;
var database=document.rfpform.database.value;
var design=document.rfpform.design.value;
var budget=document.rfpform.budget.value;
var timeline=document.rfpform.timeline.value;
var security_code=document.rfpform.security_code.value;

rf_type=rf_type.replace(/^\s*|\s*$/g,"");
name=name.replace(/^\s*|\s*$/g,"");
telephone=telephone.replace(/^\s*|\s*$/g,"");
email=email.replace(/^\s*|\s*$/g,"");
script_lang=script_lang.replace(/^\s*|\s*$/g,"");
server=server.replace(/^\s*|\s*$/g,"");
database=database.replace(/^\s*|\s*$/g,"");
design=design.replace(/^\s*|\s*$/g,"");
budget=budget.replace(/^\s*|\s*$/g,"");
timeline=timeline.replace(/^\s*|\s*$/g,"");
security_code=security_code.replace(/^\s*|\s*$/g,"");

if (rf_type == '') {
alert("Please Select Request Type!");
document.rfpform.rf_type.focus();
return false;
}
if (name == '') {
alert("Please Fill Proper Name!");
document.rfpform.name.focus();
return false;
}
if (telephone=='') {
alert("Please Fill Proper Telephone!");
document.rfpform.telephone.focus();
return false;
}

if (email == '' || isValidEmail(email)==false) {
alert("Please Fill Proper Email!");
document.rfpform.email.focus();
return false;
}
if (script_lang=='') {
alert("Please Select a Scripting Language!");
document.rfpform.script_lang.focus();
return false;
}
if (server=='') {
alert("Please Select a Server Value!");
document.rfpform.server.focus();
return false;
}
if (database=='') {
alert("Please Select a Database!");
document.rfpform.database.focus();
return false;
}
if (design=='') {
alert("Please Select a Design option!");
document.rfpform.design.focus();
return false;
}
if (budget=='') {
alert("Please Enter Your Maximum Budget!");
document.rfpform.budget.focus();
return false;
}
if (timeline=='') {
alert("Please Enter Your Maximum Timeline!");
document.rfpform.timeline.focus();
return false;
}

if (security_code=='') {
alert("Please Enter Exact Security Code provided in the image above!");
document.rfpform.security_code.focus();
return false;
}

}
function isValidEmail(str) {
return (str.indexOf(".") > 1) && (str.indexOf("@") > 0);

}




  function careervalidation() { 
  var name=document.resume.name.value;
  var jobcode=document.resume.jobcode.value;
  var expyrs=document.resume.expyrs.value;
  var expmnt=document.resume.expmnt.value;
  var currentctc=document.resume.currentctc.value;
  var expectedctc=document.resume.expectedctc.value;
  var currentlocation=document.resume.currentlocation.value;
  var releasetime=document.resume.releasetime.value;
  var telephone=document.resume.telephone.value;
  var email=document.resume.email.value;
  var employer=document.resume.employer.value;
  var dd=document.resume.dd.value;
  var mm=document.resume.mm.value;
  var yyyy=document.resume.yyyy.value;
  var drawing=document.resume.drawing.value;
  var security_code=document.resume.security_code.value;



  name=name.replace(/^\s*|\s*$/g,"");
  jobcode=jobcode.replace(/^\s*|\s*$/g,"");
  expyrs=expyrs.replace(/^\s*|\s*$/g,"");
  expmnt=expmnt.replace(/^\s*|\s*$/g,"");
  currentctc=currentctc.replace(/^\s*|\s*$/g,"");
  expectedctc=expectedctc.replace(/^\s*|\s*$/g,"");
  currentlocation=currentlocation.replace(/^\s*|\s*$/g,"");
  releasetime=releasetime.replace(/^\s*|\s*$/g,"");
  telephone=telephone.replace(/^\s*|\s*$/g,"");
  email=email.replace(/^\s*|\s*$/g,"");
  employer=employer.replace(/^\s*|\s*$/g,"");
  dd=dd.replace(/^\s*|\s*$/g,"");
  mm=mm.replace(/^\s*|\s*$/g,"");
  yyyy=yyyy.replace(/^\s*|\s*$/g,"");
  drawing=drawing.replace(/^\s*|\s*$/g,"");
  security_code=security_code.replace(/^\s*|\s*$/g,"");


  if (name == '') {
  alert("Please Fill Proper Name!");
  document.resume.name.focus();
  return false;
  }
  if (jobcode=='') {
  alert("Please Select Proper Jobcode");
  document.resume.jobcode.focus();
  return false;
  }
  if (expyrs=='' || isNaN(expyrs)) {
  alert("Please Fill Total Experience in Years. Numbers Only.");
  document.resume.expyrs.focus();
  return false;
  }
  if (expmnt=='' || isNaN(expmnt)) {
  alert("Please Fill Total Experience in Months. Numbers Only.");
  document.resume.expmnt.focus();
  return false;
  }
  if (currentctc=='' || isNaN(currentctc)) {
  alert("Please Enter Current Annual CTC. Numbers Only.");
  document.resume.currentctc.focus();
  return false;
  }
  if (expectedctc==''|| isNaN(expectedctc)) {
  alert("Please Enter Expected Annual CTC. Numbers Only.");
  document.resume.expectedctc.focus();
  return false;
  }
  if (currentlocation=='') {
  alert("Please Enter Your Present Location");
  document.resume.currentlocation.focus();
  return false;
  }
  if (releasetime==''|| isNaN(releasetime)) {
  alert("Please Enter Minimum Days to Get Release if Selected. Numbers Only.");
  document.resume.releasetime.focus();
  return false;
  }

  if (telephone==''|| isNaN(telephone)) {
  alert("Please Fill Proper Telephone.  Numbers Only.");
  document.resume.telephone.focus();
  return false;
  }
  if (email == '' || isValidEmail(email)==false) {
  alert("Please Fill Proper Email.");
  document.resume.email.focus();
  return false;
  }

  if (employer=='') {
  alert("Please Enter Your Current Employer");
  document.resume.employer.focus();
  return false;
  }
  if (dd==''|| isNaN(dd)) {
  alert("Please Enter Day of Birth. Numbers Only. ");
  document.resume.dd.focus();
  return false;
  }
  if (mm==''|| isNaN(mm)) {
  alert("Please Enter Your Month of Birth. Numbers Only.");
  document.resume.mm.focus();
  return false;
  }
  if (yyyy==''|| isNaN(yyyy)) {
  alert("Please Enter Your Year of Birth. Numbers Only.");
  document.resume.yyyy.focus();
  return false;
  }
  if (drawing=='') {
  alert("Please Upload Your Resume /CV");
  document.resume.drawing.focus();
  return false;
  }

  if (security_code=='') {
  alert("Please Enter Exact Security Code provided in the image above!");
  document.rfpform.security_code.focus();
  return false;
  }


  }
  function isValidEmail(str) {
  return (str.indexOf(".") > 1) && (str.indexOf("@") > 0);

  }




  
  function linkLocation(location) { 
            window.location.href=location;
  }
  function changeTo(callerId,newSrc) {
	document.getElementById(callerId).src = newSrc;
   }


var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode;
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}


// for checkbox select one
<!-- Begin
function checkBoxValidate(cb) {
for (j = 0; j < 2; j++) {
if (eval("document.contactus.sex[" + j + "].checked") == true) {
document.contactus.sex[j].checked = false;
if (j == cb) {
document.contactus.sex[j].checked = true;
         }
      }
   }
}
//  End -->






function ReplaceContent(layerName){

if(ie){document.all[layerName].innerHTML = ContentInfo}


if(ns){

with(document.layers[layerName].document) 
{ 
   open(); 
   write(ContentInfo); 
   close(); 
}

}


}
function Activate(){initialize=1}
function deActivate(){initialize=0}

function showLayer(layerName)
{
  document.getElementById(layerName).style.display="block";
}
function hideLayer(layerName)
{

document.getElementById(layerName).style.display="none";

}



//** Tab Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:
//   -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected
//   -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted
//   -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)
//   -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container
//** Updated Feb 18th, 08 to version 2.1: Adds a "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically
//** Updated April 8th, 08 to version 2.2: Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) 

////NO NEED TO EDIT BELOW////////////////////////

function ddtabcontent(tabinterfaceid){
	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
	this.enabletabpersistence=true
	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
	this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
	this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
	this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
}

ddtabcontent.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

ddtabcontent.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}

ddtabcontent.prototype={

	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
		this.cancelautorun() //stop auto cycling of tabs (if running)
		var tabref=""
		try{
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=document.getElementById(tabid_or_position)
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=this.tabs[tabid_or_position]
		}
		catch(err){alert("Invalid Tab ID or position entered!")}
		if (tabref!="") //if a valid tab is found based on function parameter
			this.expandtab(tabref) //expand this tab
	},

	cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
		if (dir=="next"){
			var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
		}
		else if (dir=="prev"){
			var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
		}
		if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
			this.cancelautorun() //stop auto cycling of tabs (if running)
		this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
	},

	setpersist:function(bool){ //PUBLIC function to toggle persistence feature
			this.enabletabpersistence=bool
	},

	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
		this.selectedClassTarget=objstr || "link"
	},

	getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
	},

	urlparamselect:function(tabinterfaceid){
		var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
		return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
	},

	expandtab:function(tabref){
		var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		this.expandsubcontent(subcontentid)
		this.expandrevcontent(associatedrevids)
		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
		}
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
		this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
	},

	expandsubcontent:function(subcontentid){
		for (var i=0; i<this.subcontentids.length; i++){
			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
		}
	},

	expandrevcontent:function(associatedrevids){
		var allrevids=this.revcontentids
		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
		}
	},

	setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
		for (var i=0; i<this.hottabspositions.length; i++){
			if (tabposition==this.hottabspositions[i]){
				this.currentTabIndex=i
				break
			}
		}
	},

	autorun:function(){ //function to auto cycle through and select tabs based on a set interval
		this.cycleit('next', true)
	},

	cancelautorun:function(){
		if (typeof this.autoruntimer!="undefined")
			clearInterval(this.autoruntimer)
	},

	init:function(automodeperiod){
		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
		var selectedtab=-1 //Currently selected tab index (-1 meaning none)
		var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
		this.automodeperiod=automodeperiod || 0
		for (var i=0; i<this.tabs.length; i++){
			this.tabs[i].tabposition=i //remember position of tab relative to its peers
			if (this.tabs[i].getAttribute("rel")){
				var tabinstance=this
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
				this.tabs[i].onclick=function(){
					tabinstance.expandtab(this)
					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
					return false
				}
				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
				}
				if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
					selectedtab=i //Selected tab index, if found
				}
			}
		} //END for loop
		if (selectedtab!=-1) //if a valid default selected tab index is found
			this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
		else //if no valid default selected index found
			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
		}
	} //END int() function

} //END Prototype assignment

