// JavaScript Document
var blnLoadinContent=false;
var chkNoRepeatClick=-1;
var blnVoteItemCheked=false;
var valueVoteItemCheked=false;

function chkRules(elem){
	btn=document.getElementById('submit');
	if(elem.checked)
		btn.disabled=false;
	else
		btn.disabled=true;
}
function sendEvaluationValue(){
	var parentDiv=document.getElementById('divQuestionsEvaluation');
	var fieldset=parentDiv.getElementsByTagName('fieldset');
	for(i=0;i<fieldset.length;i++){
		var numberRadio=0;
		elemItem=fieldset[i].getElementsByTagName('input');
		for(j=0;j<elemItem.length;j++){
			if(elemItem[j] && elemItem[j].type=="radio"){
				//itemID=document.getElementById(elemItem.id);
				if(elemItem[j].checked==false){
					++numberRadio;
				}
			}
		}
		if(numberRadio == (elemItem.length-1)){
			alert('پاسخ به تمام گزینه ها الزامیست');
			return false;
		}
	}
	var arrEvaluationValues=getEvaluationValue();
	var strQuestionID=arrEvaluationValues[0];
	var strItemID=arrEvaluationValues[1];
	var intTypeEvaluationID=document.getElementById('intTypeEvaluationID').value;
	var intObjectID=document.getElementById('listEvaluation').value;
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='divQuestionsEvaluation';
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID','intTypeEvaluationID','intObjectID','strQuestionID','strItemID');
	xRequest.arrValueVarsSend=new Array('81','10','04',intTypeEvaluationID,intObjectID,strQuestionID,strItemID);
	xRequest.sendRequest();
}
function getEvaluationValue(){
	var arrTotalValues=new Array();
	var arrQuestionID=new Array();
	var arrItemID=new Array();
	var parentDiv=document.getElementById('divQuestionsEvaluation');
	var fieldset=parentDiv.getElementsByTagName('fieldset');
	for(i=0;i<fieldset.length;i++){
		elemItem=fieldset[i].getElementsByTagName('input');
		for(j=0;j<elemItem.length;j++){
			if(elemItem[j] && elemItem[j].type=="hidden"){
				arrQuestionID.push(elemItem[j].value);
			}
			if(elemItem[j] && elemItem[j].type=="radio"){
				if(elemItem[j].checked==true){
					arrItemID.push(elemItem[j].value);
					break;
				}
			}
		}
	}
	arrTotalValues.push(arrQuestionID);
	arrTotalValues.push(arrItemID);
	return arrTotalValues;
}
function showListEvaluation(){
	document.getElementById('titleEvaluation').removeChild(txtNode);
	document.getElementById('divQuestionsEvaluation').style.display='none';
	document.getElementById('divListEvaluation').style.display='block';
}
function showQuestionEvaluation(){
	form=document.frmEvaluation;
	list=document.getElementById('listEvaluation');
	if(list.length > 1){
		if(list.selectedIndex==0){
			alert('گزینه مورد نظر را از لیست انتخاب کنید');
			list.focus();
			return false;
		}
		//document.getElementById('evluationID').value=list.value;
		document.getElementById('divListEvaluation').style.display='none';
		document.getElementById('divQuestionsEvaluation').style.display='block';
		txtNode=document.createTextNode(list.options[list.selectedIndex].text);
		document.getElementById('titleEvaluation').appendChild(txtNode);
	}
}
function showMap(){
	var xRequest=new XAjaxRequest();
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID');
	xRequest.arrValueVarsSend=new Array('85');
	xRequest.sendRequest();
}
function formMessage(){
	listContanteacher=document.getElementById('listContactTeachersName')
	if(listContanteacher.selectedIndex==0){
		alert('استاد مورد نظر را از لیست انتخاب کنید');
		return false;
	} else {
		emailAddress=listContanteacher.value;
		var xRequest=new XAjaxRequest();
		xRequest.fileRequest='prc/index.php';
		xRequest.arrNameVarsSend=new Array('actID','emailAddress');
		xRequest.arrValueVarsSend=new Array('84',emailAddress);
		xRequest.sendRequest();
	}
}
function sendContactMessage(){
	strUserName=document.getElementById('txtUserName').value;
	strMessageTitle=document.getElementById('txtMessageTitle').value;
	strMessageText=document.getElementById('txtMessageText').value;
	emailAddress=document.getElementById('txtEmailAddress').value;
	if(strUserName=='' || strMessageTitle=='' || strMessageText==''){
		alert('پر کردن تمام فیلدها الزامیست');
		return false;
	}
	var xRequest=new XAjaxRequest();
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','strUserName','strMessageTitle','strMessageText','emailAddress');
	xRequest.arrValueVarsSend=new Array('84','01',strUserName,strMessageTitle,strMessageText,emailAddress);
	xRequest.sendRequest();
}
function printDetailsSubmit(blnPrint){
	intSubmitID=document.getElementById('submitID').value;
	blnPrint==true ? actPrint='true' : actPrint='false'; 
	strURL="prc/print.php?cat_id=92&submit_id="+intSubmitID+"&print="+actPrint;
	winPrint=window.open(strURL,'print');
	winPrint.focus();
}
function sendDataRegisterOnline(){
	if(checkDateRegister()){
		bSelectBook='';
		bSelectCd='';
		intTermID=document.getElementById('hTermSelectedID').value;
		strStudentCode=document.getElementById('studentCode').value;
		strStudentName=document.getElementById('studentName').value;
		intTellNumber=document.getElementById('tellNumber').value;
		intMobileNumber=document.getElementById('mobileNumber').value;
		if(document.getElementById('cSelectBook')) 
			if(document.getElementById('cSelectBook').checked==true) bSelectBook=document.getElementById('cSelectBook').value;
		if(document.getElementById('cSelectCd')) 
			if(document.getElementById('cSelectCd').checked==true) bSelectCd=document.getElementById('cSelectCd').value;
		var xRequest=new XAjaxRequest();
		xRequest.fileRequest='prc/index.php';
		xRequest.arrNameVarsSend=new Array('actID','contentID','intTermID','strStudentCode','strStudentName','intTellNumber','intMobileNumber');
		xRequest.arrValueVarsSend=new Array('83','03',intTermID,strStudentCode,strStudentName,intTellNumber,intMobileNumber);
		if(bSelectBook != ''){
			xRequest.arrNameVarsSend.push('bSelectBook');
			xRequest.arrValueVarsSend.push(bSelectBook);
		}
		if(bSelectCd != ''){
			xRequest.arrNameVarsSend.push('bSelectCd');
			xRequest.arrValueVarsSend.push(bSelectCd);
		}
		xRequest.sendRequest();
	}
}
function checkDateRegister(){
	studentCode=document.getElementById('studentCode');
	studentName=document.getElementById('studentName');
	tellNumber=document.getElementById('tellNumber');
	mobileNumber=document.getElementById('mobileNumber');
	if(studentCode.value==''){
		alert('کد زبان آموزی را وارد نمائیذ');
		studentCode.focus();
		return  false;
	}
	if(studentName.value==''){
		alert('نام زبان آموز را وارد نمائیذ');
		studentName.focus();
		return  false;
	}
	if(tellNumber.value=='' && mobileNumber.value==''){
		alert('وارد کردن تلفن ثابت یا همراه الزامیست');	
		tellNumber.focus();
		return  false;
	}
	if(tellNumber.value!=''){
		regularNumeric=/^\d+$/;
		if(!regularNumeric.test(tellNumber.value)){ 
			alert('تلفن ثابت را صحیح وارد نمائید');	
			tellNumber.focus();
			return  false;
		}
	}
	if(mobileNumber.value!=''){
		regularNumeric=/^\d+$/;
		if(!regularNumeric.test(mobileNumber.value)){ 
			alert('تلفن همراه را صحیح وارد نمائید');	
			mobileNumber.focus();
			return  false;
		}
	}
	return true;
}
function editStudentProfile(){
	bSelectBook='';
	bSelectCd='';
	intTermSelectedID=document.getElementById('hTermSelectedID').value;
	strStudentCode=document.getElementById('hStudentCode').value;
	strStudentName=document.getElementById('hStudentName').value;
	intTellNumber=document.getElementById('hTellNumber').value;
	intMobileNumber=document.getElementById('hMobileNumber').value;
	if(document.getElementById('hSelectBook')) bSelectBook=document.getElementById('hSelectBook').value;
	if(document.getElementById('hSelectCd')) bSelectCd=document.getElementById('hSelectCd').value;
	var xRequest=new XAjaxRequest();
	xRequest.fileRequest='prc/index.php';
	//xRequest.strTargetLoandig='indexMainContent';
	xRequest.arrNameVarsSend=new Array('actID','contentID','intTermSelectedID','strStudentCode','strStudentName','intTellNumber','intMobileNumber');
	xRequest.arrValueVarsSend=new Array('83','05',intTermSelectedID,strStudentCode,strStudentName,intTellNumber,intMobileNumber);
	if(bSelectBook != ''){
		xRequest.arrNameVarsSend.push('bSelectBook');
		xRequest.arrValueVarsSend.push(bSelectBook);
	}
	if(bSelectCd != ''){
		xRequest.arrNameVarsSend.push('bSelectCd');
		xRequest.arrValueVarsSend.push(bSelectCd);
	}
	xRequest.sendRequest();
}
function viewDetailTerm(){
	divNotes=document.getElementById('registerNotes');	
	divDetails=document.getElementById('detailsTerm');
	titleNotes=document.getElementById('termNameNotes');	
	titleDetails=document.getElementById('termNameTitle');
	divNotes.style.display='none';
	titleNotes.style.display='none';
	divDetails.style.display='block';
	titleDetails.style.display='block';
}
function viewTermNotes(){
	divNotes=document.getElementById('registerNotes');	
	divRegister=document.getElementById('registerOnlineForm');
	titleNotes=document.getElementById('termNameNotes');	
	titleRegister=document.getElementById('registerTitle');
	divNotes.style.display='block';
	titleNotes.style.display='block';
	divRegister.style.display='none';
	titleRegister.style.display='none';
}
function viewRegisterForm(){
	divForm=document.getElementById('registerOnlineForm');	
	divNotes=document.getElementById('registerNotes');
	titleForm=document.getElementById('registerTitle');	
	titleNotes=document.getElementById('termNameNotes');
	divForm.style.display='block';
	titleForm.style.display='block';
	divNotes.style.display='none';
	titleNotes.style.display='none';
}
function backToTermDetails(){
	divForm=document.getElementById('registerOnlineForm');	
	divDetails=document.getElementById('detailsTerm');
	titleForm=document.getElementById('registerTitle');	
	titleDetails=document.getElementById('termNameTitle');
	divForm.style.display='none';
	titleForm.style.display='none';
	divDetails.style.display='block';
	titleDetails.style.display='block';
}
function submitLectureTerm(){
	var listTerms=document.getElementById('divListTerms');
	var blnSelectedTerm=false;
	var intTermSelectedID;
	//if(trainingTerm.checked==false) alert('AAAAAAAAAAAAA');
	var inputElements=listTerms.getElementsByTagName("input");
	for(i=0;i<inputElements.length;i++){
		chkInput=inputElements[i];
		if(chkInput && chkInput.type=="radio"){
			if(chkInput.checked==true){
				blnSelectedTerm=true;
				intTermSelectedID=chkInput.value;
				break;
			}
		}
	}
	if(!blnSelectedTerm){
		alert('دوره مورد نظر را از لیست انتخاب کنید');
		return false;
	} else {
		//return true;
		var xRequest=new XAjaxRequest();
		xRequest.fileRequest='prc/index.php';
		//xRequest.strTargetLoandig='indexMainContent';
		xRequest.arrNameVarsSend=new Array('actID','contentID','intTermSelectedID');
		xRequest.arrValueVarsSend=new Array('83','04',intTermSelectedID);
		xRequest.sendRequest();
	}
}

