function back()
{
history.go(-1);

}
function ControlNotActive(id)
{
	if(document.getElementById(id.id).checked)
	{document.getElementById(id.id).checked=false;}
	else
	{document.getElementById(id.id).checked=true;}
	
}
function PrintTerms()
{
	self.print();
}
function OpenWindowToPrintProfile()
{
	window.open("InvestigatorProfile.aspx?print=1");
}
function ShowHideTerritory()
		{	
			if(document.getElementById('drpCountry').value == 226 || document.getElementById('drpCountry').value == 38)
			{
				
				

				if(document.getElementById('drpCountry').value == 226)
				{
					document.getElementById('drpTerritoryUSA').selectedIndex = 0;
					document.getElementById('trTerritoryUSA').style.display = '';
					document.getElementById('trTerritoryCanada').style.display = 'none';
					
				}
				else
				{
					document.getElementById('drpTerritoryCanada').selectedIndex = 0;
					document.getElementById('trTerritoryUSA').style.display = 'none';
					document.getElementById('trTerritoryCanada').style.display = '';
				}
				
				
				
				
			}
			else
			{
				if(document.getElementById('drpCountry').value == 0)
				{
				document.getElementById('trTerritoryUSA').style.display = 'none';
				document.getElementById('trTerritoryCanada').style.display = 'none';
				
				if(document.getElementById('drpCountry').value == 0 && document.getElementById('drpCountry').selectedIndex == 3)
				{
					document.getElementById('drpCountry').selectedIndex = 0;
				}
				}
				else
				{
				document.getElementById('trTerritoryUSA').style.display = 'none';
				document.getElementById('trTerritoryCanada').style.display = 'none';
				
				}
			}
			
		}

