0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 13.58.32.115


Current Path : /var/www/html/cuk/orms_wait/js_old/
Upload File :
Current File : //var/www/html/cuk/orms_wait/js_old/homecopy.js

var urlarr = window.location.pathname.split('/');
var $url="http://"+window.location.host+"/";
var $hoststr = '';
for(var j=1;j<urlarr.length-1;j++)
{
	$hoststr += window.location.pathname.split('/')[j]+"/"; 
}	
$host_url = $url+$hoststr+"app.php?a=";
$image_path = $url+$hoststr+"jqGrid3.5/cmes/tarka/images/";


function loadhomedropdown() 
{
	$("#TDISABILITY").hide();
	$("#PDISABILITY").hide();
	$.ajax({
	type: "POST",
	async:false,
	url:$host_url+'getdropdown', 
	success: function getcatcoderesponce(responce)
	{
		responce = eval('(' + responce + ')');
		document.getElementById("S3").options.length = 0;		
		var catcode =responce.data['catcode'];			
		$op = new Option("Select Category","#");
		$op.id=0;//specifying the id  for options
		document.getElementById("S3").options.add($op)
		for($i=0;$i < catcode.length;$i++)                                  
		{            
			$op = new Option(catcode[$i]['value'], catcode[$i]['internal_code']);
			$op.id=catcode[$i]['internal_code'];//specifying the id  for options
			document.getElementById("S3").options.add($op);
		}	
		
		document.getElementById("TBA42").options.length = 0;		
		var ugcode =responce.data['UG'];			
		$op = new Option("Select Bachelor’s degree","#");
		$op.id=0;//specifying the id  for options
		document.getElementById("TBA42").options.add($op)
		for($i=0;$i < ugcode.length;$i++)                                  
		{            
			$op = new Option(ugcode[$i]['value'], ugcode[$i]['internal_code']);
			$op.id=ugcode[$i]['internal_code'];//specifying the id  for options
			document.getElementById("TBA42").options.add($op);
		}
		
		document.getElementById("T49").options.length = 0;		
		var pgcode =responce.data['PG'];			
		$op = new Option("Select Master's degree","#");
		$op.id=0;//specifying the id  for options
		document.getElementById("T49").options.add($op)
		for($i=0;$i < pgcode.length;$i++)                                  
		{            
			$op = new Option(pgcode[$i]['value'], pgcode[$i]['internal_code']);
			$op.id=pgcode[$i]['internal_code'];//specifying the id  for options
			document.getElementById("T49").options.add($op);
		}
		//
		document.getElementById("1S1").options.length = 0;		
		var post =responce.data['post'];			
		$op = new Option("Select Post","");
		$op.id=0;//specifying the id  for options
		document.getElementById("1S1").options.add($op)
		for($i=0;$i < post.length;$i++)                                  
		{            
			$op = new Option(post[$i]['value'], post[$i]['internal_code']);
			$op.id=post[$i]['internal_code'];//specifying the id  for options
			document.getElementById("1S1").options.add($op);
		}
		
		document.getElementById("1S2").options.length = 0;		
		var course =responce.data['course'];
		setCookie('course',course);		
		$op = new Option("Select Qualifying Exam",'');
		$op.id=0;//specifying the id  for options
		document.getElementById("1S2").options.add($op)
		for($i=0;$i < course.length;$i++)                                  
		{            
			$op = new Option(course[$i]['value'], course[$i]['internal_code']);
			$op.id=course[$i]['internal_code'];//specifying the id  for options
			document.getElementById("1S2").options.add($op);
		}			
	}
	});		
} 

