document.write('<script language="javascript" src="/js/prototype.js"></script>');


/**
 *
 * 功能：通过AJAX加载省所对应的城市
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/06/06 16:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 
function loadCityByProvinceId(porvinceID,position){
	var url='/ajax/loadCityByProvinceId.html';
	var pars='province_id=' + porvinceID;
	if (position){
		pars += '&position=' + position;
	}
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showCity
						}
					);
}

function showCity(originalRequest){
	var response=originalRequest.responseText;
	var conObj = document.getElementById('all_city');
	conObj.innerHTML = response;
	/*if(response){
		window.setTimeout(CIEIN_innerHTML,500,conObj,response);
	}*/
}
/**
 *
 * 功能：通过AJAX加载国家所对应的城市
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/04/25 16:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 
function loadCityByCountryId(conutryID,position){
	var url='/ajax/loadCityByCountryId.html';
	var pars='country_id=' + conutryID;
	if (position){
		pars += '&position=' + position;
	}
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showCity
						}
					);
}

/*******************************************************************
 *
 * 功能：通过AJAX加载院校专业分类所对应的专业
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/04/25 16:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 
function loadSpecialty(specialtySortID){
	var url='admin.php';
	var pars='com=ajax&action=loadSpecialty&specialty_sort_id=' + specialtySortID;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showSpecialty
						}
					);
}

function showSpecialty(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('all_specialty');
	conObj.innerHTML = response;
}
function CIEIN_innerHTML(obj, html){
	obj.innerHTML = html;
}
/**
 *
 * 功能：通过AJAX加载国家所对应的院校
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/04/25 16:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 
function loadCollegeByCountryId(conutryID){
	var url='index.php';
	var pars='com=ajax&action=loadCollegeByCondition&country_id=' + conutryID;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showCollege
						}
					);
}


/**
 *
 * 功能：通过国家\院校类别\院校专业,搜索院校
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/05/15 16:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 
function loadCollegeAmountByCondition(condition){
	var url='/ajax/loadCollegeAmountByCondition.html';
	var pars='';
	if (condition['country_id']){
		pars += '&country_id=' + condition['country_id'];
	}
	if (condition['city_id']){
		pars += '&city_id=' + condition['city_id'];
	}
	if (condition['kind_ids']){
		pars += '&kind_ids=' + condition['kind_ids'];
	}
	if (condition['degree_ids']){
		pars += '&degree_ids=' + condition['degree_ids'];
	}
	if (condition['college_teach_lang']){
		pars += '&college_teach_lang=' + condition['college_teach_lang'];
	}
	
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showCollege
						}
					);
}
function showCollege(originalRequest){
	var response=originalRequest.responseText;
	var conObj = document.getElementById('college_amount');
	conObj.innerHTML = response;
}
/**
 *
 * 功能：通过email和昵称验证用户唯一性
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/05/18 13:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 
function verifyMemberByEmail(value){
	var url='/ajax/verifyMemberByEmail.html';
	var pars='email=' + value;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showEmail
						}
					);
}
function showEmail(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('email_message');
	if(response){
		 $('email_message').innerHTML = response;
	}
}
function verifyLoginMemberByEmail(value){
	var url='/ajax/verifyLoginMemberByEmail.html';
	var pars='email=' + value;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showLoginEmail
						}
					);
}
function showLoginEmail(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('message');
	if(response){
		 $('message').innerHTML = response;
	}
}

function verifyMemberByCheckCode(value){
	var url='/ajax/verifyMemberByCheckCode.html';
	var pars='checkcode=' + value;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showCheckCode
						}
					);
}
function showCheckCode(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('verify_message');
	if(response){
		 $('verify_message').innerHTML = response;
	}
}
function verifyLoginMemberByCheckCode(value){
	var url='/ajax/verifyLoginMemberByCheckCode.html';
	var pars='checkcode=' + value;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showLoginCheckCode
						}
					);
}
function showLoginCheckCode(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('message');
	if(response){
		 $('message').innerHTML = response;
	}
}
/**
 *
 * 功能：通过email和昵称验证用户唯一性
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/05/18 13:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 
function verifyMemberByNickName(value){
	var url='/ajax/verifyMemberByNickName.html';
	var pars='nick_name=' + value;

	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showNickName
						}
					);
}
function showNickName(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('name_message');
	conObj.innerHTML = response;
	if(response){
		$('name_message').innerHTML = response;
	}
}
/**
 *
 * 功能：调用城市天气
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/05/22 13:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
/*function loadWeather(conditionID, code, day){
	var url='index.php';
	if (day == 'today'){
		var pars='com=ajax&action=loadWeather&day=today&code=' + code;
		var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showTodayWeather
						}
					);
	} else {
		var pars='com=ajax&action=loadWeather&day=tomorrow&code=' + code;
		var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showTomorrowWeather
						}
					);
	}
	
}*/
function loadWeather(code){
	var url='/ajax/loadWeather.html';

	var pars='code=' + code;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showWeather
						}
					);
	
}
function showWeather(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('ciWeather');
	if(response){
		conObj.innerHTML = response;
	}
}
/**
 *
 * 功能：调用城市天气
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/05/22 13:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 function loadTime(code){
	var url='/ajax/loadTime.html';

	var pars='code=' + code;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showTime
						}
					);
	
}
function showTime(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('show_time');
	if(response){
		conObj.innerHTML = response;
	}
}
/**
 *
 * 功能：重新发送邮件
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/05/22 13:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 function resendEmail(user_id){
	var url='/ajax/resendEmail.html';

	var pars='user_id=' + user_id;
	conObj = $('send');
	conObj.innerHTML = "<p class=\"loading\"><span class=\"f_FF0000_12\">激活信发送中，请稍等... </span></p>";
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showResend
						}
					);
	
}
function showResend(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('send');
	if(response){
		conObj.innerHTML = response;
	}
}
/**
 *
 * 功能：汇率查询
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/06/12 13:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
function loadRate(conditionID){
	var getMoney = $('money').value;
	var getUnit1 = $('unit1').value;
	var getUnit2 = $('unit2').value;
	var conObj = $(conditionID);
	conObj.innerHTML = '<img src="/images/loading_16x16.gif" />';
	var url='/ajax/rate.html';
	var pars='money=' + getMoney + '&unit1=' + getUnit1 + '&unit2=' + getUnit2;
	if(/^[+|-]?[1-9](\d+)?|0(\.\d+)?$/.test(getMoney)){
		if(getMoney<=9999999999){
			var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showRate
						}
					);
		}else{
			conObj.innerHTML = "数据过大，无法转换";
		}
	}else{
		//alert("请输入兑换金额");
		conObj.innerHTML = "请输入兑换金额";
	}
}

function showRate(originalRequest){
	var response=originalRequest.responseText;
	var conObj = $('result');
	var tmp = response.split('.');
	temp0 = parseInt(tmp[1]);	//保存小数点后的数字
	temp1 = tmp[1].split(' ');
	temp0 = temp0.toString();
	response = tmp[0]+'.'+temp0.substring(0,1)+' '+temp1[1];
	
	if(response){
		conObj.innerHTML = response;
	}
}
/**
 *
 * 功能：通过AJAX评论文章
 * 
 * Redistributions of files must retain the copyright notice.
 * @author 			zhang jie <development@ciein.com>
 * @version 		$Id: CIEIN_AJAX.js, v 1.0 2009/06/06 16:32zhangjie Exp $
 * @copyright		Copyright 2008.
 * @link			http://
 * @package			CIEIN.COM
 * @modifiedby		
 * @lastmodified
 *  	
 */
 /*
function articleComments(articleID,commentsID){
	var url='/ajax/articleComments.html';
	var pars='article_id=' + articleID + '&field=' + commentsID;
	var myAjax=new Ajax.Request
					(url,
						{
							method: 'get',
							parameters: pars, 
							onComplete: showVote
						}
					);
}

function showVote(originalRequest){
	var response=originalRequest.responseText;
	var result = response.split('|');
	if (result[0] == 'sorry'){
		alert('您已经评论过此篇文章');
		document.getElementById(result[1]).checked = true;
		return;
	}

	if(!isIE()){ //firefox innerText define   
		HTMLElement.prototype.__defineGetter__("innerText",    
		function(){   
			var anyString = "";   
			var childS = this.childNodes;   
			for(var i=0; i<childS.length; i++) {    
				if(childS[i].nodeType==1)   
					//anyString += childS[i].tagName=="BR" ? "\n" : childS[i].innerText;   
					anyString += childS[i].innerText;   
				else if(childS[i].nodeType==3)   
					anyString += childS[i].nodeValue;   
			}   
			return anyString;   
		}    
		);    
		HTMLElement.prototype.__defineSetter__("innerText",    
		function(sText){   
			this.textContent=sText;    
		}    
		);    
	}  
	
	var temp = result[0].split(':');
	var conObj = document.getElementById(temp[0]);
	conObj.innerText= temp[1];
	for(var i=1;i<result.length;i++){
		temp = result[i].split(':');
		window.document.getElementById(temp[0]).style.height = temp[1] + 'px';
	}
	
}
function isIE(){ //ie?    
if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1)    
    return true;    
else    
    return false;    
}   */ 
  
 
