// JavaScript Document
// GET OBJECT //
/*
function $(id) {
	if(document.getElementById) obj = document.getElementById(id);
	else obj = document.all[id];
	return obj;
}
*/
function swap_img(img,id) {
	$(id).src = img;
}

// SHOW IMAGE //
function img_show(type,id) {
	window.open('image_show.php?id='+id+'&type='+type,'foto','width=100,height=100,directories=0,location=0,menubar=0,resizable=1,titlebar=0,scrollbars=1,status=0,toolbar=0,fullscreen=0,channelMode=0');
}

function swf_insert(filename,w,h) { 

		var oeTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" id="intro_blue" align="middle">'
		+ '<param name="allowScriptAccess" value="sameDomain" />'
		+ '<param name="movie" value="' + filename + '" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /><embed src="' + filename + '" quality="high" scale="noscale" bgcolor="#ffffff" width="' + w + '" height="' + h + '" name="xxx" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
		+ '</object>';

		majorVersion=8;
		minorVersion=0;
		installinfo='Brak wtyczki flash<br/><a href="https://www.macromedia.com/go/getflashplayer" target="_blank">pobierz</a>'; // URL zawierajacy informacje o potrzebie instalacji
		if(navigator.product=='Gecko' || navigator.userAgent.indexOf('Opera')!=-1) {
		 if(plugin=navigator.plugins["Shockwave Flash"]) {
		  if(majorVersion > parseInt(plugin.description.substr(plugin.description.indexOf(".")-2, 2))
		  || minorVersion > parseInt(plugin.description.substr(plugin.description.length-2)) )
			document.write(installinfo);  // pobieranie flasha
		  else document.write(oeTags);
		 } else {
			document.write(installinfo);  // pobieranie flasha 
		 }
		}
		else document.write(oeTags);

}