function submitStudent(){
	bSelectBook='false';
	bSelectCd='false';
	var iTermSelectedID=document.getElementById('hTermSelectedID').value;
	var sTermName=document.getElementById('hTermName').value;
	var sStudentCode=document.getElementById('hStudentCode').value;
	var sStudentName=document.getElementById('hStudentName').value;
	var iTellNumber=document.getElementById('hTellNumber').value;
	var iMobileNumber=document.getElementById('hMobileNumber').value;
	var iTermCost=document.getElementById('hTermCost').value;
	if(document.getElementById('hSelectBook')) bSelectBook=document.getElementById('hSelectBook').value;
	if(document.getElementById('hSelectCd')) bSelectCd=document.getElementById('hSelectCd').value;
	var xRequest=new XAjaxRequest();
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','iTermSelectedID','sTermName','sStudentCode','sStudentName','iTellNumber','iMobileNumber','iTermCost','bSelectBook','bSelectCd');
	xRequest.arrValueVarsSend=new Array('83','06',iTermSelectedID,sTermName,sStudentCode,sStudentName,iTellNumber,iMobileNumber,iTermCost,bSelectBook,bSelectCd);
	xRequest.sendRequest();
}
function registerForms(){
	//alert(document.body.offsetWidth);
	var lectureTerm=document.getElementById('listLectureTerms');
	var departmentList=document.getElementById('departmentsList');
	var btnContinueRegister=document.getElementById('btnShowFormRegisterOnline');
	intDepartmentID=departmentList.value;
	intTermID=lectureTerm.value;
	var xRequest=new XAjaxRequest();
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','intDepartmentID','intTermID');
	xRequest.arrValueVarsSend=new Array('83','01',intDepartmentID,intTermID);
	xRequest.sendRequest();
}
function registerTermsDetail(termID){
	document.getElementById('divListTerms').style.display='none';
	document.getElementById('termsDetails').style.display='block';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='termsDetails';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','intTermID');
	xRequest.arrValueVarsSend=new Array('83','02',termID);
	xRequest.sendRequest();
}
function showLoadingTerms(){
	var termsList=document.getElementById('listRegisterTerms');
	lengthRowsSheet=termsList.options.length;
	for(i=0;i<lengthRowsSheet;i++){
		termsList.remove(0);
	}
	var newElem = document.createElement("option");
	newElem.text = "لطفا کمی صبر کنید";
	termsList.options.add(newElem);
	termsList.disabled=true;
}
function createTermsList(srtList){
	var termsList=document.getElementById('listRegisterTerms');
	if(srtList!=false){
		arrListRows=srtList.split(',');
		termsList.remove(0);
		var newElem = document.createElement("option");
		newElem.text = 'انتخاب دوره';
		termsList.options.add(newElem);
		for(i=0;i<arrListRows.length;i++){
			arrTextValue=arrListRows[i].split('=');
			strText=arrTextValue[1];
			strValue=arrTextValue[0];
			var newElem = document.createElement("option");
			newElem.text = strText;
			newElem.value = strValue;
			termsList.options.add(newElem);
		}
		termsList.disabled=false;
	} else {
		termsList.remove(0);
		var newElem = document.createElement("option");
		newElem.text = "دوره ای موجود نیست";
		termsList.options.add(newElem);
		termsList.disabled=true;
	}
}
function showRegisterTemrs(){
//	var file='prc/index.php';
//	var termsList=document.getElementById('listRegisterTerms');
//	var departmentList=document.getElementById('departmentsList');
//	var intDepartmentID=departmentList.value;
//	var Ajax = new sack(file);
//	Ajax.method='POST';
//	Ajax.setVar('actID','83');
//	Ajax.setVar('intDepartmentID',intDepartmentID);
//	Ajax.onLoading = function (){
//		showLoadingTerms();
//	}
//	Ajax.onCompletion = function (){
//		createTermsList(Ajax.response);
//	}
//	Ajax.runAJAX();
}
function registerOnline(){
	elemListTerms=document.getElementById('listLectureTerms');
	if(elemListTerms.selectedIndex==0 && elemListTerms.length > 1){
		alert('دوره مورد نظر را انتخاب کنید');
		elemListTerms.focus();
		return false;
	} else if(elemListTerms.length>1){
		registerForms();
	}
}
function winPrintClose(){
	winPrintMark.close();
}
function printMark(){
	intInstituteID=document.getElementById('markListDepartment').value;
	intTermID=document.getElementById('markListTerm').value;
	intClassCode=document.getElementById('studentCode').value;
	strURL="prc/print.php?cat_id=91&institute="+intInstituteID+"&term="+intTermID+"&code="+intClassCode;
	winPrintMark=window.open(strURL,'print');
	winPrintMark.focus();
}
function showChartBar(intVoteDescID){
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='contentMainContent';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','voteDescID');
	xRequest.arrValueVarsSend=new Array('92','02',intVoteDescID);
	xRequest.sendRequest();
//	chartImage=document.createElement("IMG");
//	chartImage.src="prc/opinion_chart.php?vote_id="+intVoteDescID;
//	alert(chartImage.src);
//	chartImage.width='530';
//	chartImage.height='230';
//	chartImage.alt='Result Vote';
//	chartImage.title='آمار رای گیري';
//	document.getElementById('contentMainContent').innerHTML='';
//	document.getElementById('contentMainContent').appendChild(chartImage);
}
function resetVariableVote(){
	blnVoteItemCheked=false;
	valueVoteItemCheked=false;
}
function sendItemVote(){
	form=document.formVotes;
	intLoopFor=form.length;
	blnViewResult=form.viewResultVotes.value
	for(i=0;i<(intLoopFor-2);i++){
		if(form.elements[i].checked==true){
			blnVoteItemCheked=true;
			valueVoteItemCheked=form.elements[i].value;
			break;
		}
	}
	if(!blnVoteItemCheked){
		alert('گزینه مورد نظر را انتخاب کنید');	
		return false;
	}
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='contentMainContent';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','voteID','blnViewResult');
	xRequest.arrValueVarsSend=new Array('92','01',valueVoteItemCheked,blnViewResult);
	xRequest.callbackFunction=resetVariableVote;
	xRequest.sendRequest();
}
function sendMySuggest(){
	oName=document.getElementById('sName');;
	oDesc=document.getElementById('sDesc');;
	hSuggestionID=document.getElementById('hSuggestionID');;
	if(oName.value=='' || oDesc.value==''){
		alert('وارد کردن نام و متن پاسخ الزامیست');	
		return false;
	}
	document.getElementById('divElementSuggest').style.display='none';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='lodingResult';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','sName','sDesc','iSuggestionID');
	xRequest.arrValueVarsSend=new Array('95','02',oName.value,oDesc.value,hSuggestionID.value);
	//xRequest.callbackFunction=viewSuggestions(iSuggestionID);
	xRequest.sendRequest();
}
function indexPage(){
	hideTopSubMenu();
	hideSubMenuItems();
	if(ElemID('mainContent').className=='loadingMainContent') ElemID('mainContent').className='indexMainContent';
	if(ElemID('divTabs').className=='indexTabs') ElemID('divTabs').className='loadingTabs';
}
function tabContentData(intNumberTab){
	//if(ElemID('mainContent').className=='loadingMainContent') ElemID('mainContent').className='IndexMainContent';
	if(chkNoRepeatClick!=intNumberTab){
		var	contentID='';
		var xRequest=new XAjaxRequest();
		if(intNumberTab==0){
			xRequest.strTargetLoandig='listNewsBoard';
			contentID='01';
		}else if(intNumberTab==1){
			xRequest.strTargetLoandig='listTeachers';
			contentID='02';
		}else if(intNumberTab==2){
			xRequest.strTargetLoandig='listPersonnels';
			contentID='03';
		}else if(intNumberTab==3){
			xRequest.strTargetLoandig='listStudents';
			contentID='04';
		}else if(intNumberTab==4){
			xRequest.strTargetLoandig='viewMarks';
			contentID='05';
		}else if(intNumberTab==5){
			xRequest.strTargetLoandig='councilForm';
			contentID='06';
		}
		xRequest.fileRequest='prc/index.php';
		xRequest.arrNameVarsSend=new Array('actID','contentID');
		xRequest.arrValueVarsSend=new Array('80',contentID);
		xRequest.sendRequest();
		chkNoRepeatClick=intNumberTab;
	}
}
function backToCouncilForm(){
	var	contentID='06';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='councilForm';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID');
	xRequest.arrValueVarsSend=new Array('80',contentID);
	xRequest.sendRequest();
}
function showCouncilReponse(){
	if(ElemID('pursuitCode').value==''){
		alert('کد پیگیری را وارد نمائید');
		return false;
	}
	if(ElemID('pursuitCode').value.length < 10){
		alert('کد پیگیری ده کاراکتری می باشد');
		return false;
	}
	var strPursuitCode=ElemID('pursuitCode').value;
	var actID='80';
	var contentID='06';
	var subjectID='02';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='councilForm';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID','strPursuitCode');
	xRequest.arrValueVarsSend=new Array(actID,contentID,subjectID,strPursuitCode);
	xRequest.sendRequest();
}
function sendCouncilQuestion(){
	if(ElemID('councilUserName').value=='' || ElemID('councilQuestion').value==''){
		alert('پر کردن تمام موارد الزامیست');
		return false;
	}
	/*if(ElemID('councilQuestion').value.length > 255 ){
		alert('طول کاراکتر های ورودی در قسمت سؤال بیش از حد مجاز است');
		return false;
	}*/
	var strCouncilUserName=ElemID('councilUserName').value;
	var strCouncilQuestion=ElemID('councilQuestion').value;
	var actID='80';
	var contentID='06';
	var subjectID='01';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='councilForm';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID','councilUserName','councilQuestion');
	xRequest.arrValueVarsSend=new Array(actID,contentID,subjectID,strCouncilUserName,strCouncilQuestion);
	xRequest.sendRequest();
}
function showResponse(){
	ElemID('questionDiv').style.display='none';
	ElemID('responseDiv').style.display='block';
	ElemID('showDivResponse').disabled=true;
	ElemID('showDivQuestion').disabled=false;
}
function showQuestion(){
	ElemID('responseDiv').style.display='none';
	ElemID('questionDiv').style.display='block';
	ElemID('showDivQuestion').disabled=true;
	ElemID('showDivResponse').disabled=false;
}
function showMark(){
	var actID='80';
	var contentID='05';
	var subjectID='01';
	var intDepartmentID=ElemID('markListDepartment').value;
	var intTermID=ElemID('markListTerm').value;
	var studentCode=ElemID('studentCode').value;
	var classCode=ElemID('classCode').value;
	if(intDepartmentID=='موردی یافت نشد' || intTermID=='موردی یافت نشد'){
		alert('در حال حاضر امکان جستجو نیست');
		return false;
	}
	if(studentCode==''){
		alert('کد زبان آموزی را وارد نمائید');
		return false;
	}
	if(classCode==''){
		alert('کد کلاس را وارد نمائید');
		return false;
	}
	ElemID('divShowSearchedMarks').innerHTML='';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='divShowSearchedMarks';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID','intDepartmentID','intTermID','studentCode','classCode');
	xRequest.arrValueVarsSend=new Array(actID,contentID,subjectID,intDepartmentID,intTermID,studentCode,classCode);
	xRequest.sendRequest();
}
function showStudentsList(){
	var intShowTermID=new Number();
	intShowsTermID=document.getElementById('listStudentsTerms').value;
	showListTabs(intShowsTermID)
}
function showPersonnelsList(){
	var intShowTermID=new Number();
	intShowsTermID=document.getElementById('listPersonnelsTerms').value;
	showListTabs(intShowsTermID)
}
function showTeachersList(){
	var intShowTermID=new Number();
	intShowsTermID=document.getElementById('listTeachersTerms').value;
	showListTabs(intShowsTermID)
}
function prominentStudent(intStudentID){
	var	actID='';
	actID='93';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='divShowStudentList';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','intStudentID');
	xRequest.arrValueVarsSend=new Array(actID,intStudentID);
	xRequest.sendRequest();
}
function prominentPersonnel(intPersonnelID){
	var	actID='';
	actID='93';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='divShowPersonnelList';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','intPersonnelID');
	xRequest.arrValueVarsSend=new Array(actID,intPersonnelID);
	xRequest.sendRequest();
}
function prominentTeacher(intTeacherID){
	var	actID='';
	actID='93';
	var xRequest=new XAjaxRequest();
	xRequest.strTargetLoandig='divShowTeacherList';
	xRequest.fileRequest='prc/index.php';
	xRequest.arrNameVarsSend=new Array('actID','intTeacherID');
	xRequest.arrValueVarsSend=new Array(actID,intTeacherID);
	xRequest.sendRequest();
}
function showListTabs(intTermID){
	//if(ElemID('mainContent').className=='loadingMainContent') ElemID('mainContent').className='indexMainContent';
	var	contentID='';
	var xRequest=new XAjaxRequest();
	if(intTabActive==1){
		ElemID('divShowTeacherList').innerHTML='';
		xRequest.strTargetLoandig='divShowTeacherList';
		contentID='01';
	}else if(intTabActive==2){
		ElemID('divShowPersonnelList').innerHTML='';
		xRequest.strTargetLoandig='divShowPersonnelList';
		contentID='02';
	}else if(intTabActive==3){
		ElemID('divShowStudentList').innerHTML='';
		xRequest.strTargetLoandig='divShowStudentList';
		contentID='03';
	}
	xRequest.fileRequest='prc/tabs/ajax_list.php';
	xRequest.arrNameVarsSend=new Array('contentID','intTermID');
	xRequest.arrValueVarsSend=new Array(contentID,intTermID);
	xRequest.sendRequest();
}

