function show_selected(obj)
{
	var abt=document.getElementById(obj);
	
	if (abt.style.display!='')
	{//alert(i)
		abt.style.display="";
	}
	else
	{
		abt.style.display="none";
	}
}
function show_selected_login(obj)
{
	var list = new Array('abt','ins','howdoi');
	for(i=0;i<list.length;i++) {
		if(obj==list[i]) {
			if (document.getElementById(list[i]).style.display!='')
			{//alert(i)
				document.getElementById(list[i]).style.display="";
			}
			else
			{
				document.getElementById(list[i]).style.display="none";
			}
		}
		else {
				document.getElementById(list[i]).style.display="none";
		}
}
}
function hide_selected(obj){
	var obj = document.getElementById(obj);
	obj.style.display = "none";
}

function validate_det()
{
	var user=document.UNP.userName;
	if(user.value =='' || user.value =='username')
	{
		alert ("Please enter user name");
		document.UNP.userName.focus();
		return false;
	}	
	var pass=document.UNP.userPasswd;
	if(pass.value =='' || pass.value =='userpasswd')
	{
		alert ("Please enter password");
		document.UNP.userPasswd.focus();
		return false;
	}
	return true;
}
/*form validation*/

/*Text Validation function*/
function textValidate(incomingString, defaultValue) 
	{
	if(trimSpace(incomingString).length == 0 || incomingString.search(/[^a-zA-Z ]/g) != -1 || incomingString==defaultValue)
	{
		return false;
	}
	else
		return true;
}
/*Text Validation end*/

/*Email Validation function*/
function emailValidate(incomingString, defaultValue) {
	if(trimSpace(incomingString).length == 0 || incomingString.search
		(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i) == -1 || incomingString==defaultValue)
	{
		return false;
	}
	else
		return true;
}
/*Email Validation function*/

/*Number Validation function*/
function numberValidate(incomingString, defaultValue) {
	if(trimSpace(incomingString).length == 0 || incomingString.search(/[^0-9\.]/g) != -1 || incomingString==defaultValue || parseInt(incomingString, 10) <= 0 )
	{
		return false;
	}
	else
		return true;
}
/*Number Validation function*/


/*Number Validation function*/
function numberValidateOnly(incomingString) {
	if(incomingString.search(/[^0-9\.]/g) != -1)
	{
		return false;
	}
	else
		return true;
}
/*Number Validation function*/

/*Number Validation Only function*/
function numberValidateOnly(incomingString) {
	if(incomingString.search(/[^0-9\.]/g) != -1)
	{
		return false;
	}
	else
		return true;
}
/*Number Validation function*/

/*Radio Button Validation*/
function checkRadio(radioObj) {
	for(i=0;i<radioObj.length;i++){
		if(radioObj[i].checked){
			return true;
		}
		else {
			return false;
		}
	}
	return false;
}
/*Radio Button Validation*/

/*Space Stripper Validation*/
function spaceStripper(incomingText) {
	str1 = " ";
	str2 = "";
	workString=incomingText;
	while (workString.indexOf(str1)!=-1){
	workString = workString.substring(0,workString.indexOf(str1))+str2+workString.substring(workString.indexOf(str1)+str1.length,workString.length);
	}
	return workString;
}

function trimSpace(x) {
	var emptySpace = / /g;
	var trimAfter = x.replace(emptySpace,"");
	return(trimAfter);
}

