﻿var Image_list = "";
function $(cr_name){
	var name = document.getElementById(cr_name);
	return name;
}
function f$(cr_name){
	
}
function isIE(){
    if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
        return true; 
    else 
        return false; 
} 

if(!isIE()){
    HTMLElement.prototype.__defineGetter__(    "innerText", 
        function(){ 
            return this.textContent.replace(/(^\s*)|(\s*$)/g, "");
        } 
    ); 
    HTMLElement.prototype.__defineSetter__(    "innerText", 
        function(sText){ 
            this.textContent=sText; 
        } 
    ); 
    HTMLElement.prototype.__defineGetter__(    "innerHTML", 
        function(){ 
            return this.textContent.replace(/(^\s*)|(\s*$)/g, "");
        } 
    ); 
    HTMLElement.prototype.__defineSetter__(    "innerHTML", 
        function(sText){ 
            this.textContent=sText; 
        } 
    ); 
}
function setImage_list(lth){
	Image_list = lth;
}
String.prototype.trim=function()
{
	return this.replace(/(^\s*)|(\s*$)/g,"");
} 
function changTitileImage(){
	var change = $("ImageTitle").value;
	var image_value = "";
	if(change == "shouye" && change !=""){
		$("mazhai0").className="black3";
		return;
	}else{
		for(var i=1;i<Image_list;i++){
			image_value = $("mazhai"+i).innerText.trim();
			change_value = change.trim();
			if(change_value == image_value){
				 $("mazhai"+i).className="black3";
			}
		}
	}
}
function JHshNumberText() {
	var code=window.event.keyCode;
	var value1=$("mazhai_textfield").value;
	var value2=$("mazhai_textfield2").value;
	if(value1.indexOf(".")!=-1&&code==46){
					window.event.keyCode=0;
	}
	if(value2.indexOf(".")!=-1&&code==46){
					window.event.keyCode=0;
	}
  if (!((code>=46)&&(code <= 57))) {
          window.event.keyCode=0;
  }else{
 	var str = $("mazhai_textfield").value;
  		if(code==47){
  			window.event.keyCode=0;
  		}
  }
  if(code == 13){
		getSum();
	}
}
function gotoSearch(){
	var searchInput=document.getElementById("input_serach");
	if(searchInput.value==''){
		alert("请输入搜索内容!");
		searchInput.focus();
		return false;
	}
	else{
	 	document.charset='utf-8';
	 	return true;
	}
}
