// JavaScript Document

/* window.onload事件调用函数
--------------------------------------------------------------*/
function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	}else{
		window.onload = function(){
			oldonload();
			func();
		}
	}
}

/* 在targetElement接电后插入newElement节点
--------------------------------------------------------------*/
function insertAfter(newElement,targetElement){
	var parent = targetElement.parentNode;
	if(parent.lastChild == targetElement){
		return parent.appendChild(newElement);
	}else{
		return parent.insertBefore(newElement,targetElement.nextSibling);
	}
}


/* =全角转化半角函数;
---------------------------------------------------------------------------*/
function meizz(str) {   
	var tmp = "";   
	for(var i=0; i<str.length; i++) {   
		if(str.charCodeAt(i)>65248) {   
			tmp+=String.fromCharCode(str.charCodeAt(i)-65248);   
		} else {   
			tmp+=str.charAt(i);   
		}   
	}   
	return tmp;   
}