/* <![CDATA[ */var loadingTag = "Loading..";/* ]]> */
var req = null;
var flashing;
function GetHTTPRequest() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if (window.ActiveXObject) {
  	return new ActiveXObject("Microsoft.XMLHTTP");
	}
}
function cascadeCate(id,name,cateid) {
	req = GetHTTPRequest();
  req.open("GET", 'get_cate.php?id=' + id + '&name=' + name +'&c=' + cateid, true);  
 	req.onreadystatechange = function() {
	  if(req.readyState == 4) {
	    if (req.status == 200) {
	  		document.getElementById(id).innerHTML = req.responseText;
	    }
	  } 	  
	}
	document.getElementById(id).innerHTML="&nbsp;&nbsp;"+loadingTag;
  req.send(null);
}

function mkImg(id,imgFile){
  document.getElementById(id).style.background ='url('+imgFile+')';
}
function mkFlash(reqVer,flaFile,flaWidth,flaHeight,flaBgcolor,flaLoop,noflaFile){  
	/*no Flash*/
	var noFla = '';

	noFla += '<img src="'+noflaFile+'" widyh="'+flaWidth+'" height="'+flaWidth+'" />';

	/*Flash*/
	var flaArea= "";
  flaArea += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" width="'+flaWidth+'" height="'+flaHeight+'" align="middle">';
  flaArea += '<param name="allowScriptAccess" value="sameDomain" />';
  flaArea += '<param name="loop" value="'+flaLoop+'" />';
  flaArea += '<param name="movie" value="'+flaFile+'" />';
  flaArea += '<param name="menu" value="false" />';
  flaArea += '<param name="quality" value="high" />';
  flaArea += '<param name="wmode" value="transparent" />';
  flaArea += '<param name="bgcolor" value="'+flaBgcolor+'" />';
  flaArea += '<embed src="'+flaFile+'" loop="'+flaLoop+'" menu="false" quality="high" wmode="transparent" bgcolor="'+flaBgcolor+'" width="'+flaWidth+'" height="'+flaHeight+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
  flaArea += '</embed>';
  flaArea += '</object>';

	var FlaVerCk=false;
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);

	if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 8) {
		FlaVerCk=true;
	}
	else if(navigator.userAgent && (navigator.userAgent.indexOf("MSIE") >= 0) && (navigator.userAgent.indexOf("Win") >= 0)){	
		/*measures Opera6*/		
		if(navigator.userAgent.indexOf("Opera") <= 0){
			var flaVer=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion();
			flaVer=Math.floor(flaVer / 0x10000);
			(flaVer >= reqVer) ? FlaVerCk=true : FlaVerCk=false;
		}
	}else{FlaVerCk=false;}   
	if(FlaVerCk){
	document.write(flaArea);
	} else {
	document.write(noFla);
	}
}

function openLink(url) {
	var w = screen.width;
	var h = screen.height;
	window.open(url,'','fullscreen=no,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=no,location=yes,width='+w+',height='+h+',left=0,top=0');
}

function addToFavorites(url,title) {
  if (window.sidebar) {
  	window.sidebar.addPanel(title, url, "");
  } else if(window.opera && window.print) { 
  	var elem = document.createElement('a');
  	elem.setAttribute('href',url);
  	elem.setAttribute('title',title);
  	elem.setAttribute('rel','sidebar');
  	elem.click();
  } else if(document.all)
  	window.external.AddFavorite(url, title);
}