// JavaScript Document

/* Varsha */

/* Disclaimer.asp astarts here */
/*function chkcountry()
		{
		
			if(document.frmtrustee.quickbar.options[document.frmtrustee.quickbar.selectedIndex].value=="100" && '<%=bond%>'!='')
				{
					
					window.open('<%=filepath%><%=bond%>')
				}
			else
				{
					document.location="accessdenied.asp"
				}
		}*/
		
function chkcountry(bond,filepath)
		{
		
			if(document.frmtrustee.quickbar.options[document.frmtrustee.quickbar.selectedIndex].value=="100" && bond!='')
				{
					
					window.open(filepath+bond)
				}
			else
				{
					document.location="accessdenied.asp"
				}
		}
/* Disclaimer.asp ends here */

/* index.asp starts here */

	function selPdf()
	{
	if(document.frmpdf.forms.value=='1')
	{
	window.open('pdf/kim.pdf','name','width=500, height=500,resizable=yes');


	}
	if(document.frmpdf.forms.value=='2')
	{
	window.open('pdf/SIPForm.pdf','name','width=500, height=500,resizable=yes');

	}
	if(document.frmpdf.forms.value=='3')
	{
	window.open('pdf/common_transaction_form.pdf','name','width=500, height=500,resizable=yes');

	}
	if(document.frmpdf.forms.value=='4')
	{
	window.open('pdf/ssip_common_transaction_form.pdf','name','width=500, height=500,resizable=yes');

	}
	if(document.frmpdf.forms.value=='5')
	{
	location.href='downloads/downloads.asp';

	}
	if(document.frmpdf.forms.value=='6')
	{
	location.href='downloads/downloads.asp';

	}
	}


	var ControlToSet;
	var theForm = document.frmNav;
	var CalWidth=170;
	var StartYear = "";
	var EndYear = "";
	var FormatAs;
	var NN4 = (navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? true : false;
	var NN6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;
	var TOP;
	var LEFT;

	if(NN4)document.captureEvents(Event.MOUSEMOVE);

	document.onmousemove = LogPosition;

	function LogPosition(evt){

	    if (NN4||NN6){
	    LEFT=evt.screenX;
	    TOP=evt.screenY-10;
	    }
	    else{
	    LEFT=event.screenX;
	    TOP=event.screenY-10;
	    }

	}

	function ShowCalendar(CONTROL,START_YEAR,END_YEAR,FORMAT){

	ControlToSet = eval(CONTROL);
	StartYear = START_YEAR;
	EndYear = END_YEAR;
	FormatAs = FORMAT;
	var strFeatures = "width=" + CalWidth + ",height=140" + ",left=" + LEFT + ",top=" + TOP;
	var CalWindow = window.open("/common/inc/HTMLCalendar.htm","Calendar", strFeatures)
	CalWindow.focus();
	} //End Function

	function SetDate(DATE){
	if(ControlToSet){
	ControlToSet.value = DATE;
	}
	ControlToSet = null;
	StartYear = null;
	EndYear = null;
	FormatAs = null;
	}
function SubmitForms(formtype,divid)
{
	var targeturl;
	if (formtype=='Contactus')
		{
			targeturl = "contact_us/submitcallme.asp?"
			targeturl = targeturl + "txtName="+document.frmCallMe.txtName.value
			targeturl = targeturl + "&txtCode="+document.frmCallMe.txtCode.value
			targeturl = targeturl + "&txtPhone="+document.frmCallMe.txtPhone.value
			targeturl = targeturl + "&txtEmail="+document.frmCallMe.txtEmail.value
			targeturl = targeturl + "&txtCity="+document.frmCallMe.txtCity.value
			targeturl = targeturl + "&cmbFund="+document.frmCallMe.cmbFund.value
		}
	//alert(targeturl)
	var xmlHttp;
    try
    	{

			xmlHttp=new XMLHttpRequest();
		}
	catch (e)
    	{
		try
      		{

			  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    	}
	    catch (e)
    	  {
			  try
        		{

				 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				  }
		      catch (e)
        		{

					alert("Your browser does not support AJAX!");
					return false;
				 }
		  }
     }
		xmlHttp.onreadystatechange=function()
		  {

		  if(xmlHttp.readyState==4)
			{
				var ajxResult = document.getElementById(divid);
			 	ajxResult.innerHTML = xmlHttp.responseText
         		document.getElementById(divid).style.display="block";
			}
		  }

    xmlHttp.open("GET",targeturl,true);
    xmlHttp.send(null);
}

function charonly(e)
	{
		var unicode=e.charCode? e.charCode : e.keyCode
		if (unicode!=8)
			{
				if ((unicode!=32 && (unicode<65 || (unicode>90 && (unicode<97 || unicode>122)))) && unicode!=39 && unicode!=45&& unicode!=9)
				return false
			}
	}

//Catch Characters & Special Character Keys.....
function numbersonly(e)
	{
		var unicode=e.charCode? e.charCode : e.keyCode
		if (unicode!=8)
			{
				if ((unicode<48||unicode>57)&& unicode!=9)
				return false
			}
	}

function chkfrmCallMe()
{
	if (trimAll(document.frmCallMe.txtName.value)=="Name")
		{
			alert("Please enter your Name.");
			document.frmCallMe.txtName.focus();
			document.frmCallMe.txtName.select();
			return false;
		}
	if (document.frmCallMe.txtName.value.charAt(0)==" ")
		{
			alert("Please enter valid Name.");
			document.frmCallMe.txtName.focus();
			document.frmCallMe.txtName.select();
			return false;
		}

	if (trimAll(document.frmCallMe.txtPhone.value)=="Phone No.")
		{
			alert("Please enter your Phone No.");
			document.frmCallMe.txtPhone.focus();
			document.frmCallMe.txtPhone.select();
			return false;
		}

	if (trimAll(document.frmCallMe.txtEmail.value)=="Email Id")
		{
			alert("Please enter your Email Id.");
			document.frmCallMe.txtEmail.focus();
			document.frmCallMe.txtEmail.select();
			return false;
		}

	if (trimAll(document.frmCallMe.txtEmail.value)!="Email Id" && !echeck(document.frmCallMe.txtEmail.value))
		{
			alert("Please enter a Valid Email Address.");
			document.frmCallMe.txtEmail.focus();
			document.frmCallMe.txtEmail.select();
			return false;
		}
	if (trimAll(document.frmCallMe.txtCity.value)=="City")
		{
			alert("Please enter your City");
			document.frmCallMe.txtCity.focus();
			document.frmCallMe.txtCity.select();
			return false;
		}
	if (document.frmCallMe.txtCity.value.charAt(0)==" ")
		{
			alert("Please enter valid City.");
			document.frmCallMe.txtCity.focus();
			document.frmCallMe.txtCity.select();
			return false;
		}
	if (document.frmCallMe.cmbFund.options[document.frmCallMe.cmbFund.selectedIndex].value=="0")
		{
			alert("Please select a Fund.");
			document.frmCallMe.cmbFund.focus();
			return false;
		}
	SubmitForms('Contactus','contact_content')
}

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){
		return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		{
			return false
		}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		{
			return false
		}

	if (str.indexOf(at,(lat+1))!=-1)
		{
			return false
		}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		{
			return false
		}

	if (str.indexOf(dot,(lat+2))==-1)
		{
			return false
		}

	if (str.indexOf(" ")!=-1)
		{
			return false
		}
	return true
}

