﻿var isie = document.all?true:false;
var ie5 = (document.all && !document.getElementById)? (true):(false);if (ie5){document.getElementById = function (e){return document.all[e];}}
function $(id){return document.getElementById(id);}
function removeClass(o, str){if (!o)return;o.className = o.className.replace (str,"");}
function addClass(o,str){if (!o)return;o.className = o.className + " " + str;}
function addEvent(name,func,e){if (!e)e=window;if (e.addEventListener){	e.addEventListener(name,func,false);}else if (e.attachEvent){e.attachEvent("on"+name,func);}}

function getFlashStr (url,id,w,h,bgcolor, wmode){if (isie){str = '<object type="application/x-shockwave-flash" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" name="' + id + '" id="' + id + '" style="width:'+w+'px;height:'+h+'px;"><param name="movie" value="'+url+'" /><param name="bgColor" value="'+bgcolor+'" /><param name="wmode" value="'+wmode+'" /></object>';	}else{str = '<embed swLiveConnect="true" quality=best type="application/x-shockwave-flash" menu=false  name="' + id + '" id="' + id + '" src="' + url + '" wmode="'+ wmode +'" bgcolor="' + bgcolor + '" width=' + w + ' height=' + h + ' swLiveConnect=true allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ></embed>';}return str;}
function addFlashInside (containerId, url,id,w,h,bgcolor, wmode){var str = getFlashStr(url,id,w,h,bgcolor, wmode);setHtml(containerId,str,false,false);}
function addFlash(url,id,w,h,bgcolor, wmode){var str = getFlashStr(url,id,w,h,bgcolor, wmode);document.write (str);}

var winCount=0;
function enlarge(url,isSwf,itemNum){
	var width = $("item"+itemNum).scrollWidth ? $("item"+itemNum).scrollWidth : $("item"+itemNum).offsetWidth;
	var height= $("item"+itemNum).scrollHeight ? $("item"+itemNum).scrollHeight : $("item"+itemNum).offsetHeight;

	var w=window.open ("large.php?filename="+escape(url)+"&isSwf="+isSwf+"&w="+(width)+"&h="+(height+50),("large"+(++winCount)),"left="+(10*winCount)+",top="+(10*winCount)+",width="+(isSwf ? width : screen.availWidth)+",height="+((isSwf) ? (height+50) : (screen.availHeight))+",scrollbars=no,status=yes,resizable=yes,scalable=yes");
	w.focus();
	if (winCount>20)winCount=0;
}
