﻿
var area_1 = new Array();
area_1.push(["全国",["北京","上海","天津","广东","浙江","江苏","山东","四川","重庆","福建","湖北","湖南","江西","河南","河北","辽宁","安徽","广西","陕西","云南","黑龙江","山西","吉林","贵州","甘肃","内蒙古","西藏","宁夏","青海","新疆","海南","香港","澳门","台湾","其他"]]);

var area_2 = new Array();

	area_2.push(["广东",["广州","深圳","珠海","汕头","惠州","东莞","中山","佛山","湛江","云浮","从化","揭阳","梅州","肇庆","汕尾","韶关","番禺","茂名","潮阳","江门","三水","河源","高明","清远","潮州","增城","阳江","南海"]]);
	area_2.push(["浙江",["杭州","宁波","嘉兴","湖州","绍兴","金华","衢州","舟山","温州","台州","嵊州","丽水"]]);
	area_2.push(["江苏",["南京","徐州","连云港","淮安","宿迁","盐城","扬州","南通","镇江","常州","无锡","苏州","常熟","准阴","淮阴","泰州","张家港"]]);
	area_2.push(["山东",["济南","青岛","淄博","潍坊","烟台","威海","日照","德州","滨州","泰安","东营","济宁","聊城","莱芜","枣庄","临沂","菏泽"]]);
	area_2.push(["四川",["成都","攀枝花","德阳","绵阳","自贡","内江","乐山","泸州","宜宾","雅安","甘孜","阿坝","康定","马尔康","涪陵","达州","西昌","遂宁","资阳","凉山","广安","广元","达川","眉山","巴中","南充"]]);
	area_2.push(["重庆",["黔江","重庆","万州","涪陵"]]);
	area_2.push(["福建",["福州","厦门","三明","莆田","泉州","漳州","南平","宁德","龙岩"]]);
	area_2.push(["湖北",["武汉","襄樊","十堰","宜昌","荆门","孝感","黄岗","恩施","江汉","咸宁","天门","江陵","荆州","黄石","鄂州","随州"]]);
	area_2.push(["湖南",["长沙","湘潭","衡阳","岳阳","常德","郴州","益阳","怀化","张家界","邵阳","吉首","娄底","安阳","永州","自治州","株洲"]]);
	area_2.push(["江西",["南昌","景德镇","新余","九江","鹰潭","上饶","宜春","吉安","赣州","抚州","萍乡"]]);
	area_2.push(["河南",["郑州","开封","洛阳","新乡","濮阳","商丘","南阳","周口","鹤壁","安阳","焦作","潢川","信阳","驻马店","三门峡","许昌","漯河","平顶山","巩义"]]);
	area_2.push(["河北",["石家庄","邯郸","邢台","保定","张家口","承德","唐山","秦皇岛","沧州","廊坊","衡水"]]);
	area_2.push(["辽宁",["沈阳","大连","鞍山","抚顺","本溪","丹东","锦州","营口","阜新","辽阳","铁岭","盘锦","葫芦岛","朝阳","锦西"]]);
	area_2.push(["安徽",["合肥","蚌埠","马鞍山","安庆","黄山","宿州","巢湖","阜阳","毫州","铜陵","宣城","宿县","芜湖","六安","滁州","淮北","池州","淮南"]]);
	area_2.push(["广西",["南宁","柳州","桂林","北海","梧州","钦州","防城港","玉林","河池","防城","贵港","百色","贺州"]]);
	area_2.push(["陕西",["西安","铜川","宝鸡","渭南","商州","商洛","延安","榆林","汉中","咸阳","安康"]]);
	area_2.push(["云南",["昆明","昭通","曲靖","思茅","丽江","楚雄","德宏","玉溪","版纳","红河","景洪","六库","文山","香格里拉","大理","保山","中甸","迪庆","潞西","个旧","迪庆州","临沧","怒江"]]);
	area_2.push(["黑龙江",["哈尔滨","齐齐哈尔","大庆","伊春","牡丹江","佳木斯","绥化","黑河","鸡西","七台河","双鸭山","鹤岗","大兴安岭"]]);
	area_2.push(["山西",["太原","大同","阳泉","长治","朔州","榆次","临汾","运城","离石","晋中","忻州","晋城","吕梁"]]);
	area_2.push(["吉林",["长春","吉林","四平","辽源","通化","延吉","珲春","梅河口","白城","白山","松源","延边","松原"]]);
	area_2.push(["贵州",["贵阳","遵义","安顺","六盘水","铜仁","黔东南","兴义","凯里","毕节","黔南","都匀","黔西南"]]);
	area_2.push(["甘肃",["兰州","金昌","天水","平凉","临夏","白银","陇南","定西","张掖","嘉峪关","酒泉","武威","庆阳","甘南州"]]);
	area_2.push(["内蒙古",["呼和浩特","包头","通辽","乌兰浩特","临河","海拉尔","阿拉善左","乌海","集宁","赤峰","鄂尔多斯","锡林浩特","东胜","科尔沁翼中旗","巴彦浩特","阿拉善左旗"]]);
	area_2.push(["西藏",["拉萨","日喀则","阿里","那曲","山南","林芝","泽当","噶尔","昌都"]]);
	area_2.push(["宁夏",["银川","石嘴山","银北","石咀山","银南","吴忠","固原"]]);
	area_2.push(["青海",["西宁","平安","格尔木","玛沁","海东","玉树","共和","海南","黄南","海北","德令哈","海西","果洛","同仁","门源","海晏"]]);
	area_2.push(["新疆",["乌鲁木齐","克拉玛依","吐鲁番","喀什","阿图什","库尔勒","伊犁","和田","奎屯","哈密","博乐","塔城","博州","阿克苏","阿勒泰","昌吉","伊宁","石河子","克州","咯会"]]);
	area_2.push(["海南",["海口","三亚","儋州","海南"]]);
	area_2.push(["香港",["香港"]]);
	area_2.push(["澳门",["澳门"]]);
	area_2.push(["台湾",["台北"]]);
	area_2.push(["其他",["其他"]]);