function ElemID(elementID){
	return document.getElementById(elementID);
}
function showImage(imageURL){
	objWindowImage=window.open(imageURL,'gallery');
	objWindowImage.focus();
}
function showSignup()
{
//	formRegister=true;
//	var Ajax = new sack('login/return_submit.php');
//	Ajax.method="POST";
//	Ajax.setVar('afshin','Endeh Hacker');
//	Ajax.onLoading = function ()
//	{
//		var div=document.createElement("div");
//		div.id='disableContent';
//		div.className='divTransparence';
//		div.style.width=document.getElementById('MainLayer').offsetWidth+'px';
//		div.style.height=document.getElementById('MainLayer').offsetHeight+'px';
//		div.style.background="#000000";
//		this.divTransparence=div;
//		document.getElementById('MainLayer').appendChild(div);
//		document.getElementById('MiddleDiv').innerHTML="<img style=\"padding-top:30px;\" src=\"images/indicator.gif\" title=\"indicator.gif\" /><br/><span style=\"padding-top:30px;\" class=\"TextLoading\">Please Wait...</span>";
//	}
//	Ajax.onCompletion = function ()
//	{
//		prevPage=Ajax.response;
//		document.getElementById('MainLayer').removeChild(this.divTransparence);
//		document.getElementById('MiddleDiv').innerHTML=Ajax.response;
//	}
//	Ajax.runAJAX();
}
function opinions(opinionID,archiveBackLink){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	if(archiveBackLink==true){
		xRequest.arrNameVarsSend=new Array('actID','opinionID','backLink');
		xRequest.arrValueVarsSend=new Array('92',opinionID,true);
	} else {
		xRequest.arrNameVarsSend=new Array('actID','opinionID');
		xRequest.arrValueVarsSend=new Array('92',opinionID);
	}
	xRequest.sendRequest();
}
function addSuggestions(suggestionID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','suggestionID','contentID');
	xRequest.arrValueVarsSend=new Array('95',suggestionID,'01');
	xRequest.sendRequest();
}
function viewSuggestion(suggestionID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','suggestionID','contentID');
	xRequest.arrValueVarsSend=new Array('95',suggestionID,'03');
	xRequest.sendRequest();
}