function validate_regform() {

/*Validation for Login ID*/
if((!textValidate(document.getElementById('loginId').value, '')))
	{
		alert("Please Enter Login ID.");
		document.getElementById('loginId').focus();
		document.getElementById('loginId').select();
		return false;
	}


/*Validation for Password*/
if((!textValidate(document.getElementById('Password').value, '')))
	{
		alert("Please Enter Password.");
		document.getElementById('Password').focus();
		document.getElementById('Password').select();
		return false;
	}


/*Validation for Confirm Password*/
if((!textValidate(document.getElementById('confirmPassword').value, '')))
	{
		alert("Please Enter Confirm Password.");
		document.getElementById('confirmPassword').focus();
		document.getElementById('confirmPassword').select();
		return false;
	}

/*Validation for Password and Confirm Password are same*/
if(document.getElementById('Password').value!=document.getElementById('confirmPassword').value)
	{
		alert("Wrong Password / Confirm Password.");
		document.getElementById('Password').focus();
		document.getElementById('Password').select();
		return false;
	}

if(!emailValidate(document.getElementById('emailId').value,''))
	{
		alert("Please Enter The Email Id")
		document.getElementById('emailId').focus();
		document.getElementById('emailId').select();
		return false;
	}

if(!emailValidate(document.getElementById('alternateMailid').value,''))
	{
		alert("Please Enter The Alternate Email Id")
		document.getElementById('alternateMailid').focus();
		document.getElementById('alternateMailid').select();
		return false;
	}

if(!numberValidate(document.getElementById('Age').value,''))
	{
		alert("Please Enter the Age");
		document.getElementById('Age').focus();
		document.getElementById('Age').select();
		return false;
	}

	/*Gender Validation */
	if(!checkRadio(document.getElementById('gender')))
	{
		alert("Please Select Your Gender");
		document.getElementById('gender').focus();
		return false;
	}
/*Category Calidation*/
	if(document.getElementById('Category').value=='Entrepreneurs') {
		if(!numberValidateOnly(document.getElementById('yearofStarting').value)) {
			alert("Please Enter the Year of Starting");
			document.getElementById('yearofStarting').focus();
			document.getElementById('yearofStarting').select();
			return false;
		}
		
		if(!numberValidateOnly(document.getElementById('annualRevenues').value)) {
			alert("Please Enter the Annual Revenues");
			document.getElementById('annualRevenues').focus();
			document.getElementById('annualRevenues').select();
			return false;
		}
	}
	else if(document.getElementById('Category').value=='Innovator') {
		
	}
	else if(document.getElementById('Category').value=='Mentors/Experts') {
		
	}
	else if(document.getElementById('Category').value=='Innovation Seeker/ Investor') {

		if(!numberValidateOnly(document.getElementById('innoAverage').value)) {
			alert("Please Enter the Average Investing amount");
			document.getElementById('innoAverage').focus();
			document.getElementById('innoAverage').select();
			return false;
		}
	}
}




function validate() {
/*Validation for Name*/
if((!textValidate(document.getElementById('loginId').value, '')))
	{
		alert("Please Enter Login ID.");
		document.getElementById('loginId').focus();
		document.getElementById('loginId').select();
		return false;
	}

if((!textValidate(document.REG.designation.value, '')))
	{
		alert("Please Enter Your Designation.");
		document.REG.designation.focus();
		document.REG.designation.select();
		return false;
	}
if(document.REG.innovationDev.selectedIndex==0){
	alert("Please select You are");
	document.REG.innovationDev.focus();
	return false;
	}

if((!textValidate(document.REG.institute.value, '')))
	{
		alert("Please enter the Institute / Organization.");
		document.REG.institute.focus();
		document.REG.institute.select();
		return false;
	}
if(!emailValidate(document.REG.email.value,''))
		{
			alert("Please Enter The Correct Email Id")
			document.REG.email.focus();
			document.REG.email.select();
			return false;
		}
if(!numberValidate(document.REG.contactNumber.value,''))
	{
		alert("Please Enter Your Valid Mobile Number");
		document.REG.contactNumber.focus();
		document.REG.contactNumber.select();
		return false;
	}
	if(document.REG.contactNumber.value.length<7 || document.REG.contactNumber.value.length==9||document.REG.contactNumber.value.length==8)
	{
		alert("Please Enter Your Valid Mobile Number");
		document.REG.contactNumber.focus();
		document.REG.contactNumber.select();
		return false;
	}
	return true;
}
/*form validation*/

