Thursday, April 18, 2013

sensex and nifty

The Sensex is an "index". What is an index? An index is basically an indicator. It gives you a general idea about whether most of the stocks have gone up or most of the stocks have gone down.

The Sensex is an indicator of all the major companies of the BSE.

The Nifty is an indicator of all the major companies of the NSE.

If the Sensex goes up, it means that the prices of the stocks of most of the major companies on the BSE have gone up. If the Sensex goes down, this tells you that the stock price of most of the major stocks on the BSE have gone down.

Just like the Sensex represents the top stocks of the BSE, the Nifty represents the top stocks of the NSE.

Just in case you are confused, the BSE, is the Bombay Stock Exchange and the NSE is the National Stock Exchange. The BSE is situated at Bombay and the NSE is situated at Delhi. These are the major stock exchanges in the country. There are other stock exchanges like the Calcutta Stock Exchange etc. but they are not as popular as the BSE and the NSE.Most of the stock trading in the country is done though the BSE & the NSE.

Besides Sensex and the Nifty there are many other indexes. There is an index that gives you an idea about whether the mid-cap stocks go up and down. This is called the ?BSE Mid-cap Index?. There are many other types of indexes.

There is an index for the metal stocks. There is an index for the FMCG stocks. There is an index for the automobile stocks etc.

Wednesday, January 30, 2013

function ConfirmSubmit()
{

if (confirm('Are you sure,you wanted to Submit the Application.'))
{
return true;
}
else
{
return false;
}


}

function CheckChar()
{
var key = window.event.keyCode;
if (!((key >= 97 && key <= 122) || (key >= 65 && key <= 90)|| key==32))
{
alert(
'Enter only characters');
return false;
}
}
function GetSubject()
{
if(document.getElementById('ddlPost').selectedIndex==0)
{
alert(
'Select Post');
return false;
}
}
function checkspace()
{
var a = window.event.keyCode
if (a == 32)
{
//alert('Plese Enter either Character or Number.'); && (keyChar!=45)
return false;
}
else
var key = window.event.keyCode;

if (!((key >= 97 && key <= 122) || (key >= 65 && key <= 90)|| key==32))
{
alert(
'Enter only characters');
return false;
}
}

function intcheck()
{
var keyChar = window.event.keyCode;

if (keyChar<46 keychar="">57 || keyChar==47 )
{
alert(
'You can enter only numeric Value.');
return false;
}
}

function checkNum()
{
var keyChar = window.event.keyCode;

if (keyChar<48 keychar="">57)

{
alert(
'You can enter only numeric Value.');
return false;
}
}


function check()
{
if(document.getElementById('ddlPost').selectedIndex==0)
{
alert(
'Select Post');
return false;
}

/*if(document.getElementById('ddlSubject').selectedIndex==0)
{
alert('Select Subject');
return false;
}*/


if (document.getElementById('txtfname').value=='')
{
alert(
'Enter First Name');
return false;
}

if (document.getElementById('txtGname').value=='')
{
alert(
'Enter Father Name');
return false;
}

if (document.getElementById('txtCAddess').value=='')
{
alert(
'Enter Address');
return false;
}

if (document.getElementById('txtPinCode').value=='')
{
alert(
'Enter Pincode');
return false;
}

if ((document.getElementById('txtlandline').value=='' && document.getElementById('txtmobile').value==''))
{
alert(
'Enter contact No. Landline/Mobile No.');
return false;
}

if(document.getElementById('ddlState').selectedIndex==0)
{
alert(
'Select State');
return false;
}

if (document.getElementById('txtDob').value=='')
{
alert(
'Enter Date of Birth');
return false;
}

if(document.getElementById('ddlGender').selectedIndex==0)
{
alert(
'Select Gender');
return false;
}

if(document.getElementById('ddl_Category').selectedIndex==0)
{
alert(
'Select Category');
return false;
}

/* if((document.getElementById('ddlDist1').selectedIndex==0) && (document.getElementById('ddlDist2').selectedIndex==0) && (document.getElementById('ddlDist3').selectedIndex==0))
{
alert('Select Any District');
return false;
}
else
{
var ind = parseInt(document.getElementById('ddlDist1').selectedIndex);
if ((ind==document.getElementById('ddlDist2').selectedIndex) || (ind==document.getElementById('ddlDist3').selectedIndex))
{
alert('Select Different Districts in Choices');
return false;
}
}*/

/*if (document.getElementById('txtAppDate').value=='')
{
alert('Enter Application Date');
return false;
}*/

}

