//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 checkForm()
{
  if(document.UserLogint.username.value=="") {
	document.UserLogint.username.focus();
    alert("username can not be empty！");
	return false;
  }
  if(document.UserLogint.password.value=="") {
	document.UserLogint.password.focus();
    alert("password can not be empty！");
	return false;
  }
    document.UserLogint.action="http://www.ccbagcc.com/wellcomeorder/UserLogin.asp";
	document.UserLogint.submit();
  }

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,img)
    {
        if(buyok.style.display=="none"){
        buyok.style.display="";
        img.src="images/tree_folder3.gif";
        } else {
        buyok.style.display="none"; 
        img.src="images/tree_folder4.gif";
        }
    }


