function __Year_Month_day_Check(__type,__yearId,__monthId,__dayId){
	__year = document.getElementById(__yearId);
	__month = document.getElementById(__monthId);
	__day = document.getElementById(__dayId);
	__yearValue = Number(__year.value);
	__monthValue = Number(__month.value);
	__dayValue = Number(__day.value);
	if(__type == 'year'){
		for (var i = __month.options.length;i > 1;i--){
			__month.remove(i-1);
		}
		for (var i = __day.options.length;i > 1;i--){
			__day.remove(i-1);
		}
		if (__yearValue != '0000') {
			for (var i = 0;i < 12;i++){
				var n = i<9?'0'+(i+1):(i+1);
				__month.options[i+1] = new Option(n,n);
			}
		}
	}else if(__type == 'month'){
		if (__monthValue == '00') {
			for (var i = __day.options.length;i > 1;i--){
				__day.remove(i-1);
			}
		}else{
			var __monthDays = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
			__monthDays[1] = (__yearValue % 4 == 0)&&(__yearValue % 100 != 0)||(__yearValue % 400 == 0)?29:28;
			var __newDay = __monthDays[__monthValue-1];
			for (var i = __day.options.length;i > __newDay +1 ;i--){
				__day.remove(i-1);
			}
			for (var i = __day.options.length;i < __newDay +1 ;i++){
				var n = i<10?'0'+ i:i;
				__day.options[i] = new Option(n,n);
			}
		}
	}
}
function G_addslashes(str){
	str = str.replace(/\'/g,"\\\'");
	str = str.replace(/\"/g,"\\\"");
	str = str.replace(/\\/g,"\\\\");
	return str;
}
function G_stripslashes(str){
	str = str.replace(/\\\'/g,"\'");
	str = str.replace(/\\\"/g,"\"");
	str = str.replace(/\\\\/g,"\\");
	return str;
}
function G_showShadow(callback) {
	var isIE = (document.all) ? true : false;
	var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
	var shadow = null;
	if(!$("G_shadow")){
		shadow = document.createElement("div");
		shadow.setAttribute("id", "G_shadow");
	}else{
		shadow = $("G_shadow");
	}
	var width = '100%';
	var height = '100%';
	var position = 'fixed';
	if(isIE6){
		width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) + "px";
		height = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px";
		position = 'absolute';
	}
	$(shadow).setStyle({
	    position:position,
	    left:0,
	    top:0,
	    width:width,
	    height:height,
	    background:'#000',
	    zIndex:100,
		display:'none'
	});
	$(document.body).insert(shadow);
	new Effect.Appear(shadow,{
		from:0,
		to:0.8,
		afterFinish:callback
	});
};
function G_closeShadow(callback){
	var shadow = $("G_shadow");
	new Effect.Appear(shadow,{
		from:0.8,
		to:0,
		afterFinish:function(){
			callback && callback();
			shadow.remove();
		}
	});
}