function ConfirmLogoutStep1(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			checkformed(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep2(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			validateform(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep3(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			chkcontrol(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep4(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			ValidateForm(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep5(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			validform(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep6(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			checkvalidnumericfield(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep7(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep8(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			CheckOther(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep9(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			SaveValidationRecruitmentInfo(e);
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}

function ConfirmLogoutStep10(e)
{
	if(confirm('Are you sure, you want to logout?'))
	{
		if(confirm('Do you want to save and then logout?'))
		{
			document.getElementById('hdnLogout').value = 1;
		}
		else
		{
			document.getElementById('hdnLogout').value = 2;
		}
	}
	else
	{
		noPostBack(e);
	}
}




function CheckAreaofInterest(drpobj,chkobj)
{
	
	//if(document.getElementById(chkobj.id).checked==true)
	//{
	//	document.getElementById(drpobj.id).style.display="";
//	}
	//else
	//{
	//	document.getElementById(drpobj.id).style.display="none";
	//}
	//if(document.getElementById('dgAreaofInterest__ctl8_chkAreaofInterest').checked==true)
	//	document.getElementById('TrOtherAreaofInterest').style.display="";
//	else
	//	document.getElementById('TrOtherAreaofInterest').style.display="none";

	//CheckAreaofInterestAll();
	
}
function CheckAreaofInterestAll()
{
	//var l=0;
//	for(i=0;i<20;i++)
//	{
	//	try
	//	{
	//	var id="dgAreaofInterest__ctl"+i+"_chkAreaofInterest";
	//		if(document.getElementById(id).checked==true)
	//		{
	//		l++;
	//		}
	//	}
	//	catch(err){}
	//}
	
	//if(l==0)
	//document.getElementById('dgAreaofInterest__ctl1_lblHeader').innerHTML="";
	//else
	//document.getElementById('dgAreaofInterest__ctl1_lblHeader').innerHTML="# of Trials";

}
		  
		  
function CheckTrailExperience(drpobj,chkobj)
{
	
	if(document.getElementById(chkobj.id).checked==true)
	{
		document.getElementById(drpobj.id).style.display="";
	}
	else
	{
		document.getElementById(drpobj.id).style.display="none";
	}	
	
	if(document.getElementById('grdTrialExperience__ctl15_chkTrials').checked==true)
		document.getElementById('trOther').style.display="";
	else
		document.getElementById('trOther').style.display="none";
	
	CheckTrailExperienceAll();
	
		
	
}
function CheckTrailExperienceAll()
{
	var l=0;
	for(i=0;i<20;i++)
	{
		try
		{
		var id="grdTrialExperience__ctl"+i+"_chkTrials";
			if(document.getElementById(id).checked==true)
			{
			l++;
			}
		}
		catch(err){}
	}
	
	if(l==0)
	document.getElementById('grdTrialExperience__ctl1_lblHeaderFirst').innerHTML="";
	else
	document.getElementById('grdTrialExperience__ctl1_lblHeaderFirst').innerHTML="# of Trials";

}
function functionDelete(e)
{
var answer =confirm("Do you want to delete this record?");
	if(answer)
	{
		
	}
	else
	{
		noPostBack(e);
		event.returnValue=false;
		
	}

}

function noPostBack(e)
{
	if(document.all)
	{
		event.returnValue = false;
	}
	else
	{
		e.preventDefault();
		event.returnValue = false;
	}

}

function unHideOffice(id)
{

	var i=0;
	strid='';
	
	if(id=='InvestigatorInfo')
	{
	strid='lblHead';
	document.getElementById('hdnInvestigatorInfo').value='1';
	}
	if(id=='OfficeClinic')
	{
	strid='lblOfficeName';
	document.getElementById('hdnOffice').value='1';
	}
	if(id=='FacilitiesInformation')
	{
	strid='lblFacilities';
	document.getElementById('hdnFacilities').value='1';
	}
	if(id=='ResearchExpirence')
	{
	strid='lblResearchExperience';
	document.getElementById('hdnResearchEx').value='1';
	}
	if(id=='ReserchInformation')
	{
	strid='lblReserchInformation';
	document.getElementById('hdnReserchInfo').value='1';
	}
	if(id=='RecruitInformation')
	{
	strid='lblRecruitInormation';
	document.getElementById('hdnRecruitInfo').value='1';
	}
	if(id=='PagePer')
	{
	strid='lblPagePer';
	document.getElementById('hdnPage').value='1';
	}	
	if(document.getElementById('InvestigatorInfo').style.display=='' && id=='InvestigatorInfo')
	{
	document.getElementById('InvestigatorInfo').style.display="none";
	document.getElementById('hdnInvestigatorInfo').value='';
	i=1;
	}
	
	if(document.getElementById('OfficeClinic').style.display=='' && id=='OfficeClinic')
	{
	document.getElementById('OfficeClinic').style.display="none";
	document.getElementById('hdnOffice').value='';
	i=1;
	}
	
	if(document.getElementById('FacilitiesInformation').style.display=='' && id=='FacilitiesInformation')
	{
	document.getElementById('FacilitiesInformation').style.display="none";
	document.getElementById('hdnFacilities').value='';
	i=1;
	}
	
	if((document.getElementById('ResearchExpirence').style.display=='') && (id=='ResearchExpirence'))
	{
	document.getElementById('ResearchExpirence').style.display="none";
	document.getElementById('hdnResearchEx').value='';
	i=1;
	}
	
	if((document.getElementById('ReserchInformation').style.display=='') && (id=='ReserchInformation'))
	{
	document.getElementById('ReserchInformation').style.display="none";
	document.getElementById('hdnReserchInfo').value='';
	i=1;
	}
	
	if( (document.getElementById('RecruitInformation').style.display=='') && (id=='RecruitInformation'))
	{
	document.getElementById('RecruitInformation').style.display="none";
	document.getElementById('hdnRecruitInfo').value='';
	i=1;
	}
	if((document.getElementById('PagePer').style.display=='') && (id=='PagePer'))
	{
	document.getElementById('PagePer').style.display="none";
	document.getElementById('hdnPage').value='';
	i=1;
	}
	
	if(i==0)
	{
	document.getElementById(strid).innerHTML=document.getElementById(strid).innerHTML.replace('+','-');
	document.getElementById(id).style.display="";
	}
	else
	{
	document.getElementById(strid).innerHTML=document.getElementById(strid).innerHTML.replace('-','+');
	}
}
function UnhideTrPSGStudies()
{
//alert(1);
		document.getElementById("TrStudies").style.display="";

}
function HideTrPSGStudies()
{
	//alert(1);
		document.getElementById("TrStudies").style.display="none";
	
}

function UnhideTrUploader()
{
//alert(1);
		document.getElementById("TrUploader").style.display="";

}
function HideTrUploader()
{
	//alert(1);
		document.getElementById("TrUploader").style.display="none";
	
}

function HideTrCertified()
{
	//alert(1);
		document.getElementById("trCertified").style.display="none";
	
}

function UnHideTrCertified()
{
	//alert(1);
		document.getElementById("trCertified").style.display="";
	
}


function Hide(id)
{
//alert(id);
		document.getElementById(id).style.display="none";
	
}
function UnHide(id)
{
		document.getElementById(id).style.display="";
}

/*Funcation By Pranay 13/11/2007*/

function iFrameHeight(height) 
{
	try
	{
		if (!document.all ) 
		{
		 window.parent.document.getElementById('iframeSub').style.height = height + 10 + 'px'; 
		//parent.document.body.scrollIntoView;
		//parent.frames["left].scrollTo(0,Top);
		 //window.parent.parent.document.body.scrollIntoView;
         //window.parent.document.body.scrollIntoView;
		//window.parent.parent.document.body.style.posTop;
		 //window.parent.parent.document.getElementById('iframeSub').style = scrollTop ;
		  window.parent.parent.document.anchors;
		 
		} 
		else if( document.all ) 
		{ 
		
		parent.document.all.iframeSub.style.height = height + 10 + 'px'; 
		//parent.frames["left].scrollTo(0,Top);
		//parent.document.body.scrollIntoView;
		//parent.parent.document.body.scrollIntoView;
		 //window.parent.parent.document.body.style.posTop;
		 //parent.parent.document.getElementById('iframeSub').style = scrollTop ;
		  window.parent.parent.document.anchors;
				 		
		} 
		//alert(window.parent.window.);
		window.parent.window.scroll(0,0);
		}
	catch(err)
	{}	
} 
function UnHideLeftNevLinks() 
{
	try
	{
		if (!document.all ) 
		{
			 window.parent.document.getElementById('tdSubLeftNev').style.display="";
		} 
		else if(document.all ) 
		{ 
			parent.document.all.tdSubLeftNev.style.display = ""; 
		} 

	}
	catch(err)
	{}	
} 
function HideLeftNevLinks() 
{
	try
	{
		if (!document.all ) 
		{
			 window.parent.document.getElementById('tdSubLeftNev').style.display="none";
		} 
		else if(document.all ) 
		{ 
			parent.document.all.tdSubLeftNev.style.display = "none"; 
		} 

	}
	catch(err)
	{}	
} 
function ShowSaveImage() 
{
try
{
		if (!document.all ) 
		{
		 window.parent.document.getElementById('divIframe').style.display = 'none'; 
		 window.parent.document.getElementById('DivPleaseWait').style.display = ''; 
		} 
		else if( document.all ) 
		{ 
		parent.document.all.divIframe.style.display = 'none'; 
		parent.document.all.DivPleaseWait.style.display = ''; 
		} 
}
catch(err){}
} 
function HideSaveImage() 
{
try
{
		if (!document.all ) 
		{
		 window.parent.document.getElementById('DivPleaseWait').style.display = 'none'; 
		 window.parent.document.getElementById('divIframe').style.display = ''; 
 
		} 
		else if( document.all ) 
		{ 
		
		parent.document.all.DivPleaseWait.style.display = 'none'; 
		parent.document.all.divIframe.style.display = ''; 
	
		} 
}
catch(err){}
} 

function iFrameHeightAssignParent(height) 
{
	
		if (!document.all ) 
		{
		 window.parent.document.getElementById('iframeSub').style.height = height + 10 + 'px'; 
		 try
		 {
		 document.getElementById("hdnInd").value=window.parent.document.getElementById("PhdnInd").value;
		 }
		 catch(err){}
		 window.parent.parent.document.anchors;
		} 
		else if( document.all ) 
		{ 
		parent.document.all.iframeSub.style.height = height + 10 + 'px'; 
		try
		{
		document.getElementById("hdnInd").value=parent.document.all.PhdnInd.value;
		}
		 catch(err){}
		window.parent.parent.document.anchors;
		} 
		if(document.getElementById("hdnInd").value=="1")
		{
		document.getElementById("lnkPassword").style.display='none';
		document.getElementById("LnkBtnForgotPassword").style.display='none';
		
		}
		window.parent.window.scroll(0,0);
		
} 




/**/
function iFrameHeightTest(height) 
{
		/*if (!document.all ) 
		{ 
		window.parent.document.getElementById('iframeSub').style.height = height + 10 + 'px'; 
		} 
		else if( document.all ) 
		{
	
		parent.document.all.iframeSub.style.height = height + 'px';
		
		} */
		window.scroll(0,0);
} 

function fnValidation(e)
			{//alert(1);
				var m1 =  parseInt(document.getElementById("ucdtStartDate_drpMonth").value);
				var d1 =  parseInt(document.getElementById("ucdtStartDate_drpDay").value);
				var y1 =  parseInt(document.getElementById("ucdtStartDate_drpYear").value);
				
				var m2 = parseInt(document.getElementById("ucdtEndDate_drpMonth").value);
				var d2 =  parseInt(document.getElementById("ucdtEndDate_drpDay").value);
				var y2 =  parseInt(document.getElementById("ucdtEndDate_drpYear").value);
				
				//document.getElementById("trError").style.display = "none";
				
				if (y2 < y1) 
				{
					alert("End Date can not be less than Start Date.");
					//document.getElementById("trError").style.display = "block";
					noPostBack(e);
					event.returnValue = false;
				}
				else
				{
					if (y2 == y1) 
					{
						if (m2 < m1)
						{
							alert("End Date can not be less than Start Date.");
							//document.getElementById("trError").style.display = "block";
							noPostBack(e);
							event.returnValue = false;
						}
						else
						{
							if (m2 == m1)
							{
								if (d2 < d1)
								{
									alert("End Date can not be less than Start Date.");
									noPostBack(e);
									//document.getElementById("trError").style.display = "block";
									event.returnValue = false;
								}
							}
						}
						
						
					}
					
				}

				
								
			}