// JavaScript Document

function ch(){

var se =document.getElementById("se");   
           var option=se.getElementsByTagName("option");   
           for(var i=0;i<option.length;++i)  
           {   
               if(option[i].selected)   
               {   
			     //var strs=option[i].text;
				 //var num=strs.indexOf("￥");
				 //var strjg=strs.substr(num+1,4);
				 //var jgstr=strjg.replace("元","")
				   document.form.jg.value=option[i].value;  
				   document.form.num.value=1;
                   //alert(option[i].text);   
               }
			     
           }   
}

function chnum(){
var se =document.getElementById("se");   
var option=se.getElementsByTagName("option");
for(var i=0;i<option.length;++i)  
           {   
               if(option[i].selected)   
               {   
			   		price  = option[i].value;
			   }
			   
		   }
var num=document.getElementById("num").value;
var hj=num*price;
document.getElementById("jg").value=hj;
}
function check(){
if (document.form.xm.value.length  ==  0)  {  
alert("请输入您的真实姓名!");
document.form.xm.focus();
return  false;
}
if (document.form.tel.value.length <7)  {  
alert("请输入手机号码或 区号+电话号码!");
document.form.tel.focus();
return  false;
}
/*if (document.form.code.value.length != 6){
alert("请输入6位数的邮政编码!");
document.form.code.focus();
return false;
}*/
/*
if (document.form.email.value  ==  0 )  {  
alert("请填写Email!");
document.form.email.focus();
return  false;
}*/
if (document.form.email.value > 0 && !document.form.email.value.match( /^.+@.+$/ ) ) {
     alert("EMAIL 错误！请重新输入");
     document.form.email.focus();
  	return false;
} 
if (document.form.nativeplace_top.value  ==  0)  {  
alert("请选择您所在的省!");
document.form.nativeplace_top.focus();
return  false;
}else if(document.form.nativeplace_son.value  ==  0){
	alert("请选择您所在的市/区!");
	document.form.nativeplace_son.focus();
	return  false;	
}else if(typeof document.form.nativeplace_end  !=  'undefined'){
	if(document.form.nativeplace_end.value ==0){
	alert("请选择您所在的县!");
	document.form.nativeplace_end.focus();
	return  false;	
	}
}
if (document.form.address.value  ==  0)  {  
alert("请填写详细地址!");
document.form.address.focus();
return  false;
}
var nativeplace_top = document.getElementById("nativeplace_top");
var option1=nativeplace_top.getElementsByTagName("option");
for(var i=0;i<option1.length;++i)  
           {   
               if(option1[i].selected)   
               {   
			   		document.form.nativeplace_top_value.value = option1[i].text;
			   }
		   }
var nativeplace_son = document.getElementById("nativeplace_son"); 
var option2=nativeplace_son.getElementsByTagName("option");
for(var i=0;i<option2.length;++i)  
           {   
               if(option2[i].selected)   
               {   
			   		document.form.nativeplace_son_value.value = option2[i].text;
			   }
		   }
//if(document.getElementById("span_nativeplace_end").innerHTML != "" ){
	var object = document.getElementById("nativeplace_end");
if( typeof object == "undefined"){
	return true;
}else{
	var nativeplace_end = document.getElementById("nativeplace_end");
	var option3=nativeplace_end.getElementsByTagName("option");
	for(var i=0;i<option3.length;++i)  
    	       {   
        	       if(option3[i].selected)   
            	   {   
			   			document.form.nativeplace_end_value.value = option3[i].text;
			       }
		   	   }	
}

return  true;
}


function bookmark(){ 
window.external.AddFavorite('http://www.gpkdtx.com', '高频考点透析 2010中高考制胜法宝 官方网站') 
}  