$.plug.city = new $.create();
$.plug.city.prototype = {
	init:function(){
		this.childs = [];
		this.values = [];
		this.num = 0;
		this.showType = "undefined";
	},
	showMethod:function(){
		var frame = document.getElementById("_iframe_bg");
		if((navigator.appVersion.indexOf('MSIE') != -1) && (parseFloat(navigator.appVersion.substr(navigator.appVersion.indexOf('MSIE')+5,3))) <= 6 && frame){
			var dis = frame.style.display;
				dis = dis != "none" ? "none" : "block";
				frame.style.display = dis;
		}
		this.showFn(this.showType || "");
		this.showType = "undefined";
	},
	addShowFn:function(fn){
		this.showFn = fn;
	},
	setChild:function(id,datas,fns){
		var len = this.childs.length;
		this.childs.push(new $.plug.city.child(id,datas,len,this,fns));
		this.num++;
	},
	getPre:function(n){
		var m = (n - 1)>=0 ? n - 1 : null;
		return this.childs[m];
	},
	getNext:function(n){
		return this.childs[n+1] || null;
	},
	getValues:function(){
		return this.values;
	}
};
$.plug.city.child = new $.create();
$.plug.city.child.prototype = {
	init:function(id,datas,level,obj,fns){
		this.objCity = obj;
		this.level = level;
		this.dom = typeof id == "string" ? document.getElementById(id) : id ;
		this.data = datas;
		this.value = "";
		for(var p in fns){
			this[p] = fns[p];
		}
	},
	hasValue:function(value){
		for(var i=0;i<this.data.length;i++){
			if(this.data[i][0] == value){
				return true;
			}
		}
		return false;
	},
	upData:function(value,datas){
		this.data.push([value,datas]);
	},
	getValue:function(){
		return this.dom.value;
	},
	setValue:function(){
		this.objCity.values[this.level] = this.dom.value;
	},
	fire:function(value){
		var obj = this.objCity,next = obj.getNext(this.level),i = this.level+1,len = obj.values.length;
			obj.values[this.level] = value;
			this.dom.value = value;
			for(i;i<len;i++){
				obj.values[i] = "";
			}
		if(next != null){
			next.create(value);
		}
		this.showValues();
	},
	create:function(key){
		var i,len = this.data.length;
		var next = this.objCity.getNext(this.level);
		if(!this.hasValue(key)){
			this._remove();
			return;
		}
		for(i=0;i<len;i++){
			if(this.data[i][0] == key){
				this._remove();
				this.objCity.values[this.level-1] = key;
				this._template(this.data[i][1]);
				break;
			}
		}
		if(next != null){
			next.create(this.getValue());
		}else{
			this.setValue();
		}
	},
	_template:function(citys){
		this.template(citys);
	},
	template:function(citys){
		var dom = this.dom,o=this,len=citys.length;
		dom.style.display = "";
		for(var i= 0;i<len;i++){
			dom.options[i] = new Option(citys[i],citys[i]);
		}
		this.setValue();
		dom.onchange = function(){
			o.fire(this.value);
		};
	},
	_remove:function(){
		var next = this.objCity.getNext(this.level);
		this.remove();
		if(next != null){
			next._remove();
		}
	},
	remove:function(){
		this.dom.innerHTML = "";
		if(this.dom.tagName.toLowerCase() == "input"){
			this.dom.disabled = "disabled";
		}else{
			this.dom.style.display = "none";
		}
		
	}
};
//供头部使用，也可插入其他页使用
function initCitys(){
	var conf = {
		template:function(citys){
			var o=this,dom = o.dom;
			dom.style.display = "";
			for(var i= 0;i<citys.length;i++){
				var el = document.createElement("A");
					el.innerHTML = citys[i];
					el.className = "city1";
					el.href = "javascript:void(0)";
					el.onfocus = function(){this.blur()};
					el.onclick = function(){
						o.fire(this.innerHTML);
					};
					dom.appendChild(el);
					el = null;
			}
			var clear = document.createElement("DIV");
				clear.className = "clear";
				dom.appendChild(clear);
				clear = null;
		},
		getValue:function(){
			return this.value;
		},
		setValue:function(){
			this.objCity.values[this.level] = this.value;
		},
		remove:function(){
			this.dom.innerHTML = "";
			this.dom.style.display = "none";
		},
		showValues:function(){
			var sel = myCity.tempSelect,allCity = myCity.allCity,dis;
				myCity.domValues.innerHTML = myCity.getValues().join("--");
				if(this.level == 1){
					
					myCity.showMethod();
					return false;
				}
				dis = sel.style.display == "block" ? "none" : "block";
				allCity.style.display = dis == "none" ? "block" : "none";
				sel.style.display = dis;
		}
	};

	
	//实现多种呈现方式的函数
	function showCityPlanel(type){
		var el = getDom("cityBox");
		var dis = el.style.display;
			el.style.display = dis == "block" ? "none" : "block";

			
		var sheng = myCity.getValues()[0]?myCity.getValues()[0]:'';//修改了【会员注册】 左键双击“优惠”按钮 出现undefined的bug mod by yanjin on 20110708
		var shi = myCity.getValues()[1] || sheng;
		
		switch (type || ""){
			case "":
				break;
			case "citySearch_1" :
						//getDom("Province").value = sheng;
						//getDom("City").value = shi;
						//getDom("searchHosp").submit();
						var json={"北京":"35","安徽":"2","重庆":"55","福建":"4","甘肃":"5","广东":"6","广西":"7","贵州":"8","海南":"9","河北":"10","黑龙江":"11","河南":"12","湖北":"13","湖南":"14","内蒙古":"15","江苏":"16","江西":"17","吉林":"258","辽宁":"19","宁夏":"20","青海":"21","山西":"22","山东":"23","上海":"339","四川":"25","天津":"366","西藏":"27","新疆":"28","云南":"29","浙江":"30","陕西":"31","台湾":"442","香港":"443","澳门":"444","合肥":"36","蚌埠":"37","马鞍山":"38","安庆":"39","黄山":"40","宿州":"41","巢湖":"42","阜阳":"43","毫州":"44","铜陵":"45","宣城":"46","宿县":"47","芜湖":"48","六安":"49","滁州":"50","淮北":"51","池州":"52","淮南":"53","黔江":"54","万州":"56","涪陵":"354","福州":"58","厦门":"59","三明":"60","莆田":"61","泉州":"62","漳州":"63","南平":"64","宁德":"65","龙岩":"66","兰州":"67","金昌":"68","天水":"69","平凉":"70","临夏":"71","白银":"72","陇南":"73","定西":"74","张掖":"75","嘉峪关":"76","酒泉":"77","武威":"78","庆阳":"79","甘南州":"80","广州":"81","深圳":"82","珠海":"83","汕头":"84","惠州":"85","东莞":"86","中山":"87","佛山":"88","湛江":"89","云浮":"90","从化":"91","揭阳":"92","梅州":"93","肇庆":"94","汕尾":"95","韶关":"96","番禺":"97","茂名":"98","潮阳":"99","江门":"100","三水":"101","河源":"102","高明":"103","清远":"104","潮州":"105","增城":"106","阳江":"107","南海":"108","南宁":"109","柳州":"110","桂林":"111","北海":"112","梧州":"113","钦州":"114","防城港":"115","玉林":"116","河池":"117","防城":"118","贵港":"119","百色":"120","贺州":"121","贵阳":"122","遵义":"123","安顺":"124","六盘水":"125","铜仁":"126","黔东南":"127","兴义":"128","凯里":"129","毕节":"130","黔南":"131","都匀":"132","黔西南":"133","海口":"134","三亚":"135","儋州":"136","石家庄":"138","邯郸":"139","邢台":"140","保定":"141","张家口":"142","承德":"143","唐山":"144","秦皇岛":"145","沧州":"146","廊坊":"147","衡水":"148","哈尔滨":"149","齐齐哈尔":"150","大庆":"151","伊春":"152","牡丹江":"153","佳木斯":"154","绥化":"155","黑河":"156","鸡西":"157","七台河":"158","双鸭山":"159","鹤岗":"160","大兴安岭":"161","郑州":"162","开封":"163","洛阳":"164","新乡":"165","濮阳":"166","商丘":"167","南阳":"168","周口":"169","鹤壁":"170","安阳":"209","焦作":"172","潢川":"173","信阳":"174","驻马店":"175","三门峡":"176","许昌":"177","漯河":"178","平顶山":"179","巩义":"180","武汉":"181","襄樊":"182","十堰":"183","宜昌":"184","荆门":"185","孝感":"186","黄冈":"187","恩施":"188","江汉":"189","咸宁":"190","天门":"191","江陵":"192","荆州":"193","黄石":"194","鄂州":"195","随州":"196","长沙":"197","湘潭":"198","衡阳":"199","岳阳":"200","常德":"201","郴州":"202","益阳":"203","怀化":"204","张家界":"205","邵阳":"206","吉首":"207","娄底":"208","永州":"210","自治州":"211","株洲":"212","呼和浩特":"213","包头":"214","通辽":"215","乌兰浩特":"216","临河":"217","海拉尔":"218","阿拉善左":"219","科尔沁翼中旗":"220","巴彦浩特":"221","乌海":"222","集宁":"223","赤峰":"224","鄂尔多斯":"225","锡林浩特":"226","东胜":"227","阿拉善左旗":"228","南京":"229","徐州":"230","连云港":"231","淮安":"232","宿迁":"233","盐城":"234","扬州":"235","南通":"236","镇江":"237","常州":"238","无锡":"239","苏州":"240","常熟":"241","准阴":"242","淮阴":"243","泰州":"244","张家港":"245","南昌":"246","景德镇":"247","新余":"248","九江":"249","鹰潭":"250","上饶":"251","宜春":"252","吉安":"253","赣州":"254","抚州":"255","萍乡":"256","长春":"257","四平":"259","辽源":"260","通化":"261","延吉":"262","珲春":"263","梅河口":"264","白城":"265","白山":"266","松源":"267","延边":"268","松原":"269","沈阳":"270","大连":"271","鞍山":"272","抚顺":"273","本溪":"274","丹东":"275","锦州":"276","营口":"277","阜新":"278","辽阳":"279","铁岭":"280","盘锦":"281","葫芦岛":"282","朝阳":"283","锦西":"284","银川":"285","石嘴山":"286","银北":"287","石咀山":"288","银南":"289","吴忠":"290","固原":"291","西宁":"292","平安":"293","格尔木":"294","玛沁":"295","海东":"296","玉树":"297","共和":"298","黄南":"300","海北":"301","德令哈":"302","海西":"303","果洛":"304","同仁":"305","门源":"306","海晏":"307","太原":"308","大同":"309","阳泉":"310","长治":"311","朔州":"312","榆次":"313","临汾":"314","运城":"315","离石":"316","晋中":"317","忻州":"318","晋城":"319","吕梁":"320","济南":"321","青岛":"322","淄博":"323","潍坊":"324","烟台":"325","威海":"326","日照":"327","德州":"328","滨州":"329","泰安":"330","东营":"331","济宁":"332","聊城":"333","莱芜":"334","枣庄":"335","临沂":"336","菏泽":"337","荷泽":"338","成都":"340","攀枝花":"341","德阳":"342","绵阳":"343","自贡":"344","内江":"345","乐山":"346","泸州":"347","宜宾":"348","雅安":"349","甘孜":"350","阿坝":"351","康定":"352","马尔康":"353","达州":"355","西昌":"356","遂宁":"357","资阳":"358","凉山":"359","广安":"360","广元":"361","达川":"362","眉山":"363","巴中":"364","南充":"365","拉萨":"367","日喀则":"368","阿里":"369","那曲":"370","山南":"371","林芝":"372","泽当":"373","噶尔":"374","昌都":"375","乌鲁木齐":"376","克拉玛依":"377","吐鲁番":"378","喀什":"379","阿图什":"380","库尔勒":"381","伊犁":"382","和田":"383","奎屯":"384","哈密":"385","博乐":"386","塔城":"387","博州":"388","阿克苏":"389","阿勒泰":"390","昌吉":"391","伊宁":"392","石河子":"393","克州":"394","咯会":"395","昆明":"396","昭通":"397","曲靖":"398","思茅":"399","丽江":"400","楚雄":"401","德宏":"402","玉溪":"403","版纳":"404","红河":"405","景洪":"406","六库":"407","文山":"408","香格里拉":"409","大理":"410","保山":"411","中甸":"412","迪庆":"413","潞西":"414","个旧":"415","迪庆州":"416","临沧":"417","怒江":"418","杭州":"419","宁波":"420","嘉兴":"421","湖州":"422","绍兴":"423","金华":"424","衢州":"425","舟山":"426","温州":"427","台州":"428","嵊州":"429","丽水":"430","西安":"431","铜川":"432","宝鸡":"433","渭南":"434","商州":"435","商洛":"436","延安":"437","榆林":"438","汉中":"439","咸阳":"440","安康":"441","石狮":"445"};
						if(shi){
							window.open("/area/"+json[shi]+"/");
						}else if(sheng){
							window.open("/area/"+json[sheng]+"/");
						}
				break;
			case "regCity" :
					getDom("regCity").value = myCity.getValues().join("-");
					getDom("regProvince").value = sheng;
					getDom("regCity").value = myCity.getValues()[1] || sheng;
				break;
			case "miniHeader":
					getDom("mini_ProvinceValue").value = sheng;
					getDom("mini_CityValue").value = myCity.getValues()[1] || sheng;
					getDom("miniHospSearch").submit();
					
				break;
			case "regBlog":
					getDom("province").value = sheng;
					getDom("city").value = myCity.getValues()[1] || sheng;
					var shi = myCity.getValues()[1] || sheng;
					getHosps(sheng,shi);
					
				break;
				case "reg":{
					getDom("ProvinceValue").value = sheng;
					getDom("CityValue").value = myCity.getValues()[1] || sheng;
					geitip();
					setTab('tab',2,2);
					check("province");
					if(typeof otherSetValue != "undefined"){
						otherSetValue(sheng,myCity.getValues()[1] || sheng);
					}
				 break;
				}
			default :
				break;
			
		}
	
	}
	
	
	myCity = new $.plug.city();
	myCity.setChild("div_2",[],conf);//数据由页面自定义了
	myCity.setChild("div_3",area_2,conf);
	myCity.addShowFn(showCityPlanel);
	myCity.allCity = getDom("allCity");
	myCity.tempSelect = getDom("tempSelect");
	myCity.domValues = getDom("domValues");
	
	
	
			var i,c = myCity.allCity.getElementsByTagName("A"),len = c.length;
			var mainCitys = getDom("mainCity").getElementsByTagName("A");
			var len2 = mainCitys.length,j;
			
			for(i=0;i<len;i++){
				c[i].onclick = function(){
					myCity.childs[0].fire(this.innerHTML);
				};
			}
			for(j=0;j<len2;j++){
				mainCitys[j].onclick = function(){
					var sheng = this.getAttribute("p");
					var shi = this.innerHTML;
					if(sheng){
						myCity.childs[0].fire("");
						myCity.values = [sheng,shi];
						
					}else{
						myCity.childs[0].fire(sheng);
						myCity.values = [shi];					
					}
					var sel = myCity.tempSelect,allCity = myCity.allCity,dis;
						dis = sel.style.display == "block" ? "none" : "block";
						allCity.style.display = dis == "none" ? "block" : "none";
						sel.style.display = dis;
						myCity.showMethod();

				};
			}

			//重新选择省份
			getDom("toSelect").onclick = function(){
				myCity.childs[0].fire();
			};
			//关闭
			getDom("cityBoxClose").onclick = function(){
				myCity.showType = "";
				myCity.showMethod();
			};
			

			//不同页面使用需要在外部覆盖initThisPageEvent函数，以绑定不同的文档dom
			initThisPageEvent();


}