function postdeportment()
{
	$.ajax({
	type: "POST",
	async:false,
	url:$host_url+'getdropdown', 
	success: function getcatcoderesponce(responce)
	{
		responce = eval('(' + responce + ')');
		document.getElementById("S3").options.length = 0;		
		var catcode =responce.data['catcode'];			
		$op = new Option("Select Category",0);
		$op.id=0;//specifying the id  for options
		document.getElementById("S3").options.add($op)
		for($i=0;$i < catcode.length;$i++)                                  
		{            
			$op = new Option(catcode[$i]['value'], catcode[$i]['internal_code']);
			$op.id=catcode[$i]['internal_code'];//specifying the id  for options
			document.getElementById("S3").options.add($op);
		}
	}	
	});	
}

function enableappeared(id)
{
	//$("input[name=fqualify]:checked").val();

	if(document.getElementById(id).value == 'T')
	{
		$("#TDISABILITY").show();
		$("#PDISABILITY").show();
		
	}else 
	{
			$("#TDISABILITY").hide();
			$("#PDISABILITY").hide();
	} 
}

function savepersonaldetails()
{
	var myobject = {};

	fldorder = 'T1,T2,T3,T4,T5,T6,T7,T8,T9,T11,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26';
	mandfields = 'T1';
	fieldarr = fldorder.split(",");

	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
	var fieldarrval = new Object();
	for(i=0; i<fieldarr.length; i++)
	{
		fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
	} 	
	var fqualify =  $('input[name=fqualify]:checked').val();
	var fcatcode =  document.getElementById('S3').value;
	var fieldarrvalue  = encodeURIComponent(JSON.stringify(fieldarrval)); 
	var data = "fieldarrvalue="+fieldarrvalue;
	/* if(Object.size(fieldarrval)>0)
	{
		$upload = $host_url+"savepersonaldetails&"+data;	
		document.getElementById("form_module_image_upload").setAttribute("action",$upload);		
		return AIM.submit(document.getElementById("form_module_image_upload"), 'same_tab',{'onComplete' : savepersonaldetailssuccess});
		
	} */
	
	if(Object.size(fieldarrval)>0)
	{
		$.ajax({
			type: "POST",
			url: $host_url+"savepersonaldetails",
			data:"fieldarrvalue="+fieldarrvalue+"&fqualify="+fqualify+"&fcatcode="+fcatcode,
			success:saveeducationaldetailsssuccess
		});  
	}
}

function savepersonaldetailssuccess()
{
	
}

function saveeducationaldetails()
{
	var myobject = {};
	fldorder = 'T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T50';
	fldorder +=',T51,T52,T53,T54,T55,T56,T57,T58,T59,T60,T61,T62,T63,T64,T65,T66,T67,T68,T69,T70,T71,T72,T73,T74,T75,T76,T77,T78,T79,T80';
	mandfields = 'T28';
	var fieldarrval = new Object();
	fieldarr = fldorder.split(",");

	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
	var ug = document.getElementById('TBA42').value;
	var pg = document.getElementById('T49').value;
	for(i=0; i<fieldarr.length; i++)
	{
		fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
	} 	
	var fieldarrvalue  = encodeURIComponent(JSON.stringify(fieldarrval));
	if(Object.size(fieldarrval)>0)
	{
		$.ajax({
			type: "POST",
			url: $host_url+"saveeducationaldetails",
			data:"fieldarrvalue="+fieldarrvalue+"&ug="+ug+"&pg="+pg,
			success:saveeducationaldetailsssuccess
		});  
	}
}

function saveeducationaldetailsssuccess($responce)
{
	$responce = eval('(' + $responce + ')'); 
	
	if($responce.error_code==0)
	{		
		alert($responce.data);
		return;
	}
	else
	{
		alert($responce.data);
		return;		
	}
	
}

function savepublicationdetails()
{
	var myobject;
	fldorder = 'T176,T177,T178,T179,T180,T181,T182,T183,T184,T185,T186,T187,T189,T190,T191,T192,T193,T194,T195,T196,T197,T198,T199,T200,T201,T202,T203,T204,T205,T206,T207,T208,T209,T210,T211,T212,T213,T214,T215,T216,T217';
	mandfieldT = '';
	
	var fieldarrval = new Object();
	fieldarr = fldorder.split(",");

	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
	
	for(i=0; i<fieldarr.length; i++)
	{
		fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
	} 
	
	var fieldarrvalue  = encodeURIComponent(JSON.stringify(fieldarrval));
	if(Object.size(fieldarrval)>0)
	{
		$.ajax({
			type: "POST",
			url: $host_url+"savepublicationdetails",
			data:"fieldarrvalue="+fieldarrvalue,
			success:savepublicationdetailssssuccess
		});  
	}

}

