|
hand_x = new Array(10,10,260,510,760);
|
|
hand_y = new Array(10,280,280,280,280);
|
|
hand_m = new Array(100,100,0,0,0);
|
|
btn_x = new Array(0,90,180,0,90);
|
|
btn_y = new Array(340,340,340,370,370);
|
|
for (hand_idx=0; hand_idx<5; hand_idx++)
|
|
{
|
|
|
document.write("<div style=\"left: "+hand_x[hand_idx]+"px; top: "+hand_y[hand_idx]+"px;\"><div style=\"height: "+hand_m[hand_idx]+"px;\">");
|
|
|
for (card_idx=0; card_idx<11; card_idx++)
|
|
|
{
|
| // |
|
|
document.write("<img id=\"card_"+hand_idx+"_"+card_idx+"x\" src=\"images/vcasino/cards/000.gif\" style=\"visibility:hidden; position:absolute; left:"+(card_idx*16)+"px; top: 0px;\" />");
|
|
|
|
document.write("<img id=\"card_"+hand_idx+"_"+card_idx+"x\" src=\"images/vcasino/cards/000.gif\" style=\"visibility:hidden; left:"+(card_idx*16)+"px; top:0px\" />");
|
|
|
}
|
|
|
document.write("</div><div><input name=\"mess_"+hand_idx+"x\" readonly=\"readonly\" style=\"color: black; font-weight:bold; background-color:#00C000; border:0\" />
");
|
|
|
if (hand_idx>0)
|
|
|
{
|
|
|
|
for (b_idx=0; b_idx<5; b_idx++)
|
|
|
|
{
|
|
|
|
|
document.write("<input type=\"button\" id=\"test\" name=\"button_"+hand_idx+"_"+b_idx+"x\" Value=\"XXXXXX\" onclick=\"do_click(this.value)\"");
|
| |
|
|
|
document.write("style=\"height:25; width:85; font-size: 12px; visibility:hidden; left:"+btn_x[b_idx]+"px; top:"+btn_y[b_idx]+"px\" />");
|
|
|
|
}
|
|
|
}
|
|
|
document.write("</div>");
|
|
}
|
|
|
|
lang_poor = "您没有足够的 北美盾, 请您到论坛努力发帖, 或通过其它途径致富.";
|
|
lang_hit="要牌";
|
|
lang_stand="比较大小";
|
|
lang_split="分牌";
|
|
lang_srndr="头像";
|
|
lang_double="双倍下注";
|
|
lang_yes="是";
|
|
lang_no="否";
|
|
lang_bet="下注";
|
|
lang_bet1="下注 2";
|
|
lang_bet2="下注 5";
|
|
lang_bet3="下注 20";
|
|
cardn=new Array();
|
|
cardn[0]=new Array();
|
|
cardn[1]=new Array();
|
|
cardn[2]=new Array();
|
|
cardn[3]=new Array();
|
|
cardn[4]=new Array();
|
|
buttonn=new Array();
|
|
buttonn[0]=new Array();
|
|
buttonn[1]=new Array();
|
|
buttonn[2]=new Array();
|
|
buttonn[3]=new Array();
|
|
buttonn[4]=new Array();
|
|
messn=new Array(); |
|
|
|
|
|
myform=(document.all)?document.all("myformx"):document.getElementById("myformx");
|
|
for (hand_idx=0; hand_idx<5; hand_idx++)
|
|
{
|
|
|
for (card_idx=0; card_idx<11; card_idx++)
|
|
|
{
|
|
|
|
cardnx = "card_"+hand_idx+"_"+card_idx+"x";
|
|
|
|
cardn[hand_idx][card_idx]=(document.all)?document.all(cardnx):document.getElementById(cardnx); |
|
|
|
|
|
|
|
}
|
|
|
messnx = "mess_"+hand_idx+"x";
|
|
|
messn[hand_idx] =eval("myform." + messnx); |
|
|
|
|
|
|
|
|
|
if (hand_idx>0)
|
|
|
{
|
|
|
|
for (b_idx=0; b_idx<5; b_idx++)
|
|
|
|
{
|
|
|
|
|
buttonx = "button_"+hand_idx+"_"+b_idx+"x";
|
|
|
|
|
buttonn[hand_idx][b_idx]=eval("myform."+ buttonx); |
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
}
|
|
|
|
messn[1].value="请选择您的赌注!" |
|
|
get_bet();
|
|
|
|
function get_bet()
|
|
{
|
|
|
buttonn[1][0].value=lang_bet1;
|
|
|
buttonn[1][1].value=lang_bet2;
|
|
|
buttonn[1][2].value=lang_bet3;;
|
|
|
buttonn[1][0].style.visibility="visible";
|
|
|
buttonn[1][1].style.visibility="visible";
|
|
|
buttonn[1][2].style.visibility="visible";
|
|
}
|
|
|
|
|
|
function do_click(Action)
|
|
{
|
|
|
if (is_running==1)
|
|
|
{
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
is_running=1;
|
|
|
url="";
|
|
|
rnd = Math.random().toString().substring(2);
|
|
|
if (Action.substring(0,lang_bet.length)==lang_bet)
|
|
|
{
|
|
|
|
points = Action.substring(lang_bet.length+1);
|
|
|
|
var cash = parseInt(myform.cashleft.value);
|
|
|
|
if(cash < points)
|
|
|
|
{
|
|
|
|
|
is_running = 0;
|
|
|
|
|
alert(lang_poor);
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Action= "bet " + points;
|
|
|
|
for (hand_idx=0; hand_idx<5; hand_idx++)
|
|
|
|
{
|
|
|
|
|
for (card_idx=0; card_idx<11; card_idx++)
|
|
|
|
|
{
|
|
|
|
|
|
cardn[hand_idx][card_idx].src = "images/vcasino/cards/000.gif";
|
|
|
|
|
}
|
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
|
if(Action == lang_hit)
|
|
|
|
|
Action = "Hit";
|
|
|
|
else if(Action == lang_split)
|
|
|
|
|
Action = "Split";
|
|
|
|
else if(Action == lang_double)
|
|
|
|
|
Action = "Double";
|
|
|
|
else if(Action == lang_stand)
|
|
|
|
|
Action = "Stand";
|
|
|
|
else if(Action == lang_yes)
|
|
|
|
|
Action = "Yes";
|
|
|
|
else if(Action == lang_no)
|
|
|
|
|
Action = "No";
|
|
|
}
|
|
|
|
|
|
url = 'http://www.westca.com/index.php?name=Forums&file=vc_bj' +'&action='+Action;
|
|
|
//alert(url);
|
|
|
objHttpVCBJ.open("POST",url, true);
|
|
|
objHttpVCBJ.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
|
|
|
objHttpVCBJ.onreadystatechange = handleHttpVCBJ;
|
|
|
objHttpVCBJ.send('rnd='+rnd);
|
|
}
|
|
|
|
function handleHttpVCBJ()
|
|
{
|
|
|
if (objHttpVCBJ.readyState == 4)
|
|
|
{
|
|
|
|
inString= objHttpVCBJ.responseText;
|
|
|
|
//alert(inString);
|
|
|
|
inArray = inString.split("#");
|
|
|
|
inArray3=inArray[inArray.length-1].split("|");
|
|
|
|
myform.cashleft.value=inArray3[0];
|
|
|
|
for (hand_idx=0; hand_idx<5; hand_idx++)
|
|
|
|
{
|
|
|
|
|
if (hand_idx<inArray.length-1)
|
|
|
|
|
{
|
|
|
|
|
|
inArray2=inArray[hand_idx].split("|");
|
|
|
|
|
|
messn[hand_idx].value=inArray2[0];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
messn[hand_idx].value="";
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
for (card_idx=1; card_idx<12; card_idx++)
|
|
|
|
|
{
|
|
|
|
|
|
if (hand_idx<inArray.length-1 && card_idx<inArray2.length)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
cardn[hand_idx][card_idx-1].src = "images/vcasino/cards/"+inArray2[card_idx]+".gif";
|
|
|
|
|
|
|
cardn[hand_idx][card_idx-1].style.visibility="visible";
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
|
cardn[hand_idx][card_idx-1].style.visibility="hidden";
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hand_idx>0)
|
|
|
|
|
{
|
|
|
|
|
|
for (b_idx=0; b_idx<5; b_idx++)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
if (hand_idx==inArray3[1] && b_idx+2<inArray3.length)
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
buttonn[hand_idx][b_idx].value = inArray3[b_idx+2];
|
|
|
|
|
|
|
|
buttonn[hand_idx][b_idx].style.visibility="visible";
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
buttonn[hand_idx][b_idx].style.visibility="hidden";
|
|
|
|
|
|
|
}
|
|
|
|
|
|
} |
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
is_running=0;
|
|
|
} |
|
|
}
|