var iemail = '';
var iphone = '';
var chargephone = '';
function selectway(ob) {
    var r = document.getElementById('writeinfo2');
    var t = document.getElementById('subtype');
    var e = document.getElementById('emailtext');
    if(t.value == 0)
        iemail = e.value;
    if(t.value == 1)
        iphone = e.value;
		if(t.value == 2)
				chargephone = e.value;

    if(ob.value == 'email') {
        r.innerHTML = '<label>请输入您的电子邮件：</label><input id="emailtext" name="email" class="inp3" type="text" value="'+iemail+'"/><button name="form-submit" type="button"  onclick="javascript:checkyyform_();"> 提交预约</button>';
        t.value = 0;
    } else if(ob.value == "phone") {
        r.innerHTML = '<label>请输入您的手机号码：</label><input id="emailtext" name="email" class="inp3" type="text" value="'+iphone+'" /><button name="form-submit" type="button"  onclick="javascript:checkyyform_();"> 提交预约</button>';
        t.value = 1;
    } else {
			 	r.innerHTML = '<label>请输入您的手机号码：</label><input id="emailtext" name="email" class="inp3" type="text" value="'+chargephone+'" /><button name="form-submit" type="button"  onclick="javascript:checkyyform_();"> 提交预约</button>';
        t.value = 2;
	
		}
}
function findValue(li) {
	if( li == null ) return alert("No match!");

	// if coming from an AJAX call, let's use the CityId as the value
	if( !!li.extra ) var sValue = li.extra[0];

	// otherwise, let's just display the value in the text box
	else var sValue = li.selectValue;

	//alert("The value you selected was: " + sValue);
}

function selectItem(li) {
	findValue(li);
}

function formatItem(row) {
	return row[0] + " (id: " + row[1] + ")";
}

function lookupAjax(){
	var oSuggest = $("#CityAjax")[0].autocompleter;

	oSuggest.findValue();

	return false;
}

function lookupLocal(){
	var oSuggest = $("#zhekou")[0].autocompleter;

	oSuggest.findValue();

	return false;
}
$(document).ready(function(){
		var inString ='汉字、拼音或首字母';
		if ($.browser.msie) { document.execCommand("BackgroundImageCache", false, true);
		}
		if($("#frmcity").val() == ""){
			$("#frmcity").attr("value",inString);
			$("#frmcity").css("color","#CCC");
		}
		if($("#tocity").val() == ""){
			$("#tocity").attr("value",inString);
			$("#tocity").css("color","#CCC");
		}
		KX.AC.init(KX.AC.mychannels);
        showLoginHtml()

		$("#zhekou").autocompleteArray(
		[
			"0","0.1","0.2","0.3","0.4","0.5","0.6","0.7","0.8","0.9",
			"1","1.1","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9",
			"2","2.1","2.2","2.3","2.4","2.5","2.6","2.7","2.8","2.9",
			"3","3.1","3.2","3.3","3.4","3.5","3.6","3.7","3.8","3.9",
			"4","4.1","4.2","4.3","4.4","4.5","4.6","4.7","4.8","4.9",
			"5","5.1","5.2","5.3","5.4","5.5","5.6","5.7","5.8","5.9",
			"6","6.1","6.2","6.3","6.4","6.5","6.6","6.7","6.8","6.9",
			"7","7.1","7.2","7.3","7.4","7.5","7.6","7.7","7.8","7.9",
			"8","8.1","8.2","8.3","8.4","8.5","8.6","8.7","8.8","8.9",
			"9","9.1","9.2","9.3","9.4","9.5","9.6","9.7","9.8","9.9",
			"10"
		],
		{
			delay:10,
			minChars:1,
			matchSubset:1,
			onItemSelect:selectItem,
			onFindValue:findValue,
			autoFill:true,
			maxItemsToShow:10
		}
	);
	callBackYuce();
$("#ffdx").mouseover( function() {
	$("#tishi1").css("top",$("#ffdx").offset().top+15);
	$("#tishi1").css("left",$("#ffdx").offset().left+40);
	$("#tishi1").css("display","block") ;
} ); 
$("#ffdx").mouseout( function() {$("#tishi1").css("display","none") } ); 
$("#mfdx").mouseover( function(e) {
	$("#tishi").css("top",$("#mfdx").offset().top+15);
	$("#tishi").css("left",$("#mfdx").offset().left+40);
	  $("#tishi").css("display","block") ;
} );     
$("#mfdx").mouseout( function(e) {$("#tishi").css("display","none") } ); 
});