function savepublicationdetailssssuccess($responce)
{
	$responce = eval('('+$responce+')');
	if($responce.error_code == 0)
	{
		alert($responce.data);
		return;
	}
	else
	{	
		alert($responce.data);
		return;
	}
}

function saveexperiencedetails()
{
	var myobject = {};
	fldorder = 'T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T49,T50';
	fldorder +=',T51,T52,T53,T54,T55,T56,T57,T58,T59,T60,T61,T62,T63,T64,T65,T66,T67,T68,T69,T70,T71,T72,T73,T74,T75,T76,T77,T78,T79,T80';
	mandfields = 'T28';
	var fieldarrval = new Object();
	fieldarr = fldorder.split(",");

	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
	
	for(i=0; i<fieldarr.length; i++)
	{
		fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
	} 
	
	
	//////////////////////======to read multiple records====///////////
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var foreign_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "foreignvisit"  )
		{   
			++rowCnt;
			if(document.getElementById(rowCnt+'IT7').value != 'T')
			{
				++chkCnt;
				foreign_arr[chkCnt] = new Object();
				foreign_arr[chkCnt]['course'] = document.getElementById(rowCnt+'IT1').value;
				foreign_arr[chkCnt]['purpose'] = document.getElementById(rowCnt+'IT2').value;
				foreign_arr[chkCnt]['from']   = document.getElementById(rowCnt+'IT3').value;
				foreign_arr[chkCnt]['to']  = document.getElementById(rowCnt+'IT4').value;
				foreign_arr[chkCnt]['total']  = document.getElementById(rowCnt+'IT5').value;
				foreign_arr[chkCnt]['period']  = document.getElementById(rowCnt+'IT6').value;
			}	
		}
	}
	var dataString ="&array="+encodeURIComponent(JSON.stringify(foreign_arr));
	$.ajax({
	type:"POST",
	url:$host_url+"saveDetailsofForeignvisit",
	data:dataString,
	cache:false,
	success:function($responce)
	{	
		$responce = eval('('+$responce+')');
		if($responce.error_code == 0)
		{
			alert($responce.data);
		}
		else
			alert($responce.data);
	}	
	});

	alert(Object.size(fieldarrval));
}

function savepublicdetails()
{
	var myobject = {};

	fldorder = 'T176,T177,T178,T179,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27';
	mandfields = 'T1';
	fieldarr = fldorder.split(",");

	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
}

function saveorientationdetails()
{
	//////To read Multiple Records///////	
	
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var orientation_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "orientationdet" )
		{   
			++rowCnt;
			if(document.getElementById(rowCnt+'DT7').value != 'T')
			{
				++chkCnt; 
				orientation_arr[chkCnt] = new Object();
				orientation_arr[chkCnt]['Name'] = document.getElementById(rowCnt+'DT1').value;
				orientation_arr[chkCnt]['Rname'] = document.getElementById(rowCnt+'DT2').value;
				orientation_arr[chkCnt]['Sname']   = document.getElementById(rowCnt+'DT3').value;
				orientation_arr[chkCnt]['From']  = document.getElementById(rowCnt+'DT4').value;
				orientation_arr[chkCnt]['To']  = document.getElementById(rowCnt+'DT5').value;
				orientation_arr[chkCnt]['Remarks']  = document.getElementById(rowCnt+'DT6').value; 
			} 	
		}
	}
	
	//alert(Object.size(orientation_arr));
	
	var dataString ="&orientation_arr="+encodeURIComponent(JSON.stringify(orientation_arr));
	alert(dataString);
	$.ajax({
	type:"POST",
	url:$host_url+"saveorientationdetails",
	data:dataString,
	cache:false,
	success:function($responce)
	{	
		$responce = eval('('+$responce+')');
		if($responce.error_code == 0)
		{
			alert($responce.data);
		}
		else
			alert($responce.data);
	}	
	});
	
}