/*expend script*/
excol_temp="";
function expand_connect(obj){
	var iconObj=document.getElementById(obj+'_ico')
	var bodyObj=document.getElementById(obj+'_body');
	var imgObj = iconObj.src.split('images/');

	if(imgObj[1]=='down_aro.gif'){
		if(excol_temp!=''){
			excol_temp_iconObj=document.getElementById(excol_temp+'_ico')
			excol_temp_bodyObj=document.getElementById(excol_temp+'_body');
		
			excol_temp_iconObj.src='images/down_aro.gif';
			excol_temp_bodyObj.style.display='none';
		}
		iconObj.src='images/up_aro.gif';
		bodyObj.style.display='';
	}
	else{
		iconObj.src='images/down_aro.gif';
		bodyObj.style.display='none';
	}

	excol_temp=obj;
}

/*expend script*/

/*  Expand History Data */
function showdata(obj) {
		if(document.getElementById(obj).style.display=="") {
			document.getElementById(obj).style.display="none";
		}
		else {
			document.getElementById(obj).style.display="";
		}
}
/*  Expand History Data */

/* Show hide functionality */

function showhide(obj,img) {
	category = new Array('category1','category2');
	plus_min = new Array('pl_min1','pl_min2');
	for(i=0;i<category.length;i++) {
		if(obj==category[i]) {
			if(document.getElementById(category[i]).style.display=="") {
			document.getElementById(category[i]).style.display="none";
			document.getElementById(plus_min[i]).src="/images/plus.gif";
			}
			else {
			document.getElementById(category[i]).style.display="";
			document.getElementById(plus_min[i]).src="/images/minus.gif";
			}
		}
		else {
		document.getElementById(category[i]).style.display="none";
		document.getElementById(plus_min[i]).src="/images/plus.gif";}
	}
}

/*Resource bank Readmore Show hide*/
function showhide_rb(obj) {
	category = new Array('inno_dev','inno_seeker','inno_res');
	readmore = new Array('readmore1','readmore2','readmore3');
	for(i=0;i<category.length;i++) {
		if(obj==category[i]) {
			if(document.getElementById(category[i]).style.display=="") {
			document.getElementById(category[i]).style.display="none";
			document.getElementById(readmore[i]).style.display="";
			}
			else {
			document.getElementById(category[i]).style.display="";
			document.getElementById(readmore[i]).style.display="none";
			}
		}
		else {
		document.getElementById(category[i]).style.display="none";
		document.getElementById(readmore[i]).style.display="";
	}
}
}

/* Tool Tip */
//Variable Declaration
text1="Enter your question and we will mail the reply to your registered email id.";
text2="Separate each keyword with comma";
text3="Hold shift key to select multiple keywords. If you wish to add more, choose 'More...'";
text4="Please enter your question in the text box below. You have a word limit of 500 words. Do include enough background for the experts to understand your question, but please do not provide any confidential information (since questions are visible to the general public).";
text5="Please enter your valid Email address.";


//Show function
function showToolTip(e,text){
		if(document.all)e = event;
		var obj = document.getElementById('bubble_tooltip');
		var obj2 = document.getElementById('bubble_tooltip_content');
		obj2.innerHTML = text;
		obj.style.display = 'block';
		var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
		if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
		var leftPos = e.clientX+12;
		if(leftPos<0)leftPos = 0;
		obj.style.left = leftPos + 'px';
		obj.style.top = e.clientY-obj.offsetHeight+45+st+ 'px';
}
//Hide Function
function hideToolTip()
{
	document.getElementById('bubble_tooltip').style.display = 'none';
}


function showToolTip1(e,text){
		if(document.all)e = event;
		var obj = document.getElementById('bubble_tooltip1');
		var obj2 = document.getElementById('bubble_tooltip_content1');
		obj2.innerHTML = text;
		obj.style.display = 'block';
		var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
		if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
		var leftPos = e.clientX+12;
		if(leftPos<0)leftPos = 0;
		obj.style.left = leftPos + 'px';
		obj.style.top = e.clientY-obj.offsetHeight+65+st+ 'px';
}
//Hide Function
function hideToolTip1()
{
	document.getElementById('bubble_tooltip1').style.display = 'none';
}


/* Preloader*/

function MM_preloadImages() {
//v3.0
	var d=document;
	if(d.images) {
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0) {
			d.MM_p[j]=new Image;
			d.MM_p[j++].src=a[i];
		}
	}
}
