function showNewSuggestionPopUp(val)
{	
	document.getElementById("dvsuggest").style.display = "";	
	document.getElementById("hdchallengeTitle").value = val;
	return void(0);
}

function showNewHelpPopUp(val)
{	
	document.getElementById(val).style.display = "";
	
}


function closeSuggestion()
{
	document.getElementById("dvsuggest").style.display = "none";	
}

function isAlphabets(val)
{
	var regExpr = /^[a-zA-Z0-9\s.\@\#\'_-]+$/
	res = regExpr.test(val)
	return res;
}
function isName(val)
{
	var regExpr = /^[a-zA-Z\s.\']*$/
	res = regExpr.test(val)
	return res;
}

function isEmail(val)
{

var regExpr = /^[\s]*[a-zA-Z0-9._]+\@[a-zA-Z0-9]+\.(([a-zA-Z]{2,4})[\s]*|([a-zA-Z]{2,3}\.[a-zA-Z]{2,3}))[\s]*$/;
// var emailRegExpr=/[\w.]+\@[\w]+\.(([a-zA-Z]{2,4})|([a-zA-Z]{2,2}\.[a-zA-Z]{2,2}))/
 res = regExpr.test(val);
 return res;
}

function isTextClear(val,valObj)
{
	if(valObj.value==val)
	{
	valObj.value=""
	}
}
function isTextReturn(val,valObj)
{
	if(valObj.value.replace(/ /g,'')=="")
	{
	valObj.value=val
	}
}
function suggestionValidation()
{
	doc = document.frmSuggest;	
	nameobj= doc.txtname;
	compobj = doc.txtcompany;
	emailobj = doc.txtemail;
	suggobj = doc.txtsugg;
	if(nameobj.value.length == 0)
	{
		alert("please enter your name");
		nameobj.focus();
		return false;
	}
	else
	{
		if(!isName(nameobj.value))
		{
			alert("Please enter only alphabets,space,dot(.) and single quote(') in name field");
			nameobj.focus();
			return false;
		}
	}
	if(nameobj.value.charAt(0) == " ")
	{
		alert("White space are not allowed in name");
		nameobj.focus();
		return false;
	}
	
	if(compobj.value.length == 0)
	{
		alert("please enter your company name");
		compobj.focus();
		return false;
	}
	else
	{
		if(!isAlphabets(compobj.value))
		{
			alert("Please do not enter special character in company");
			compobj.focus();
			return false;
		}
	}
	if(compobj.value.charAt(0) == " ")
	{
		alert("White space are not allowed in company name");
		compobj.focus();
		return false;
	}
	if(emailobj.value.length == 0)
	{
		alert("please enter Email ID");
		emailobj.focus();
		return false;
	}
	else
	{
		if(!isEmail(emailobj.value))
		{
			alert("Please enter valid email id");
			emailobj.focus();
			return false;
		}
	}
	if(suggobj.value.length == 0)
	{
		alert("Please enter your suggestion");
		suggobj.focus();
		return false;
	}
	if(suggobj.value.charAt(0) == " ")
	{
		alert("white space are not allowed in suggestion");
		suggobj.focus();
		return false;
	}
	if(suggobj.value.length > 1000)
	{
		alert("Please do not enter more that 1000 characters in suggestion");
		suggobj.focus();
		return false;
	}
	suggestionSubmit();	
}

// carreer form validation starting
function setValueCarreerId(val)
{
	document.frmHd_career.txtcareertitle.value = val;
	document.frmHd_career.action = "/careers_form.aspx";
	document.frmHd_career.method="post";
	document.frmHd_career.submit();
}

function changeImgNav(objval,imgval,idval)
{

	document.getElementById("if_off").src = "/images/tabs/if_off.gif";
	document.getElementById("HumanRes").src = "/images/tabs/hr_off.gif";
	document.getElementById("marketing").src = "/images/tabs/mc_off.gif";
	document.getElementById("finance").src = "/images/tabs/finance_off.gif";
	document.getElementById("aboutoff").src = "/images/tabs/about_off.gif";
	document.getElementById(objval).src = "/images/tabs/" + imgval;

	var mycontent = new Array(5);
	var myimages = new Array(5);
	var mylinks = new Array(5);

	mycontent[1] = "Spending sleepless nights looking for answers? ";

	mycontent[2] = "Spending sleepless nights looking for answers? ";

	mycontent[3] = "Spending sleepless nights looking for answers? ";

	mycontent[4] = "Spending sleepless nights looking for answers? ";

	mycontent[5] = "Take a few minutes to know why we are your right intranet partner. ";
	
	myimages[1] = "Ad-hoc knowledge sharing + no knowledge repository + limited access to information = Organizational Growth?";
	myimages[2] = "Less employee satisfaction + low employee retention + reduced productivity = Organizational Growth?";
	myimages[3] = "Different templates for presentations + different locations + various levels = perfect image consistency?";


	myimages[4] = "Non-automation of business process + ineffective MIS reporting + untimely approval = timely reimbursement disbursals?";
	myimages[5] = "Perfect focus + over 50 thousand subscribers + prestigious clientele = your right intranet partner.";

	mylinks[1] = "/intranet_solutions/hr/hr_knowledge_management.asp";
	mylinks[2] = "/intranet_solutions/hr/hr.asp";
	mylinks[3] = "/intranet_solutions/marketing_communication/marketing.asp";
	mylinks[4] = "/intranet_solutions/finance/finance.asp";
	mylinks[5] = "/about/about_us.asp";

	document.getElementById("imghometab").innerHTML = myimages[idval];
	document.getElementById("synopsisContent").innerHTML = mycontent[idval];
	document.getElementById("synopsisContentLink").href=mylinks[idval];
	//alert(document.getElementById("synopsisContentLink").href);

}

/*************************************************************Pagination For Search****************************/
function SearchArticle(pageid)
{
	 document.frmPageArticle.submit();
}

/*************************************************************Pagination Previous/Next**************************/
function Searchpage(pageid)
{
	 document.frmPageArticle.pagearticle.value=pageid
	 document.frmPageArticle.submit();
}

/***************************************Search Ends***************************************/