function saveconferencedetails()
{

		
	//////To read Multiple Records///////	
	
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var conference_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "conferencedet"  )
		{   
			++rowCnt;
			if(document.getElementById(rowCnt+'ET7').value != 'T')
			{
				++chkCnt;
				conference_arr[chkCnt] = new Object();
				conference_arr[chkCnt]['Name'] = document.getElementById(rowCnt+'ET1').value;
				conference_arr[chkCnt]['Organiser'] = document.getElementById(rowCnt+'ET2').value;
				conference_arr[chkCnt]['Year']   = document.getElementById(rowCnt+'ET3').value;
				conference_arr[chkCnt]['Duration']  = document.getElementById(rowCnt+'ET4').value;
				conference_arr[chkCnt]['Paper']  = document.getElementById(rowCnt+'ET5').value;
				conference_arr[chkCnt]['Status']  = document.getElementById(rowCnt+'ET6').value;
			}	
		}
	}
	
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var lectures_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "detlecdel")
		{   
			++rowCnt;
			if(document.getElementById(rowCnt+'FT5').value != 'T')
			{
				++chkCnt;
				lectures_arr[chkCnt] = new Object();
				lectures_arr[chkCnt]['Topic'] = document.getElementById(rowCnt+'FT1').value;
				lectures_arr[chkCnt]['Year'] = document.getElementById(rowCnt+'FT2').value;
				lectures_arr[chkCnt]['Event']   = document.getElementById(rowCnt+'FT3').value;
				lectures_arr[chkCnt]['Place']  = document.getElementById(rowCnt+'FT4').value;
			}	
		}
	}
	
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var consultancy_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "consultancy")
		{   
			++rowCnt;
			if(document.getElementById(rowCnt+'GT6').value != 'T')
			{
				++chkCnt;
				consultancy_arr[chkCnt] = new Object();
				consultancy_arr[chkCnt]['OrgName'] = document.getElementById(rowCnt+'GT1').value;
				consultancy_arr[chkCnt]['ConName'] = document.getElementById(rowCnt+'GT2').value;
				consultancy_arr[chkCnt]['Amount']   = document.getElementById(rowCnt+'GT3').value;
				consultancy_arr[chkCnt]['From']  = document.getElementById(rowCnt+'GT4').value;
				consultancy_arr[chkCnt]['To']  = document.getElementById(rowCnt+'GT5').value;
			}	
		}
	}
	
	var dataString ="&conference_arr="+encodeURIComponent(JSON.stringify(conference_arr))+"&lectures_arr="+encodeURIComponent(JSON.stringify(lectures_arr))+"&consultancy_arr="+encodeURIComponent(JSON.stringify(consultancy_arr));
	$.ajax({
	type:"POST",
	url:$host_url+"saveconferencedetails",
	data:dataString,
	cache:false,
	success:function($responce)
	{	
		$responce = eval('('+$responce+')');
		if($responce.error_code == 0)
		{
			alert($responce.data);
			return;
		}
		else
		{
			alert($responce.data);
			return;
		}
	}	
	});
	
}

function savereferences()
{
	var myobject;
		
	fldorder = 'S24,S25,S26,S27,S28,S29,S30,S31,S32,S33,S34,S35,S36,S37,S38,S39,S40,S41';
	mandfields = 'S24,S27,S30,S33,S36,S39';
	var fieldarrval = new Object();
	fieldarr = fldorder.split(",");
	
	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}		
	for(i=0; i<fieldarr.length; i++)
	{
		fieldarrval[fieldarr[i]] = document.getElementById(fieldarr[i]).value;
	} 	
	
	var fieldarrvalue  = encodeURIComponent(JSON.stringify(fieldarrval));

	if(Object.size(fieldarrval)>0)
	{
		$.ajax({
			type: "POST",
			url: $host_url+"savereferences",
			data:"fieldarrvalue="+fieldarrvalue,
			success:savereferencesuccess
		});  
	}
	
}

