
function $CID(id)
{
    return document.getElementById(id);
}

function search_ktv(key,value)
{
	
	if(value == '输入你想预订的KTV..')
	{
			value = '';
	}
	
	
	$.ajax({
		type:'POST',
		url:root + '?m=ktv.setKtvSearch&'+key + '=' + encodeURI(value),
		success: function (data) {
			
		},
		cache: false
	});	
	location.href=root + "ktv/list-1.html";
}


function setDefaultValue(id,defaultValue)
{
    $CID(id).style.color="#000000";
    if($CID(id).value==defaultValue)
    {
        $CID(id).value="";
    }
    else if($CID(id).value.replace(/^( )*|( )*$/ig,"")=="")
    {
        $CID(id).style.color="#999999";
        $CID(id).value=defaultValue;
    }
}

var my_scroll = 1;
function changetab(id,nums,str1,str2,oldclass,newclass){
	

   var obj1=document.getElementById(str1+id);
   var obj2=document.getElementById(str2+id);
   //var obj3=document.getElementById("ttkkfoot");
   //var obj4=document.getElementById("kkjjhhggff");
   
   
   
   for (i=1;i<=nums;i++){
      document.getElementById(str1+i).className=oldclass;
	  document.getElementById(str2+i).style.display="none";
   }
   obj1.className=newclass;
   obj2.style.display="block";
   
	 if(id == 2)
	{
		if(my_scroll == 1)
		{
			doscroll();
		}
		
		my_scroll = 0;
		

	}	
   if(id == 1)
   {
		document.getElementById(str1+'4').className=oldclass;
   }
   
   obj3.style.display="block"; 
   obj4.style.display="none"; 
  	
	 
   
}

function go_list()
{

	$.ajax({
		type:'POST',
		url:root + '?m=ktv.setKtvSearch&clear=1',
		success: function (data) {
		
		},
		cache: false
	});	
	location.href= root + "ktv/list-1.html";
}


function go_book(value)
{
	location.href = root + 'order/ktvBook-'+ value +'.html';
}




function del_order(id , num)
{

	 if (confirm("是否撤销该订单？")) { 
	 	$.ajax({
		type:'POST',
		url:root + '?m=order.del_Ktvorder&id=' + id,
		success: function (data) {
			$('#order').attr('value' , '1');
			
			var mydata = $("#O_Form").serialize();
			
			
			
			
		/*	$.ajax({
					type:'POST',
					url:root + 'msg/send_action.php?type=cancelOrder&num='+num,
					data:mydata,
					success: function (data2) {	
						alert(data2);
						return;
						//	window.location.href = root + "?m=ktv.ktvMmember";
					},
					cache: false
			});
			
			//$('#frm2').submit();*/
		},	
		cache: false
		});
	 }
	
	

}

function go_list_OrderBy(name)
{
	$('#orderBy').attr('value' , name);
	$('#ktv_Action').submit();

}



function doscroll(){

	$(function(){
		$("#spec-n5").jdMarquee({
			deriction:"left",
			width:532,
			height:96,
			step:2,
			speed:4,
			delay:10,
			control:true,
			_front:"#spec-left",
			_back:"#spec-right"
		});
		$("#spec-n5 p").eq(0).css({"border":"1px solid #ff000"});
		$("#spec-n5 img").eq(0).css({"border":"3px solid #ff6600"});
		$("#spec-n5 img").bind("mouseover",function(){
			var src=$(this).attr("src");
			$("#spec-n1 img").eq(0).attr({
				src:src.replace("\/n5\/","\/n1\/"),
				jqimg:src.replace("\/n5\/","\/n0\/")
			});
			$("#spec-n5 p").css({"border":"1px solid #d9d9d9"});	
			$("#spec-n5 img").css({"border":"3px solid #FFFFFF"});		
			$(this).parent().css({
				"border":"1px solid #ff6600"
			});
			$(this).css({
				"border":"3px solid #ff6600"
			});
		}).bind("mouseout",function(){
			$(this).parent().css({				   
			});
		});				
	})
}

