var $ = function(id){return document.getElementById(id);};

//addListener(window,"load",playit);
function addListener(el,eventType,fn){
	if(el.addEventListener){
		el.addEventListener(eventType,fn,false);
	}else if(el.attachEvent){
		el.attachEvent("on" + eventType,fn);
	}else{
		el["on"+eventType] = fn;
	}
}

var commandTabObj;
function CommonTab(sum,obj,objG,objTab,placeSum){
	var getObj = $(obj);
	var getObjG = getObj.getElementsByTagName(objG);
	for(var i=placeSum;i<getObjG.length;i++){
		if(i==sum){
			commandTabObj=getObjG[i];
			with(getObjG[i]){className = "down";style.cursor = "";}
			getObjG[i].onmousemove = function(){return false};
			getObjG[i].onmouseout = function(){return false};
			if(objTab!=null){$(objTab+i).style.display = "";}
		}else{
			with(getObjG[i]){className = "";style.cursor = "pointer";}
			getObjG[i].onmousemove = function(){this.className = "move";};
			getObjG[i].onmouseout = function(){this.className = "";};
			if(objTab!=null){$(objTab+i).style.display = "none";}
		}
	}
}

function CommonTabMove(sum,obj,objG,cursor,objTab,objTabG){
	var csFont = (cursor==0) ? "pointer" : "";
	var getObj = $(obj);
	var getObjG = getObj.getElementsByTagName(objG);
	if(objTab!=null){
		var getObjTab = $(objTab);
		var getObjTabG = getObjTab.getElementsByTagName(objTabG);
	}
	for(var i=0;i<getObjG.length;i++){
		if(i==sum){
			with(getObjG[i]){className = "down";style.cursor = csFont;}
			if(objTab!=null){getObjTabG[i].style.display = "";}
		}else{
			with(getObjG[i]){className = "";style.cursor = csFont;}
			if(objTab!=null){getObjTabG[i].style.display = "none";}
		}
	}
}

function showFlash(iUrl,iWidth,iHeight,iWmode){
	flash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ iWidth +'" height="' + iHeight +'"/>';
	flash = flash + '<param name="movie" value="'+ iUrl +'" />';
	if (iWmode == 1) {flash = flash + '<param name="wmode" value="transparent" />';	}
	flash = flash + '<embed src="' + iUrl + '" width="'+ iWidth +'" height="'+ iHeight +'" ';
	if (iWmode == 1) {flash = flash + 'wmode="transparent"';}
	flash = flash + ' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" mwode="transparent"></embed></object>';
	document.writeln(flash);
}