function trimAll( strValue )
	{
		var objRegExp = /^(\s*)$/;
		if(objRegExp.test(strValue)) {
		strValue = strValue.replace(objRegExp, '');
		if( strValue.length == 0)
		return strValue;
	}
	objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
	if(objRegExp.test(strValue))
		{
			//remove leading and trailing whitespace characters
			strValue = strValue.replace(objRegExp, '$2');
		}
	return strValue;
}
function chkfrmNav()
{
	if ((document.frmNav.cmbFund.options[document.frmNav.cmbFund.selectedIndex].value=="") && (document.frmNav.cmbFundFMP.options[document.frmNav.cmbFundFMP.selectedIndex].value==""))
		{
			alert("Please select a Fund.");
			document.frmNav.cmbFund.focus();
			return false;
		}

			if (document.frmNav.cmbFund.options[document.frmNav.cmbFund.selectedIndex].value!="" && document.frmNav.cmbFundFMP.options[document.frmNav.cmbFundFMP.selectedIndex].value!="")
		{
			alert("Please select  only one Fund.");
			document.frmNav.cmbFund.focus();
			return false;
		}

	if (document.frmNav.txtFromDate.value=="From")
		{
			alert("Please select a Valid From Date.");
			document.frmNav.txtFromDate.focus();
			document.frmNav.txtFromDate.select();
			return false;
		}
	if (document.frmNav.txtToDate.value=="To")
		{
			alert("Please select a Valid To Date.");
			document.frmNav.txtToDate.focus();
			document.frmNav.txtToDate.select();
			return false;
		}
	//document.frmNav.method="post";
	document.frmNav.action="navs/navs-final.asp";
	document.frmNav.submit();
}