//默认为首页头部使用
function initThisPageEvent(){
	//主医院搜索打开按钮
	getDom("selButton").onclick = function(){
		myCity.showMethod();
		myCity.showType = "citySearch_1";
		changePos(getDom("cityBox"),300,100);
	};	
}

function setPageBg(){
	var div = document.getElementById("_iframe_bg"),dis = div.style.display;
	if(dis == "none"){
		var w = Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth)+"px";
		var h = Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight)-100+"px";
		div.style.width = w;
		div.style.height = h;
		div.style.display = "";
	}else{
		div.style.display = "none";
	}
}

function initRegCity(){
	//找医院
	getDom("selButton_2").onclick = function(){
		myCity.showMethod();
		myCity.showType = "citySearch_1";
		changePos(getDom("cityBox"),240,440);
	};
	//注册选择城市
	getDom("regProvince").onclick = function(){
		myCity.showMethod();getDom("regProvince").blur();
		myCity.showType = "regCity";
		changePos(getDom("cityBox"),240,260);
	};
	getDom("regCity").onclick = function(){
		myCity.showMethod();getDom("regCity").blur();
		myCity.showType = "regCity";
		changePos(getDom("cityBox"),240,260);
	};
}


//获得鼠标位置 add by yanjin on 20110414
function mouseMove(event)
{
 var event= event || window.event;
  var mousePos = mouseCoords(event); 
	 return mousePos;
	
}