function CheckGender()
{
var hiddenval;
hiddenval=parseInt(document.getElementById('txthidden').value);
if (hiddenval==0)
{
if(document.getElementById('ddlGender').selectedIndex==0)
{
alert(
'Select Gender');
return false;
}

if(document.getElementById('ddl_Category').selectedIndex==0)
{
alert(
'Select Category.');
return false;
}

/*else
{
document.getElementById('txthidden').value=1;
return true;
}*/
}
else if (hiddenval>0)
{
return true
}
}


function DateDiff()
{

if(document.getElementById('txtDob').value!='' && document.getElementById('ddlPost').selectedIndex!==0)
{
var t1 = document.getElementById('txtDob').value;
var w = document.getElementById('ddlPost').selectedIndex;
var selected_text = document.getElementById('ddlPost').options[w].text;
var iLen = 1;
//var iLen = String(selected_text).length;
var Post = String(selected_text).substring(0,iLen);
var t2='31/01/2013';
//var t2='21/11/2011';
//Here we need to split the inputed dates to convert them into standard format for furter execution

var x=t1.split('/');
var y=t2.split('/');
var d,m,y;
//Split Post


//var P= selected_text.split(' ');
//alert('post='+P+');
//calculating Days
if (x[0]==y[0])
{
d=0;
}
else if(x[0] > y[0])
{
y[1]=parseInt(y[1])-1;
y[0]=parseInt(y[0])+30;
d=y[0]-x[0];
}
else
{
d=y[0]-x[0];
}


//calculating Month
if (x[1]==y[1])
{
m=0;
}
else if(x[1] > y[1])
{
y[2]=parseInt(y[2])-1;
var dd=parseInt(y[1]);
dd=dd+12;
y[1]=parseInt(y[1])+12;
m=y[1]-x[1];
}
else
{
m=y[1]-x[1];
}


//calculating year
if (x[2]==y[2])
{
y=0;
}
else if(x[2] > y[2])
{
alert(
'Enter Correct year Of Dob');
return false;
}
else
{
y=y[2]-x[2];
}

// General and Male and Physically Disabled
if(Post=='T' && document.forms[0].item('Rdb_Phy')[0].checked && document.getElementById('ddlGender').selectedIndex==1 && document.getElementById('ddl_Category').selectedIndex==1)
{
if (y>40)
{
alert (
'Upper age limit for the TGT (General Physically handicapped Male) is 40 years');
BlankAgeText();
return false;
}
else if (y==40 && d >0 )
{
alert (
'Upper age limit for the TGT (General Physically handicapped Male) is 40 years');
BlankAgeText();
return false;
}
else if (y==40 && m >0 )
{
alert (
'Upper age limit for the TGT (General Physically handicapped Male) is 40 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}

// General and Male and not Physically Disabled
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[1].checked && document.getElementById('ddlGender').selectedIndex==1 && document.getElementById('ddl_Category').selectedIndex==1)
{

if (y>30)
{
alert (
'Upper age limit for the TGT (General Male) is 30 years');
BlankAgeText();
return false;
}
else if (y==30 && d >0 )
{
alert (
'Upper age limit for the TGT (General Male) is 30 years');
BlankAgeText();
return false;
}
else if (y==30 && m >0 )
{
alert (
'Upper age limit for the TGT (General Male) is 30 years');
BlankAgeText();
return false;
}

else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}

//For male TGT and SC/ST and PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[0].checked && document.getElementById('ddlGender').selectedIndex==1 && ((document.getElementById('ddl_Category').selectedIndex==2) || (document.getElementById('ddl_Category').selectedIndex==3)))
{

if (y>45)
{
alert (
'Upper age limit for the TGT (Physically handicapped SC/ST Male) is 45 years');
BlankAgeText();
return false;
}
else if (y==45 && d >0 )
{
alert (
'Upper age limit for the TGT (Physically handicapped SC/ST Male) is 45 years');
BlankAgeText();
return false;
}
else if (y==45 && m >0 )
{
alert (
'Upper age limit for the TGT (Physically handicapped SC/ST Male) is 45 years');
BlankAgeText();
return false;
}

else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}

//For male TGT and SC/ST and not PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[1].checked && document.getElementById('ddlGender').selectedIndex==1 && ((document.getElementById('ddl_Category').selectedIndex==2) || (document.getElementById('ddl_Category').selectedIndex==3)))
{

if (y>35)
{
alert (
'Upper age limit for the TGT (SC/ST Male) is 35 years');
BlankAgeText();
return false;
}
else if (y==35 && d >0 )
{
alert (
'Upper age limit for the TGT (SC/ST Male) is 35 years');
BlankAgeText();
return false;
}
else if (y==35 && m >0 )
{
alert (
'Upper age limit for the TGT (SC/ST Male) is 35 years');
BlankAgeText();
return false;
}

else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}

//Male and OBC and PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[0].checked && document.getElementById('ddlGender').selectedIndex==1 && document.getElementById('ddl_Category').selectedIndex==4)
{

if (y>43)
{
alert (
'Upper age limit for the TGT (Physically handicapped OBC Male) is 43 years');
BlankAgeText();
return false;
}
else if (y==43 && d >0 )
{
alert (
'Upper age limit for the TGT (Physically handicapped OBC Male) is 43 years');
BlankAgeText();
return false;
}
else if (y==43 && m >0 )
{
alert (
'Upper age limit for the TGT (Physically handicapped OBC Male) is 43 years');
BlankAgeText();
return false;
}

else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}

}

//For TGT and OBC and not PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[1].checked && document.getElementById('ddlGender').selectedIndex==1 && document.getElementById('ddl_Category').selectedIndex==4)
{

if (y>33)
{
alert (
'Upper age limit for the TGT (OBC Male) is 33 years');
BlankAgeText();
return false;
}
else if (y==33 && d >0 )
{
alert (
'Upper age limit for the TGT (OBC Male) is 33 years');
BlankAgeText();
return false;
}
else if (y==33 && m >0 )
{
alert (
'Upper age limit for the TGT (OBC Male) is 33 years');
BlankAgeText();
return false;
}

else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}

}


//TGT Female and general and PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[0].checked && document.getElementById('ddlGender').selectedIndex==2 && document.getElementById('ddl_Category').selectedIndex==1)
{
if (y > 50)
{
alert(
'Upper age limit for the TGT (General Physically handicapped Female) is 50 years');
BlankAgeText();
return false;
}

else if (y==50 && d >0 )
{
alert(
'Upper age limit for the TGT (General Physically handicapped Female) is 50 years');
BlankAgeText();
return false;
}
else if (y==50 && m >0 )
{
alert(
'Upper age limit for the TGT (General Physically handicapped Female) is 50 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}

//Check for TGT Female general and not PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[1].checked && document.getElementById('ddlGender').selectedIndex==2 && document.getElementById('ddl_Category').selectedIndex==1)
{
if (y > 40)
{
alert(
'Upper age limit for the TGT (General Female) is 40 years');
BlankAgeText();
return false;
}

else if (y==40 && d >0 )
{
alert(
'Upper age limit for the TGT (General Female) is 40 years');
BlankAgeText();
return false;
}
else if (y==40 && m >0 )
{
alert(
'Upper age limit for the TGT (General Female) is 40 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}


//TGT Female and SC/ST and PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[0].checked && document.getElementById('ddlGender').selectedIndex==2 && ((document.getElementById('ddl_Category').selectedIndex==2) || (document.getElementById('ddl_Category').selectedIndex==3)))
{
if (y > 55)
{
alert(
'Upper age limit for the TGT (Physically handicapped SC/ST Female) is 55 years');
BlankAgeText();
return false;
}

else if (y==55 && d >0 )
{
alert(
'Upper age limit for the TGT (Physically handicapped SC/ST Female) is 55 years');
BlankAgeText();
return false;
}
else if (y==55 && m >0 )
{
alert(
'Upper age limit for the TGT (Physically handicapped SC/ST Female) is 55 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}


//Check for TGT Female SC/ST and not PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[1].checked && document.getElementById('ddlGender').selectedIndex==2 && ((document.getElementById('ddl_Category').selectedIndex==2) || (document.getElementById('ddl_Category').selectedIndex==3)))
{
if (y > 45)
{
alert(
'Upper age limit for the TGT (SC/ST Female) is 45 years');
BlankAgeText();
return false;
}

else if (y==45 && d >0 )
{
alert(
'Upper age limit for the TGT (SC/ST Female) is 45 years');
BlankAgeText();
return false;
}
else if (y==45 && m >0 )
{
alert(
'Upper age limit for the TGT (SC/ST Female) is 45 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}



//Check for TGT Female and OBC and PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[0].checked && document.getElementById('ddlGender').selectedIndex==2 && document.getElementById('ddl_Category').selectedIndex==4)
{
if (y > 53)
{
alert(
'Upper age limit for the TGT (Physically handicapped OBC Female) is 53 years');
BlankAgeText();
return false;
}

else if (y==53 && d >0 )
{
alert(
'Upper age limit for the TGT (Physically handicapped OBC Female) is 53 years');
BlankAgeText();
return false;
}
else if (y==53 && m >0 )
{
alert(
'Upper age limit for the TGT (Physically handicapped OBC Female) is 53 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}

//Check for TGT Female and OBC and not PH
else if(Post=='T' && document.forms[0].item('Rdb_Phy')[1].checked && document.getElementById('ddlGender').selectedIndex==2 && document.getElementById('ddl_Category').selectedIndex==4)
{
if (y > 43)
{
alert(
'Upper age limit for the TGT (OBC Female) is 43 years');
BlankAgeText();
return false;
}

else if (y==43 && d >0 )
{
alert(
'Upper age limit for the TGT (OBC Female) is 43 years');
BlankAgeText();
return false;
}
else if (y==43 && m >0 )
{
alert(
'Upper age limit for the TGT (OBC Female) is 43 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}

//PGT
else if(Post=='L' && document.getElementById('ddlGender').selectedIndex==1 )
{

if (y>36)
{
alert(
'Upper age limit for the PGT (Male) is 36 years');
BlankAgeText();
return false;
}
else if (y==36 && d >0 )
{
alert(
'Upper age limit for the PGT (Male) is 36 years');
BlankAgeText();
return false;
}
else if (y==36 && m >0 )
{
alert(
'Upper age limit for the PGT (Male) is 36 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}
//Check for PGT Female

else if(Post=='L' && document.getElementById('ddlGender').selectedIndex==2 )
{

if (y>36)
{
alert(
'Upper age limit for the PGT (Female) is 36 years');
BlankAgeText();
return false;
}
else if (y==36 && d >0 )
{
alert(
'Upper age limit for the PGT (Female) is 36 years');
BlankAgeText();
return false;
}
else if (y==36 && m >0 )
{
alert(
'Upper age limit for the PGT (Female) is 36 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}
else if(Post=='R')
{

if (y>45)
{
alert(
'Upper age limit for Resource Persons is 45 years');
BlankAgeText();
return false;
}
else if (y==45 && d >0 )
{
alert(
'Upper age limit for Resource Persons is 45 years');
BlankAgeText();
return false;
}
else if (y==45 && m >0 )
{
alert(
'Upper age limit for Resource Persons is 45 years');
BlankAgeText();
return false;
}
else
{
document.getElementById(
'txtAsOnDay').value=d;
document.getElementById('txtAsOnMonth').value=m;
document.getElementById('txtAsOnYear').value=y;
}
}


}
}

function BlankAgeText()
{

document.getElementById(
'txtAsOnDay').value='';
document.getElementById('txtAsOnMonth').value='';
document.getElementById('txtAsOnYear').value='';
document.getElementById('txtDob').value='';
return false;
}

function CheckAdd()
{

if (document.getElementById('ddlExam').selectedIndex == 0)
{
alert(
'Select Examination Passed');
return false;
}

if (document.getElementById('txtBoard').value == '')
{
alert(
'Enter Name of Board/University');
return false;
}

if (document.getElementById('txtDuration').value == '')
{
alert(
'Enter duration in years');
return false;
}


if (document.getElementById('ddlMonth').selectedIndex == 0)
{
alert(
'Select Month of Passing');
return false;
}


if (document.getElementById('txtYear').value == '')
{
alert(
'Enter Year');
return false;
}
else
{
var l=parseInt(document.getElementById('txtYear').value.length);
if (l <4 font="">
{
alert(
'Enter 4 digits Year');
document.getElementById('txtYear').value = '';
return false;
}
if (document.getElementById('txtYear').value > 2012 )
{
alert(
'Enter Correct Year of Passing');
//document.getElementById('txtYear').value = '';
return false;
}

}


if (document.getElementById('txtPercentage').value == '')
{
alert(
'Enter Percentage');
return false;
}


var text = document.getElementById("ddlExam").options[document.getElementById("ddlExam").selectedIndex].text;


if (text =='CTET')
{

if (document.getElementById('txtPercentage').value > 150)
{
alert(
'Percentage should not be greater than 150% ');
return false;
}
}

else
{
if (document.getElementById('txtPercentage').value > 100)
{
alert(
'Percentage should not be greater than 100% ');
return false;
}

}







/*
if(!(document.Form1('rbtnResult')[0].checked) && !(document.Form1('rbtnResult')[1].checked) && !(document.Form1('rbtnResult')[2].checked))
{
alert('Select Result Status');
return false;
}
else
{
if(document.Form1('rbtnResult')[2].checked)
{
if (document.getElementById('txtPercentage').value == '')
{
alert('Enter Percentage');
return false;
}

}

}*/

/*if(document.Forms[0].item('rbtnResult')[0].checked==false)
{
alert('Select Result Status');
return false;
}
else
{
if(document.Forms[0].item('rbtnResult')[0].checked==true)
{
if (document.getElementById('txtPercentage').value == '')
{
alert('Enter Percentage');
return false;
}
if (document.getElementById('txtPercentage').value > 100)
{
alert('Percentage should not be greater than 100% ');
return false;
}
}
}*/

if ((document.getElementById('ddlExam').selectedIndex == 1) || (document.getElementById('ddlExam').selectedIndex == 2))
{

}
else
{

var list=document.forms[0].item('ddlEduSubject');
var i=0
var h=0
for(i=0;i<=list.options.length-1;i++)
{
if ((list.options[i].selected)== true)
{
h=h+1;
}

}

if (h==0)
{
alert(
'Select Subject(s)');
return false;
}
}
/*
var ch =document.forms[0].item('ddlExam');
var cn= parseInt(ch.SelectedIndex);
alert(cn);
if (ch==1 ||ch==2)
{
alert('first or second');
}
else
{
var list=document.forms[0].item('ddlEduSubject');
var i=0
var h=0
for(i=0;i<=list.options.length-1;i++)
{
if ((list.options[i].selected)== true)
{
h=h+1;
}

}

if (h=0)
{
alert('Select Subjects');
return false;

}


}*///else closing


}

function checkforGraduation()
{
var list=document.forms[0].item('ddlEduSubject');
var i=0
var h=0
for(i=0;i<=list.options.length-1;i++)
{
if ((list.options[i].selected)== true)
{
h=h+1
//Asst. Teacher case
if(document.getElementById('ddlPost').selectedIndex==3)
{
if (h>5)
{
alert(
'you can not select more then five Subjects for Asst.Teacher');
list.options[i].selected= false;
return false;
break;
}

}
else
{
if (h>3)
{
alert(
'you can not select more then three Subjects');
list.options[i].selected= false;
return false;
break;
}
}
}
}
}

function Check1()
{
if(document.getElementById('txtOrganization').value=='')
{
alert(
'Enter Oraganization Name');
return false;
}

/*if (document.getElementById('ddlServicePost').SelectedIndex == 0)
{
alert('Select Post of Service');
return false;
}*/
if (document.getElementById('txtservicepost').value=='')
{
alert(
'Enter Post of Service');
return false;
}

if (document.getElementById('txtWorkFrom').value=='')
{
alert(
'Enter Service From');
return false;
}

if (document.getElementById('txtWorkTo').value=='')
{
alert(
'Enter Service To');
return false;
}


}

function totExp()
{

var t1=document.getElementById('txtWorkFrom').value;
var t2=document.getElementById('txtWorkTo').value;

var x=t1.split('/');
var y=t2.split('/') ;
var datediff=x[1] +'/'+x[0]+'/'+x[2];
var datediff1=y[1] +'/'+y[0]+'/'+y[2];


if (Date.parse(datediff) >Date.parse(datediff1))
{
alert(
'Service From Date should be smaller then Service To Date');
document.getElementById('txtWorkFrom').value='';
document.getElementById('txtWorkTo').value='';
return false;
}
else
{
/*
var diff=parseInt(y[2])-parseInt(x[2]);
if (diff==0)
{
var diff1=parseInt(y[1])-parseInt(x[1]);
diff1=String(diff1/12);
//alert(diff1);
diff1=diff1.substring(0,3);
document.getElementById('txtTotExp').value=diff1;
}
else
{
document.getElementById('txtTotExp').value=diff;
return true;
}
*/

var d,m,y;

//calculating Days
if (x[0]==y[0])
{
d=0;
}
else if(x[0] > y[0])
{
y[1]=parseInt(y[1])-1;
y[0]=parseInt(y[0])+30;
d=y[0]-x[0];
}
else
{
d=y[0]-x[0];
}


//calculating Month
if (x[1]==y[1])
{
m=0;
}
else if(x[1] > y[1])
{
y[2]=parseInt(y[2])-1;
var dd=parseInt(y[1]);
dd=dd+12;
y[1]=parseInt(y[1])+12;
m=y[1]-x[1];
}
else
{
m=y[1]-x[1];
}

//Added on 28-7-2011

if ((y[1]==1) || (y[1]==3) || (y[1]==5) || (y[1]==7) || (y[1]==8) || (y[1]==10) || (y[1]==12))
{
if (d==30)
{
m=m+1;
}
}
else if((y[1]==3) || (y[1]==6) || (y[1]==9) || (y[1]==11))
{
if (d==29)
{
m=m+1;
}
}
else
{
var leap;
leap = IsLeapYear(y[2]);
if (leap==true)
{
if (d==28)
{
m=m+1;
}
}
else
{
if (d==27)
{
m=m+1;
}
}
}


//calculating year
if (x[2]==y[2])
{
y=0;
}

else
{
y=y[2]-x[2];
}

// if no year remains
if(y==0)
{
// if days are greater or equal to 30 than add 1 to month
// other wise just devide the month value to 12 to get the period in year

/*
var diff1=String(m/12);
diff1=diff1.substring(0,3);
document.getElementById('txtTotExp').value=diff1;
*/

var diff1;
diff1='0.' + m;
document.getElementById('txtTotExp').value=diff1;
}

// year is greater than 0
else
{
var diff1;
diff1=y +'.'+ m;
document.getElementById('txtTotExp').value=diff1;
}

}

}

function IsLeapYear(year)
{
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}


function PassPer()
{

if(document.getElementById('txtPercentage').value=='')
{
alert(
'Enter pass percentage')
return false;
}
else
{
var t1=document.getElementById('txtPercentage').value;
t1= Math.round(t1);
document.getElementById(
'txtPercentage').value=t1;
return true;
}

}