function tabs(tab_name)
{
	if(tab_name=="contact_click")
		{

			document.getElementById("contact").className="selected11";
			document.getElementById("returns").className="";
			document.getElementById("nav1").className="";
			document.getElementById("contact_content").style.display="block";
			document.getElementById("returns_content").style.display="none";
			document.getElementById("nav1_content").style.display="none";

		}
		/*else {
		document.getElementById("contact").className="selected11";
			document.getElementById("returns").className="";
			document.getElementById("nav").className="";
			document.getElementById("contact_content").style.display="block";
			document.getElementById("returns_content").style.display="none";
			document.getElementById("nav1_content").style.display="none";
		}*/
	else if(tab_name=="returns_click")
		{

			document.getElementById("contact").className="nav_bg";
			document.getElementById("returns").className="selected11";
			document.getElementById("nav1").className="";
			document.getElementById("contact_content").style.display="none";
			document.getElementById("returns_content").style.display="block";
			document.getElementById("nav1_content").style.display="none";


		}
		/*else {
		document.getElementById("contact").className="selected11";
			document.getElementById("returns").className="";
			document.getElementById("nav").className="";
			document.getElementById("contact_content").style.display="block";
			document.getElementById("returns_content").style.display="none";
			document.getElementById("nav1_content").style.display="none";
		}*/
	else if (tab_name=="nav1_click")
		{

			document.getElementById("contact").className="nav_bg";
			document.getElementById("returns").className="";
			document.getElementById("nav1").className="selected11";
			document.getElementById("contact_content").style.display="none";
			document.getElementById("returns_content").style.display="none";
			document.getElementById("nav1_content").style.display="block";

		}
		else {
		document.getElementById("contact").className="nav_bg";
			document.getElementById("returns").className="";
			document.getElementById("nav1").className="";
			document.getElementById("contact_content").style.display="none";
			document.getElementById("returns_content").style.display="none";
			document.getElementById("nav1_content").style.display="none";
		}

	/*	else
		{
			document.getElementById("contact").className="selected11";
			document.getElementById("returns").className="";
			document.getElementById("nav1").className="";
			document.getElementById("contact_content").style.display="block";
			document.getElementById("returns_content").style.display="none";
			document.getElementById("nav1_content").style.display="none";

		}*/
	}

	function tabs2(tab_name)
{
	if(tab_name=="bse_click")
		{

			document.getElementById("bse").className="selected2";
			document.getElementById("nse").className="";
			document.getElementById("bse_content").style.display="block";
			document.getElementById("nse_content").style.display="none";

		}
	else if(tab_name=="nse_click")
		{

			document.getElementById("bse").className="";
			document.getElementById("nse").className="selected2";
			document.getElementById("bse_content").style.display="none";
			document.getElementById("nse_content").style.display="block";


		}

	}

	function calculator(ths)
	{
		location.href=ths;
	}



function goToNriAcc()
{
	document.location="/applications/misc/bannercounter/bannercounter_2008.asp?banname=shoskele_nri_nov08"
}

window.onload = function(){
tabs('returns_click');
}




/*  index.asp ends here */

