
//load func

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}


//purchase pages,show text in table

function showhide() {
	var hidetext = this.nextSibling;
	if(hidetext.nodeType == 3) {
		hidetext = hidetext.nextSibling;
	}
    hidetext.className = (hidetext.className == "") ? "show":"";
	getheight();
}

function purchase_show() {
	if(!document.getElementById("show_table")) return false;
	var show_table = document.getElementById("show_table");
	var strongs = show_table.getElementsByTagName("strong");
	for(var j=0; j<strongs.length; j++) {
		if(strongs[j].className == "showhide") {
			strongs[j].onclick = showhide;
		}
	}
}

addLoadEvent(purchase_show);
	
	
//all menu effects

//this func only for some cate which have return menu
function rightmenuHover(menuobj) {
	var links = menuobj.getElementsByTagName("a");
	var windowLocationhref = window.location.href.split("/");
	var locationHref;
	if(windowLocationhref[windowLocationhref.length-1] == "") {
		locationHref = windowLocationhref[windowLocationhref.length-2];
	} else {
		locationHref = windowLocationhref[windowLocationhref.length-1];
	}
	for(i=0; i<links.length; i++) {
		var linksHref = links[i].href.split("/");
		var linksrighthref;
		if(linksHref[linksHref.length-1] == "") {
			linksrighthref = linksHref[linksHref.length-2];
		} else {
			linksrighthref = linksHref[linksHref.length-1];
		}
		if(locationHref == linksrighthref) {
			links[i].className = 'here';
		} else {
			links[i].className = '';
		}
		links[i].onmouseover = function() {
			for(j=0; j<links.length; j++) {
				links[j].className = '';
			}
			this.className = 'here';
		}
		links[i].onmouseout = function() {
			for(j=0; j<links.length; j++) {
				links[j].className = '';
				var linksHref2 = links[j].href.split("/");
				var linksrighthref2;
				if(linksHref2[linksHref2.length-1] == "") {
					linksrighthref2 = linksHref2[linksHref2.length-2];
				} else {
					linksrighthref2 = linksHref2[linksHref2.length-1];
				}
				if(locationHref == linksrighthref2) {
					links[j].className = 'here';
				}
			}
	}
	}
}

//for common menu
function topmenuHover(menuobj) {
	var links = menuobj.getElementsByTagName("a");
	for(i=0; i<links.length; i++) {
		if(window.location.href.indexOf(links[i].href) != -1) {
			links[i].className = 'here';
		} else {
			links[i].className = '';
		}
		links[i].onmouseover = function() {
			for(j=0; j<links.length; j++) {
				links[j].className = '';
			}
			this.className = 'here';
		}
		links[i].onmouseout = function() {
			for(j=0; j<links.length; j++) {
				links[j].className = '';
				if(window.location.href.indexOf(links[j].href) != -1) {
					links[j].className = 'here';
				}
			}
	}
	}
}

////top menu effect
//function topmenu () {
//	if(!document.getElementById("header")) return false;
//	var menuobj = document.getElementById("header");
//	topmenuHover(menuobj);
//}
//
////right menu effect
//function rightmenu () {
//	if(!document.getElementById("right")) return false;
//	var menuobj = document.getElementById("right");
//	rightmenuHover(menuobj);
//}
//
//addLoadEvent(topmenu);
//addLoadEvent(rightmenu);

//top menu effect
function topmenu () {
	if(!document.getElementById("menu")) return false;
	var menuobj = document.getElementById("menu");
	topmenuHover(menuobj);
}

//right menu effect
function rightmenu () {
	if(!document.getElementById("right")) return false;
	var menuobj = document.getElementById("right");
	rightmenuHover(menuobj);
}

addLoadEvent(topmenu);
addLoadEvent(rightmenu);



function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}

function fav() {
	if (window.sidebar) { // for Firefox
		window.sidebar.addPanel(document.title, location.href, "");
	} else { // for IE
		window.external.AddFavorite(location.href, document.title);
	}
}

function fav() {
	if (window.sidebar) { // for Firefox
		window.sidebar.addPanel(document.title, location.href, "");
	} else { // for IE
		window.external.AddFavorite(location.href, document.title);
	}
}

<!--
	function SymError()   
	{
	  return true;   
	}
	window.onerror=SymError;  
//--> 



<!--
$ = function(s) {return (typeof s == 'object') ? s: document.getElementById(s);}
function setPng(img, w, h) {
	ua = window.navigator.userAgent.toLowerCase();
	if(!/msie/.test(ua))
		return;
	imgStyle = "display:inline-block;" + img.style.cssText;
	strNewHTML = "<span style=\"width:" + w + "px; height:" + h + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src + "', sizingMethod='scale');\"></span>";
	img.outerHTML = strNewHTML;
}
//-->