function news(newsID,archiveBackLink){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	if(archiveBackLink==true){
		xRequest.arrNameVarsSend=new Array('actID','newsID','backLink');
		xRequest.arrValueVarsSend=new Array('89',newsID,true);
	} else {
		xRequest.arrNameVarsSend=new Array('actID','newsID');
		xRequest.arrValueVarsSend=new Array('89',newsID);
	}
	xRequest.sendRequest();
}
function aboutInstitute(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('81','01',subjectID);
	xRequest.sendRequest();
}
function top_menu(contentID){
	hideTopSubMenu();
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID');
	xRequest.arrValueVarsSend=new Array('81',contentID);
	xRequest.sendRequest();
}
function evaluationData(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('81','10',subjectID);
	xRequest.sendRequest();
}
function scienceWorld(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('81','09',subjectID);
	xRequest.sendRequest();
}
function subjectInstituteInfo(){
	hideSubMenuItems();
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID');
	xRequest.arrValueVarsSend=new Array('82','01');
	xRequest.sendRequest();
}
function subjectTrainingTerms(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','02',subjectID);
	xRequest.sendRequest();
}
function subjectRegisterManual(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','03',subjectID);
	xRequest.sendRequest();
}
function subjectSpecialClasses(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','04',subjectID);
	xRequest.sendRequest();
}
function subjectInstituteDossier(){
	hideSubMenuItems();
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID');
	xRequest.arrValueVarsSend=new Array('82','05');
	xRequest.sendRequest();
}
function subjectTeacherIntroduction(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','06',subjectID);
	xRequest.sendRequest();
}
function subjectAssistInstitutes(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','07',subjectID);
	xRequest.sendRequest();
}
function subjectTeacherReciption(){
	hideSubMenuItems();
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID');
	xRequest.arrValueVarsSend=new Array('82','08');
	xRequest.sendRequest();
}
function subjectGallery(subjectID){
	var xRequest=new XAjaxRequest(subjectID);
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','09',subjectID);
	xRequest.sendRequest();
}
function subjectTrainingRecent(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','10',subjectID);
	xRequest.sendRequest();
}
function subjectDirectorGroup(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','11',subjectID);
	xRequest.sendRequest();
}
function subjectCooperation(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','12',subjectID);
	xRequest.sendRequest();
}
function subjectDepartment(subjectID){
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID','subjectID');
	xRequest.arrValueVarsSend=new Array('82','13',subjectID);
	xRequest.sendRequest();
}
function subjectCalender(){
	hideSubMenuItems();
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID');
	xRequest.arrValueVarsSend=new Array('82','15');
	xRequest.sendRequest();
}
function subjectConvocation(){
	hideSubMenuItems();
	var xRequest=new XAjaxRequest();
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('actID','contentID');
	xRequest.arrValueVarsSend=new Array('82','14');
	xRequest.sendRequest();
}
function heightDivArchive(){
	if(document.getElementById('contentArchive').offsetHeight> 400){
		document.getElementById('contentArchive').style.height="400px";
	}
}
function archiveShowing(type){
	var xRequest=new XAjaxRequest();
	xRequest.fileRequest='prc/archive.php';
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('type');
	xRequest.arrValueVarsSend=new Array(type);
	xRequest.callbackFunction=heightDivArchive;
	xRequest.sendRequest();
}
function archiveNews(newsID){
	news(newsID,true);
	//Modalbox.show('prc/archive.php',{method:'post',closeString:'بستن پنجره',params:{'type':'showNews','news_id':newsID},title:'نمایش خبر',afterHide:activeClock,overlayClose:false}); 
}
function searchHolder(){
	if(ElemID('voucherOwnershipsName').value=='' || ElemID('voucherOwnershipsName').value=='مشخصات را وارد نمائید'){
		alert('مشخصات را وارد نمائید');
		ElemID('voucherOwnershipsName').focus();
		return false;
	}
	var xRequest=new XAjaxRequest();
	var strSearch=ElemID('voucherOwnershipsName').value;
	var typeSearch=ElemID('voucherTypeSearch').value;
	xRequest.fileRequest='prc/search.php';
	xRequest.method="POST";
	xRequest.arrNameVarsSend=new Array('searchID','strSearch','typeSearch');
	xRequest.arrValueVarsSend=new Array('91',strSearch,typeSearch);
	xRequest.sendRequest();
}


