
function togglePanel() {

	var panel = document.getElementById('panelMore');
	var panelControl = document.getElementById('morePanel');
	var panelBtn = panelControl.getElementsByTagName('a')[0];
	panelBtn.blur();

	if (panel.style.display == '' || panel.style.display == 'none') {
		panel.style.display = 'block';
		panelBtn.style.backgroundImage = 'url(/images/arrow_up_gray.gif)';
		panelBtn.firstChild.data = '隐藏';
	} else {
		panel.style.display = 'none';
		panelBtn.style.backgroundImage = 'url(/images/arrow_down_gray.gif)';
		panelBtn.firstChild.data = '更多';
	}
}
function initPanel() {
  var g_morePanel=document.getElementById('morePanel');
  if(g_morePanel)
  {
    g_morePanel.getElementsByTagName('a')[0].onclick = togglePanel;
  }

}
//window.onload = initPanel;

function dropMenu(btn, menu) {
	btn.className = 'active';
}
function hideMenu(btn, menu) {
	btn.className = '';
}

function setAttributeById(ctlid, attrname, attrvalue) {
  if(document.getElementById(ctlid).setAttribute) {
    document.getElementById(ctlid).setAttribute(attrname, attrvalue)
      alert(document.getElementById(ctlid).getAttribute(attrname))
  }
}

function setClassNameById(ctlid, param_512_value) {
  document.getElementById(ctlid).className=param_512_value
}

function getClassNameById(ctlid) {
  return document.getElementById(ctlid).className
}

function limitImageW(param_objImg,param_355_width) {
  if(param_objImg.width) {
    if(param_objImg.width>param_355_width) {
      param_objImg.width = param_355_width
    }
  }
}

function limitImageH(param_objImg,param_355_height) {
  if(param_objImg.height) {
    if(param_objImg.height>param_355_height) {
      param_objImg.height = param_355_height
    }
  }
}

function limitImage(param_objImg,param_355_length) {
  if(param_objImg.width&&param_objImg.height) {
    if(param_objImg.width>=param_objImg.height) {
      limitImageW(param_objImg,param_355_length);
    } else {
      limitImageH(param_objImg,param_355_length);
    }
  }
}

function limitImageWH(param_objImg,param_355_width,param_355_height) {
  limitImageW(param_objImg,param_355_width);
  limitImageH(param_objImg,param_355_height);
}

function setDisplayById(ctlid, param_512_dispaly) {
  document.getElementById(ctlid).style.display = param_512_dispaly
}

function switchDisplayById(ctlid) {
  if(document.getElementById(ctlid).style.display=="none") {
    document.getElementById(ctlid).style.display="block"
  } else {
    document.getElementById(ctlid).style.display="none"
  }
}

function showMenu(obj){
  if(obj.style.display!="block"){
    obj.style.display="block";
  }
}
function hiddenMenu(obj){
  if(obj.style.display!="none"){
    obj.style.display="none";
  }
}