function mouseCoords(ev)
{
 if(ev.pageX || ev.pageY){
   return {x:ev.pageX, y:ev.pageY};
 }
 return {
     x:ev.clientX ,
     y:ev.clientY + document.documentElement.scrollTop - document.documentElement.clientTop
 };
}

//内容页快速注册 add by yanjin on 20110413
function initContentRegCity(){
	//注册选择城市
	getDom("regProvince").onclick = function(event){
		var p=mouseMove(event);
		myCity.showMethod();getDom("regProvince").blur();
		myCity.showType = "regCity";
		//alert(p.y);
		changePos(getDom("cityBox"),p.x,p.y);
	};
	getDom("regCity").onclick = function(event){
		var p=mouseMove(event);
		myCity.showMethod();getDom("regCity").blur();
		myCity.showType = "regCity";
		changePos(getDom("cityBox"),p.x,p.y);
	};
}

function getDom(id){
	return document.getElementById(id);
}
function changePos(el,x,y){
	el.style.left = x +"px";
	el.style.top = y + "px";
}

function check_reg(o){
	var myForm = o || document.forms["reg"];
	var name = myForm.UserName,phone = myForm.Mobile,province = myForm.Province,city = myForm.City;
	if(name.value == ""){
		alert("请填写您的姓名！");
		name.focus();
		return false;
	}
	
	if(phone.value == ""){
		alert("请您填写您的手机号码！");
		phone.focus();
		return false;
	}else if(phone.value.length != 11 ){
		alert("手机号码的位数不正确！");
		phone.focus();
		return false;
	}else if(!isNum(phone.value)){
		alert("手机号码必须全部是数字！");
		phone.focus();
		return false;
	}
	
	if(province.value == ""){
		alert("请选择省份和城市！");
		return false;
	}
	if(city.value ==""){
		alert("请选择省份和城市！");
		return false;
	}
	document.getElementById("submitButton").disabled=true;
	return true;
}

function isNum(num){
	var i,s,num = num.toString();
	s="0123456789";
	if(num.length == 0){
		return false;
	}
	for (i=0;i<num.length;i++){
		if(s.indexOf(num.charAt(i)) == -1){
			return false;
		}
 	}
	return true;
}



















