﻿
$(document).ready(function(){$("#newMenuArea").hover(function(){$("#newMenuArea>.newSubMenu").show();$("#newMenuArea>.newMenuInlet").removeClass("columnMenu");},function(){$("#newMenuArea>.newSubMenu").hide();$("#newMenuArea>.newMenuInlet").addClass("columnMenu");});$("#SelectSearch").selectbox({inputClass:"selectbox",containerClass:"selectbox_wrapper"});$("#TxtSearch").bind("focus",function(){$(this).removeClass("current");if($(this).val()=="请输入您想去的地方")
$(this).val("");else if($(this).val()=="请输入您想找的好友")
$(this).val("");else if($(this).val()=="请输入您想找的帖子")
$(this).val("");}).bind("blur",function(){$(this).addClass("current");});$("#searchInfo").bind("click",function(){if($("#SelectSearch_input").val()=="线路")
location.href="http://www.quyou.com/play/playSearch.aspx?title="+encodeURI($("#TxtSearch").val());else if($("#SelectSearch_input").val()=="会员")
location.href="http://www.quyou.com/sns/home/playSearchMember.aspx?un="+encodeURI($("#TxtSearch").val());else
location.href="http://www.quyou.com/play/bbsSearch.aspx?title="+encodeURI($("#TxtSearch").val());});if(document.getElementById("newMenuArea1")){new MoveUp(document.getElementById("lookback"),155*7,30,true);setModel(1,1,'btn','play','');setModel(2,1,'btn','play','');setModel(3,1,'btn','play','');}
if(document.getElementById("HdBannerIndex")){if($("#HdBannerIndex").val()<=6)
$(".menu_nav a:eq("+$("#HdBannerIndex").val()+")").addClass("cur");}
$(".select_all").toggle(function(){$(".play_search input[type=checkbox]").each(function(){$(this).attr("checked",true).parent().addClass("checked");});},function(){$(".play_search input[type=checkbox]").each(function(){$(this).attr("checked",false).parent().removeClass("checked");});});$(".play_search input[type=checkbox]").each(function(){$(this).bind("click",function(){if($(this).attr("checked")==undefined||$(this).attr("checked")==true)
$(this).attr("checked",true).parent().addClass("checked");else
$(this).attr("checked",false).parent().removeClass("checked");})})
if(document.getElementById("HdChk")){var chks=$("#HdChk").val().split(",");$.each(chks,function(n,value){$("#"+value).attr("checked",true).parent().addClass("checked");})}});function KeyDown(event){var keynum;if(window.event){keynum=window.event.keyCode;}else{keynum=event.which;}
if(keynum==13){var btn=document.getElementById("searchInfo");btn.focus();btn.click();}}
function SearchPlay(){var pclass=[],pmodel=[],ptype=[],ptime=[],pck=[];var value,id;$("#PlayClass>dd>input[type=checkbox]").each(function(){if($(this).attr("checked")=="checked"||$(this).attr("checked")==true){value=$(this).attr("value").split(",");pck.push($(this).attr("id"));if($.inArray(value[0],pclass)==-1)
pclass.push(value[0]);if(value.length>1&&$.inArray(value[1],pmodel)==-1){pmodel.push(value[1]);}}});$("#PlayTime>dd>input[type=checkbox]").each(function(){if($(this).attr("checked")=="checked"||$(this).attr("checked")==true){pck.push($(this).attr("id"));ptime.push($(this).attr("value"));}});$("#PlayFeature>dd>input[type=checkbox]").each(function(){if($(this).attr("checked")=="checked"||$(this).attr("checked")==true){id=$(this).attr("id");pck.push(id);value=$(this).attr("value").split(",");if(id.indexOf("CkType")!=-1&&$.inArray(value[0],ptype)==-1)
ptype.push(value[0]);else if(id.indexOf("CkModel")!=-1&&$.inArray(value[0],pmodel)==-1)
pmodel.push(value[0]);else{if($.inArray(value[0],pclass)==-1)
pclass.push(value[0]);if($.inArray(value[1],pmodel)==-1)
pmodel.push(value[1]);if($.inArray(value[2],ptype)==-1)
ptype.push(value[2]);}}});$("#PlayNature>dd>input[type=checkbox]").each(function(){if($(this).attr("checked")=="checked"||$(this).attr("checked")==true){id=$(this).attr("id");pck.push(id);value=$(this).attr("value").split(",");if(id.indexOf("CkType")!=-1&&$.inArray(value[0],ptype)==-1)
ptype.push(value[0]);else{if($.inArray(value[0],pmodel)==-1)
pmodel.push(value[0]);if($.inArray(value[1],ptype)==-1)
ptype.push(value[1]);}}});location.href="http://www.quyou.com/play/playSearch.aspx?class="+pclass.join(",")+"&model="+pmodel.join(",")+"&type="+ptype.join(",")+"&time="+ptime.join(",")+"&chk="+pck.join(",");}
function SearchMember(){location.href="http://www.quyou.com/sns/home/playSearchMember.aspx?un="+encodeURI($("#TxtUserName").val())+"&sex="+$("#SelectSex").val()+"&usertype="+encodeURI($("#SelectType").val());}
function SearchBbsTopic(){location.href="http://www.quyou.com/play/bbsSearch.aspx?title="+encodeURI($("#TxtTitle").val());}
function MoveUp(obj,height,outTime,noStop){var oThis=this;this.height=height||300;this.outTime=outTime||50;this.obj=obj;with(this.obj){style.overflowY="hidden";innerHTML="<div style='width:100%;'>"+innerHTML+"</div><div style='width:100%;'>"+innerHTML+"</div>";}
if(!noStop){this.obj.onmouseover=function(){clearTimeout(oThis.timer);}
this.obj.onmouseout=function(){oThis.position();}}
this.position();}
MoveUp.prototype.position=function(){var oThis=this;this.obj.scrollTop++;if(this.obj.scrollTop==this.height){this.obj.scrollTop=0;}
var doSetTimeout=function(){oThis.position();}
this.timer=setTimeout(doSetTimeout,this.outTime);};function setModel(mod,cla,btn,str,obj){var oparent=document.getElementById(str+"_"+mod+"_1").parentElement;if(oparent){for(var i=1;i<=oparent.childNodes.length;i++){if(document.getElementById(btn+"_"+mod+"_"+i)){if(document.getElementById(btn+"_"+mod+"_"+i).className!="no"){document.getElementById(btn+"_"+mod+"_"+i).className="";}
document.getElementById(str+"_"+mod+"_"+i).style.visibility="hidden";}}
document.getElementById(btn+"_"+mod+"_"+cla).className="cur";document.getElementById(str+"_"+mod+"_"+cla).style.visibility="visible";}else{oparent=document.getElementById(str+"_"+mod+"_1").parentNode;var j=0;for(var i=1;i<=oparent.childNodes.length;i++){if(oparent.childNodes[i]){if(oparent.childNodes[i].nodeType==1){j++;if(document.getElementById(btn+"_"+mod+"_"+j).getAttribute("class")!="no"){document.getElementById(btn+"_"+mod+"_"+j).setAttribute("class","");}
document.getElementById(str+"_"+mod+"_"+j).style.visibility="hidden";}}}
document.getElementById(btn+"_"+mod+"_"+cla).setAttribute("class","cur");document.getElementById(str+"_"+mod+"_"+cla).style.visibility="visible";}
if(obj!=""){document.getElementById(obj).innerHTML=document.getElementById(str+"_"+mod+"_"+cla).innerHTML;}}
function setPlay(obj){var oparent=obj.parentElement;if(oparent){for(var i=0;i<oparent.childNodes.length;i++){oparent.childNodes[i].className="";}
obj.className="cur";}else{oparent=obj.parentNode;var j=0;for(var i=1;i<=oparent.childNodes.length;i++){if(oparent.childNodes[i]){j++;if(oparent.childNodes[j].nodeType==1){oparent.childNodes[j].setAttribute("class","");}}}
obj.setAttribute("class","cur");}}
function ad_switch(swf_width,swf_height,flash_url,bgcolor,imgs,links,texts,config,old){if(old){swf_height=swf_height+config;}
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+swf_width+'" height="'+swf_height+'">');document.write('<param name="allowScriptAccess" value="sameDomain"/>');document.write('<param name="movie" value="'+flash_url+'"/><param name="quality" value="high"/>');document.write('<param name="menu" value="false"/>');if(bgcolor==""){document.write('<param name="wmode" value="transparent"/>');}else{document.write('<param name="wmode" value="opaque"/><param name="bgcolor" value="'+bgcolor+'"/>');}
if(old){document.write('<param name="FlashVars" value="pics='+imgs+'&links='+links+'&texts='+texts+'&borderwidth='+swf_width+'&borderheight='+swf_height+'&textheight='+config+'">');document.write('<embed src="'+flash_url+'" wmode="transparent" FlashVars="pics='+imgs+'&links='+links+'&texts='+texts+'&borderwidth='+swf_width+'&borderheight='+swf_height+'&textheight='+config+'" menu="false" bgcolor="'+bgcolor+'" quality="high" width="'+swf_width+'" height="'+swf_height+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');}else{document.write('<param name="FlashVars" value="bcastr_file='+imgs+'&bcastr_link='+links+'&bcastr_title='+texts+'&bcastr_config='+config+'"/>');document.write('<embed src="'+flash_url+'" wmode="transparent" FlashVars="bcastr_file='+imgs+'&amp;bcastr_config='+config+'&amp; bcastr_link='+links+'&amp; bcastr_title='+texts+'" menu="false" quality="high" width="'+swf_width+'" height="'+swf_height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');}
document.write('</object>');}
function modalDialog(url,str,width,height,modal){var result=null;var _top=(window.screen.availHeight-30-height)/2;var _left=(window.screen.availWidth-10-width)/2;var ieFeatures="center:yes; dialogWidth="+width+"px; dialogHeight="+height+"px; help:no; status:no; resizable:no;";var otherFeatures="width="+width+"px, height="+height+"px, left="+_left+"px, top="+_top+"px, help=no, status=no, resizable=no";if(modal=="yes"){window.openSonModel=true;}else{window.openSonModel=false;}
otherFeatures+=", modal="+modal;result=window.open(url,'_blank',otherFeatures);return result;}
function getCode(objstr,src){document.getElementById(objstr).innerHTML='<img src="'+src+'inc/getcode.asp?'+Math.round(Math.random()*10000)+'" />';}
function hidCode(objstr){document.getElementById(objstr).innerHTML='';}
function chkSelect(obj,src){if(obj[0].selected){for(var i=1;i<obj.length;i++){obj[i].selected=false;}
return true;}else{for(var i=1;i<obj.length;i++){if(obj[i].selected){return true;}}
if(src){return false;}else{obj[0].selected=true;return true;}}}
function getRadio(obj){for(var i=0;i<obj.length;i++){if(obj[i].checked){return obj[i].value;}}
return false;}
function turnCardCode(str){str=str.replace(/ /g,"");str=str.replace(/　/g,"");str=str.replace(/x/g,"X");str=str.replace(/,/g,"_");str=str.replace(/\|/g,"_");return str;}
function getCardCode(str){str=turnCardCode(str);var y,m,d,s;if(str.length==18){y=str.substr(6,4);m=str.substr(10,2);d=str.substr(12,2);s=str.substr(16,1);}else if(str.length==15){y=str.substr(6,2);y>40?y="19"+y:y="20"+y;m=str.substr(8,2);d=str.substr(10,2);s=str.substr(14,1);}else{return;}
s%2>0?s="男":s="女";return{year:parseInt(y,10),month:parseInt(m,10),day:parseInt(d,10),sex:s};}
function formatCardCode(obj){var tmp="";var str=turnCardCode(obj.value);if(str.length==18){tmp=str.substr(0,3)+" "+str.substr(3,3)+" "+str.substr(6,4)+" "+str.substr(10,4)+" "+str.substr(14,4);}else if(str.length==15){tmp=str.substr(0,3)+" "+str.substr(3,3)+" "+str.substr(6,2)+" "+str.substr(8,4)+" "+str.substr(12,3);}else{for(var i=0;i<str.length;i+=3){tmp+=str.substr(i,3)+" ";}}
obj.value=trim(tmp);}
function checkCardCode(str){str=turnCardCode(str);if(!isIdCorrect(str)){return false;}else if(str.length==18){if(parseInt(str.substr(6,4),10)>2100||parseInt(str.substr(6,4),10)<1940||parseInt(str.substr(10,2),10)>12||parseInt(str.substr(10,2),10)<1||parseInt(str.substr(12,2),10)>31||parseInt(str.substr(12,2),10)<1){return false;}}else if(str.length==15){if(parseInt(str.substr(8,2),10)>12||parseInt(str.substr(8,2),10)<1||parseInt(str.substr(10,2),10)>31||parseInt(str.substr(10,2),10)<1){return false;}}else{return false;}
return true;}
function trim(str,chr){if(!chr)chr=" ";while((str.length>0)&&(str.charAt(0)==chr))str=str.substring(1,str.length);while((str.length>0)&&(str.charAt(str.length-1)==chr))str=str.substring(0,str.length-1);return str;}
function isNum(src,mode){var strNum=/^\d+$/;if(mode){strNum=/^(\-+)?\d+$/;}
return(strNum.test(src));}
function isDate(src){var str;var strDate=/^((19\d{2})|(20\d{2}))+\-((\d{1})|(0[1-9])|(1[0-2]))+\-((\d{1})|(0[1-9])|([1-2][0-9])|(3[0-1]))$/;var strTime=/^(([0-9])|([0-1][0-9])|(2[0-3]))+:+([0-5][0-9])+(:+([0-5][0-9]))?$/;str=src.split(' ');switch(str.length){case 1:return(strDate.test(str[0]));break;case 2:return(strDate.test(str[0])&&strTime.test(str[1]));break;default:return false;}}
function isIdCorrect(src){isIdCorrect1=/^\d{15}$/;isIdCorrect2=/^\d{18}$/;isIdCorrect3=/^(\d{17})+([xX]?)$/;return(isIdCorrect1.test(src)||isIdCorrect2.test(src)||isIdCorrect3.test(src));}
function addLink(link,params,value){location.href=link+params+encodeURI(value);}
function checkEmail(txt){$("#emailerror").html("");var regEmail=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;if(!regEmail.test(txt.value)){$("#emailerror").html("邮箱格式不正确！");}}
function feedback(){var cont=$.trim($("#TxtFeedBack").val());$("#feedbackerror").html("");if(cont==null||cont=="")
{$("#TxtFeedBack").val("");$("#feedbackerror").html("请输入问题描述！");return false;}
var email=$.trim($("#TxtEmail").val());$("#emailerror").html("");if(email==null||email=="")
{$("#TxtEmail").val("");$("#emailerror").html("请输入电子邮箱！");return false;}
var telno=$.trim($("#TxtTelNo").val());var valid=$.trim($("#TxtValid").val());$("#validerror").html("");if(valid==null||valid=="")
{$("#TxtValid").val("");$("#validerror").html("请输入验证码！");return false;}
$.post("../ajax/ajaxWebFeedback.aspx",{type:"insert",cont:cont,email:email,telno:telno,valid:valid},function(data){if(data=="success"){alert("意见反馈添加成功！");addLink('aboutQuyou.aspx','?title=','意见反馈');}else
alert(data);})}