function savereferencesuccess($responce)
{
	$responce = eval('(' + $responce + ')'); 
	
	if($responce.error_code==0)
	{		
		alert($responce.data);
		return;
	}
	else
	{
		alert($responce.data);
		return;		
	}
}

function DisplayUserSelectedPhoto()
{
	var filepath;
	var valid_file_extentions = new Array("jpg");

	var ext=$("#student_photo_upload").val();
	filepath=ext;
	ext = ext.substring(ext.length-3,ext.length);
	ext = ext.toLowerCase();  

	if(ext != "" && valid_file_extentions == 'jpg' && valid_file_extentions == 'jpeg')
	{	      
		alert("Please Select the Valid Photo!");
		$("#student_photo_upload").val('')
		return false;
	}
	var lstr_data="filepath="+filepath;
	
	$upload = $host_url+"saveUserSelectedPhoto&"+lstr_data;	
	
	//$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>" });
	document.getElementById("form_module_image_upload").setAttribute("action",$upload);		
	return AIM.submit(document.getElementById("form_module_image_upload"), 'same_tab',{'onComplete' : DiaplayUserSelectedPhotoResponse});		 
		
}



function DiaplayUserSelectedPhotoResponse($responce)
{
	$responce = eval('(' + $responce + ')'); 
	// $.unblockUI();
	if($responce.error_code==0)
	{		
		$("#student_photo").attr("src", $responce.data);
	}
	else if($responce.error_code==-1)	
		$("#student_photo").attr("src", "img/default_photo.jpg"); 
	else if($responce.error_code==-2)	
	{
		alert($responce.data);
		$("#student_photo").attr("src", "img/default_photo.jpg");
		$("#student_photo_upload").val("");
	} 
}

function DisplayUserSelectedSign()
{
	var filepath;
	var valid_file_extentions = new Array("jpg");

	var ext=$("#student_sign_upload").val();
	filepath=ext;
	ext = ext.substring(ext.length-3,ext.length);
	ext = ext.toLowerCase();  

	if(ext != "" && valid_file_extentions == 'jpg' && valid_file_extentions == 'jpeg')
	{	      
		alert("Please Select the Valid Photo!");
		$("#student_sign_upload").val('')
		return false;
	}
	var lstr_data="filepath="+filepath;
	
	$upload = $host_url+"saveUserSelectedSign&"+lstr_data;	
	
	//$.blockUI({ message: "<h1 class='h1' style='font-size:12px'><img src='img/ajax-loader.gif' border='0'></h1>" });
	document.getElementById("form_module_image_upload").setAttribute("action",$upload);		
	return AIM.submit(document.getElementById("form_module_image_upload"), 'same_tab',{'onComplete' : DiaplayUserSelectedSignResponse});		 
		
}

function DiaplayUserSelectedSignResponse($responce)
{
	$responce = eval('(' + $responce + ')'); 
	// $.unblockUI();
	if($responce.error_code==0)
	{		
		$("#student_sign").attr("src", $responce.data);
	}
	else if($responce.error_code==-1)	
		$("#student_sign").attr("src", "img/default_photo.jpg"); 
	else if($responce.error_code==-2)	
	{
		alert($responce.data);
		$("#student_sign").attr("src", "img/default_photo.jpg");
		$("#student_sign_upload").val("");
	} 
}

