function winopen(url)
{
window.open(url,"search","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=yes,width=670,height=500,top=200,left=100");
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function eshop(id) { window.open("cart.asp?cpbm="+id,"","height=400,width=810,left=200,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}

function jump_page(VALUE_STR){
location='index.asp?page='+VALUE_STR
}

function change(a)
{
  window.document.images["img1"].src = a;
}





//zhu
var ResizeImageWidthMax=125
var ResizeImageHeightMax=90
function resizeImagesByWidth(){
	var imgs=document.images
	for(var i=0;i<imgs.length;i++){
		if(imgs[i].getAttribute("resize",false)!="1"){continue;}
		if(imgs[i].width>=ResizeImageWidthMax & imgs[i].width>=imgs[i].height){
		imgs[i].width=ResizeImageWidthMax
//		imgs[i].outerHTML = "<a href='../WebPages/PicShow.asp?PicName="+imgs[i].id+"' target=_blank>" +imgs[i].outerHTML+"</a>"
		}
		if(imgs[i].height>=ResizeImageHeightMax & imgs[i].width<=imgs[i].height){
		imgs[i].height=ResizeImageHeightMax
//		imgs[i].outerHTML = "<a href='../WebPages/PicShow.asp?PicName="+imgs[i].id+"' target=_blank>" +imgs[i].outerHTML+"</a>"
		}
	}
}
window.onload = resizeImagesByWidth
var menushow;
function showmenu(menu){ 
    if(menushow) 
    menushow.style.visibility="hidden" 
    menushow=menu 
    menu.style.visibility="visible" 
} 
function hidemenu(menu){ 
    menu.style.visibility="hidden" 
} 
function hideshow() 
{ 
    if(menushow) 
    menushow.style.visibility="hidden" 
}


function CheckSearch()
{
	if(document.Search.KeyWord.value=="")
	{
		alert("请输入“关键字”！");
		document.Search.KeyWord.focus();
		return(false);
	}
}

//双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow ()",50);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc;
document.ondblclick=initialize;

function fontsize(size){
document.getElementById('content').style.fontSize=size+'px';
}

//不需要CTRL
function bbimg(o){
var zoom = parseInt(o.style.zoom, 10) || 100;
zoom -= event.wheelDelta / 12;
if(zoom > 0) {
o.style.zoom = zoom + '%';
}
return false;

}

/*--需要CTRL
function bbimg1(o){
if(event.ctrlKey) {
var zoom = parseInt(o.style.zoom, 10) || 100;
zoom -= event.wheelDelta / 12;
if(zoom > 0) {
o.style.zoom = zoom + '%';
}
return false;
} else {
return true;
}
}
--*/

function gocontent(){
	document.all("content").value=IframeID.document.body.innerHTML;
}

function AddItem(strFileName){
  document.myform.IncludePic.checked=true;
  document.myform.IndexPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}
function showmenu(buyok){ 
if(document.getElementById(buyok).style.display=="none"){
        document.getElementById(buyok).style.display="";
        //img.src="images/doc_3.gif";
        } else {
        document.getElementById(buyok).style.display="none"; 
        //img.src="images/doc_3.gif";
        }
}

function showson(father,son)
    {
        if (document.getElementById(son)==null)
		{
          document.getElementById(father).style.display="";
		  
		}else
		{
		  document.getElementById(father).style.display="";
		  document.getElementById(son).style.display="";
		}
       	
    }
function Show(divid) {

divid.style.visibility = "visible"; 

}


function Hide(divid) {

divid.style.visibility = "hidden";

} 

//step.asp
function stepjs()
{
if(checkspace(document.stepinfo.Somane.value)) {
	document.stepinfo.Somane.focus();
    alert("Sorry Please Confirm your firstname is correct!");
	return false;
  }
  

if(document.stepinfo.email.value.length!=0)
  {
    if (document.stepinfo.email.value.charAt(0)=="." ||        
         document.stepinfo.email.value.charAt(0)=="@"||       
         document.stepinfo.email.value.indexOf('@', 0) == -1 || 
         document.stepinfo.email.value.indexOf('.', 0) == -1 || 
         document.stepinfo.email.value.lastIndexOf("@")==document.stepinfo.email.value.length-1 || 
         document.stepinfo.email.value.lastIndexOf(".")==document.stepinfo.email.value.length-1)
     {
      alert("Sorry Please Confirm your Email is correct!");
      document.stepinfo.email.focus();
      return false;
      }
   }
 else
  {
   alert("Sorry Please Confirm your Email is correct!");
   document.stepinfo.email.focus();
   return false;
   }

if(checkspace(document.stepinfo.Phone.value)) {
	document.stepinfo.Phone.focus();
    alert("Sorry Please Confirm your call is correct!");
	return false;
  }

  
  
  if(checkspace(document.stepinfo.Add.value)) {
	document.stepinfo.Add.focus();
    alert("Sorry Please Confirm your address is correct!");
	return false;
  }
  if(checkspace(document.stepinfo.Zip.value)) {
	document.stepinfo.Zip.focus();
    alert("Sorry Please Confirm your postcode is correct!");
	return false;
  }
    if(document.stepinfo.remarks.value.length > 200 ) {
	document.stepinfo.remarks.focus();
    alert("Not more than 200 characters!");
	return false;
  }

}