/***************************** Start XAjaxequest Class ********************************/

function XAjaxRequest(){
	this.strTargetLoandig='mainContent';
	this.objImgLoading=null;
	this.strAjaxReponse='';
	this.fileRequest='prc/index.php';
	this.method='POST';
	this.callbackFunction;
	this.arrNameVarsSend=new Array();
	this.arrValueVarsSend=new Array();
	this.showLoading = function (){
		//if(this.strTargetLoandig=='mainContent' && ElemID('mainContent').className=='IndexMainContent')	ElemID('mainContent').className='loadingMainContent';
		if(this.strTargetLoandig=='mainContent' && ElemID('mainContent').className=='indexMainContent')	{
			if(ElemID('mainContent').className=='indexMainContent') ElemID('mainContent').className='loadingMainContent';
			if(ElemID('divTabs').className=='loadingTabs') ElemID('divTabs').className='indexTabs';
		}
		blnLoadinContent=true;
		ElemID(this.strTargetLoandig).innerHTML="";
		objImgLoading=document.createElement("img");
		objBR=document.createElement("br");
		objSpan=document.createElement("span");
		objTextSpan=document.createTextNode("کمی صبر کنید ");
		objImgLoading.src="images/loading.gif";
		objImgLoading.width="32";
		objImgLoading.height="32";
		objSpan.style.font="bold 8.5pt Tahoma";
		objSpan.style.direction="rtl";
		ElemID(this.strTargetLoandig).style.padding="15px 0";
		ElemID(this.strTargetLoandig).appendChild(objImgLoading);
		ElemID(this.strTargetLoandig).appendChild(objBR);
		objSpan.appendChild(objTextSpan);
		ElemID(this.strTargetLoandig).appendChild(objSpan);
	}
	this.removeLoading = function (){
		blnLoadinContent=false;
		ElemID(this.strTargetLoandig).style.padding="0px 0px";
		ElemID(this.strTargetLoandig).removeChild(objImgLoading);
		ElemID(this.strTargetLoandig).removeChild(objBR);
		ElemID(this.strTargetLoandig).removeChild(objSpan);
	}
	this.sendRequest = function(){
		if(blnLoadinContent) {
			//alert('دادها در حال بارگزاري مي باشد');
			//return false;
		}
		var self = this;
		if(this.arrNameVarsSend.length != this.arrValueVarsSend.length){
			alert('the Length Of Names & Values Array Not Equal');
			return false;
		}
		var Ajax = new sack(this.fileRequest);
		Ajax.method=this.method;
		for(var i in this.arrNameVarsSend){
			Ajax.setVar(this.arrNameVarsSend[i],this.arrValueVarsSend[i]);
		}
		Ajax.onLoading = function (){
			self.showLoading();	
		}
		Ajax.onCompletion = function (){
			self.removeLoading();
			ElemID(self.strTargetLoandig).innerHTML=Ajax.response;
			if(self.callbackFunction) self.callbackFunction();
		}
		Ajax.runAJAX();
	}
}

/***************************** End XAjaxequest Class ********************************/