function saveDetailsofForeignvisit()
{
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var foreign_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='TEXT'  && inputFileds[counter].name == "foreignvisit"  )
		{   
			++rowCnt;
			if(document.getElementById(rowCnt+'IT7').value != 'T')
			{
				++chkCnt;
				foreign_arr[chkCnt] = new Object();
				foreign_arr[chkCnt]['country'] = document.getElementById(rowCnt+'IT1').value;
				foreign_arr[chkCnt]['purpose'] = document.getElementById(rowCnt+'IT2').value;
				foreign_arr[chkCnt]['from']   = document.getElementById(rowCnt+'IT3').value;
				foreign_arr[chkCnt]['to']  = document.getElementById(rowCnt+'IT4').value;
				foreign_arr[chkCnt]['total']  = document.getElementById(rowCnt+'IT5').value;
				foreign_arr[chkCnt]['period']  = document.getElementById(rowCnt+'IT6').value;
			}	
		}
	}
	var dataString ="&foreign_arr="+encodeURIComponent(JSON.stringify(foreign_arr));
	$.ajax({
	type:"POST",
	url:$host_url+"saveDetailsofForeignvisit",
	data:dataString,
	cache:false,
	success:function($responce)
	{	
		$responce = eval('('+$responce+')');
		if($responce.error_code == 0)
		{
			alert($responce.data);
		}
		else
			alert($responce.data);
	}	
	});
}

function getpersentage(id1,id2,id3)
{
	var num2 = document.getElementById(id1).value;
	var num1 =  document.getElementById(id2).value;
	if(num2 > num1)
	{
		alert('Marks Obtained should be less than Maximum Marks.');
		document.getElementById(id2).focus();
		return;
	}
	var per = (num2/num1*100).toFixed(2);
	
	document.getElementById(id3).value = per;
}

function savepostdetails()
{
	var myobject;
	fldorder = '1S1,1S2';
	mandfields = '1S1,1S2';
	myobject = onsavevalidate.call(myobject, 999);
	if (myobject != 999)
	{
		document.getElementById(myobject).focus();
		return false;
	}
	//alert( document.getElementById("student_photo").src);	
	if($("#student_photo").val() == 'default_photo.jpg')
	{
		alert("Select valid photo file(accepts only jpg or jpeg)");
		$("#student_photo_upload").val('')
		return false;
	}	
	if($("#student_sign").val() == 'signature.png')
	{
		alert("Select valid sign file(accepts only jpg or jpeg)");
		$("#student_sign_upload").val('')
		return false;
	}	
	var inputFileds = document.getElementsByTagName('input');
	var chkCnt = 0;
	var rowCnt = 0;
	var post_arr = {};
	for (var counter=0; counter < inputFileds.length; counter++) 
	{       
		if ( inputFileds[counter].type.toUpperCase()=='HIDDEN'  && inputFileds[counter].name == "postname"  )
		{   
			++rowCnt;
			if(document.getElementById(rowCnt+'HS3').value != 'T')
			{
				++chkCnt;
				if(trim(document.getElementById(chkCnt+"S1").value) == '')
				{
					alert("Select Post");
					document.getElementById(chkCnt+"S1").focus();
					return false;
				}	
				if(trim(document.getElementById(chkCnt+"S2").value) == '')
				{
					alert("Select Qualifying Exam");
					document.getElementById(chkCnt+"S2").focus();
					return false;
				}		
				post_arr[chkCnt] = new Object();
				post_arr[chkCnt]['post'] = document.getElementById(rowCnt+'S1').value;
				post_arr[chkCnt]['course'] = document.getElementById(rowCnt+'S2').value;
			}
		}
	}	
	var dataString ="&post_arr="+encodeURIComponent(JSON.stringify(post_arr));
	$.ajax({
	type:"POST",
	url:$host_url+"savePostDetails",
	data:dataString,
	cache:false,
	success:function($responce)
	{	
		$responce = eval('('+$responce+')');
		if($responce.error_code == 0)
		{
			alert($responce.data);
			document.getElementById("ctab_post").className = "vsuccess";
		}
		else
			alert($responce.data);
	}	
	});
}