function ShowFlash(name, file, w, h, wmode, fvar, fvars) {

	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + w + '" height="' + h + '" id="' + name + '" align="center">');
	document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
	document.writeln('<param name="movie" value="' + file + '" />');
	document.writeln('<param name="quality" value="high" />');
	document.writeln('<param name="menu" value="false" />');
	
	if(wmode==1){
		document.writeln('<param name="wmode" value="transparent" />');
		var wm = 'wmode="transparent" ';
	}else var wm = '';
	
	if(fvar==1){
		document.writeln('<param name="flashvars" value="' + fvars + '">');	
		var fv = 'flashvars="' + fvars + '" ';
	}else var fv = '';
	
	document.writeln('<param name="bgcolor" value="#ffffff" />');
	document.writeln('<embed src="' + file + '" menu="false" ' + wm + 'quality="high" ' + fv + 'bgcolor="#ffffff" width="' + w + '" height="' + h + '" name="' + name + '" align="center" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.writeln('</object>');
}

function GetCookie (name) { 
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; var i = 0;
	 while (i < clen) { 
		 var j = i + alen; 
		 if (document.cookie.substring(i, j) == arg) return getCookieVal (j); 
		 i = document.cookie.indexOf(" ", i) + 1; 
		 if (i == 0) break; 
	} 
	return null; 
} 
	

function SetCookie (name, value) { 
	var argv = SetCookie.arguments; 
	var argc = SetCookie.arguments.length; 
	var expires = (argc > 2) ? argv[2] : null; 
	var path = (argc > 3) ? argv[3] : null; 
	var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; 
	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); 
} 

function DeleteCookie (name) { 
	var exp = new Date(); exp.setTime (exp.getTime() - 1); 
	var cval = GetCookie (name); document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); 
} 

var exp = new Date(); 
exp.setTime(exp.getTime() + (60)); 

function amt(){ 
	var count = GetCookie('count') 
	if(count == null) { 
		SetCookie('count','1') 
		return 1 
	} else { 
		var newcount = parseInt(count) + 1; 
		DeleteCookie('count') 
		SetCookie('count',newcount,exp) 
		return count 
	} 
} 

function getCookieVal(offset) { 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) endstr = document.cookie.length; 
	return unescape(document.cookie.substring(offset, endstr)); 
} 

function SprawdzPop(lang, p_width, p_height, p_bgcolor) { 
	var count = GetCookie('count'); 
	if (count == null) { 
		count=1; 
		SetCookie('count', count, exp); 
		
		var winleft = (screen.width - p_width) / 2;
		var winUp = (screen.height - p_height) / 2;
		
		winProp = 'width='+p_width+',height='+p_height+',left='+winleft+',top='+winUp+',scrollbars=yes,resizable';
		Win = window.open('/eltron/popup.php?lang=' + lang + '&bgcolor=' + p_bgcolor, 'pop', winProp);
		if (parseInt(navigator.appVersion) >= 4) { Win.window.focus(); }
		
	} else { 
		count++; 
		SetCookie('count', count, exp); 
	} 
}
