
/* 只比较使用dhtmlgoodies_calendar.js类型的时间格式 
 * start	开始时间
 * end		结束时间
 * text		显示比较后的提示信息 (默认是：结束日期应大于等于开始日期)
 */
function compareDate(start, end, text) {
	var startdate = new Date(start.substring(0, 10).replace(/-/g, "/"));
	var enddate = new Date(end.substring(0, 10).replace(/-/g, "/"));
	
	if (Date.parse(startdate) > Date.parse(enddate)) {
		if (text == null || text == "") {
			text = "结束日期应大于等于开始日期";
		}
		alert(text);
		return false;
	}else{
		return true;
	}
}
function checkText(obj) {
	if (obj.value != null && obj.value != "" && obj.value != "00") {
		return true;
	} else {
		obj.focus();
		return false;
	}
}
function checkMulti(obj) {
	var data = false;
	for (var i = 0; i < obj.length; i++) {
		if (obj[i].checked) {
			data = true;
		}
	}
	return data;
}
function checkFullDescript(data,text){
	var fck = FCKeditorAPI.GetInstance(data);
    var content = fck.GetXHTML(true);
    if (content.replace(/<(?!img|input|object)[^>]*>|\s+/ig, "") == "") {
    	if (text == null || text == "") {
			text = "机构详述不能为空!";
		}
       alert(text);
       fck.focus();
       return false;
    }else{
       return true;
    }
}

function isLogined(userId) {
	if(userId == null || userId == '') {
		return false;
	}
	return true;
}

function getCookie(name) {
	var prefix = name + "=" 
	var start = document.cookie.indexOf(prefix) 
	if (start==-1) {
		return null;
	}
	start+=prefix.length;
	var end = document.cookie.indexOf(";", start) 
	if (end==-1) {
		end=document.cookie.length;
	}
	return unescape(document.cookie.substring(start, end));
}

function submitshanghaiswt(type) {
	submitSwtNum(type);
	pageTracker._trackEvent("swtsh","click");
	//hl:2010-01-05window.open("http://www.53kf.com/company.php?arg=meiloocom&style=1&kf=sh-kf001,sh-kf002,sh-kf003&kflist=off&kfstat=0&zdkf_type=1");
	window.open("http://www.53kf.com/company.php?arg=meiloosh&style=1");
}

function submitbeijingswt(type) {
	submitSwtNum(type);
	pageTracker._trackEvent("swtbj","click");
	//hl:2010-01-05window.open("http://www.53kf.com/company.php?arg=meiloocom&style=1&kf=bj-kf001,bj-kf002,bj-kf003,bj-kf004&kflist=off&kfstat=0&zdkf_type=1");
	//2009-12-24window.open("http://bft.zoosnet.net/LR/Chatpre.aspx?id=BFT97033640");
	window.open("http://bft.zoosnet.net/LR/Chatpre.aspx?id=BFT97033640");
}

function submitSwtNum(type) {
	if(type == null || type == '') {
		return false;
	}else {
		var baseUrl="/shangwutong/shangwutong.html"
	    var param = "type="+type;
        var myAjax = new Ajax.Request(
	    baseUrl, {
	        method: 'post',
	        parameters: param,
	        onComplete: showSubmitNum
		});
	}
}
function showSubmitNum(request) {
	if(request.responseText=='success') {
	}else {
	}
}

