function putFlash(sPath, iWidth, iHeight, sID) {
	with (document) {
		write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+iWidth+'" height="'+iHeight+'" id="'+sID+'">');
		write('  <param name="movie" value="'+sPath+'" />');
		write('  <param name="quality" value="high" />');
		write('  <param name="wmode" value="transparent" />');
		write('  <param name="menu" value="false" />');
		write('  <embed src="'+sPath+'" quality="high" wmode="transparent" menu="false" width="'+iWidth+'" height="'+iHeight+'" swLiveConnect=true name="'+sID+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		write('</object>');
	}
}

function opImg(strona) {
	lupka(strona, 330, 330, 'no');
}

function lupka(plik_strony, w, h, przew) {
	if (!w) {w=500;}
	if (!h) {w=400;}
	if (!przew) {przew='yes';}

	if (window.screen){
		aw=screen.availWidth;
		ah=screen.availHeight;
	} else{
		aw=640;
		ah=450;
	}

	ustawienia=
	"left=" + (aw-w)/2 + ","
	+"top=" + (ah-h)/2 + ","
	+"screenX=" + (aw-w)/2 + ","
	+"screenY=" + (ah-h)/2 + ","
	+"width=" + w + ","
	+"height=" + h + ","
	+"innerWidth=" + w + ","
	+"innerHeight=" + h + ","
	+"toolbar=no,"
	+"location=no,"
	+"directories=no,"
	+"status=no,"
	+"menubar=no,"
	+"scrollbars=" +przew+ ","
	+"resizable=yes"
	self.window.name='glowne';
	noweOkienko = window.open(plik_strony,'noweOkienko',ustawienia);

	noweOkienko.document.close();
	noweOkienko.focus();
}
// nowa opcja obrazkow +++++++++++++++++++++++
function reSizeToImage( ){
	var isNN, isIE;

	if ( parseInt( navigator.appVersion.charAt( 0 ) ) >= 4 ){
		isNN = ( navigator.appName == "Netscape" ) ? 1 : 0;
		isIE = ( navigator.appName.indexOf( "Microsoft" ) != -1 ) ? 1 : 0;
	}

	if ( isNN ){
		width = document.images["obrazek"].width;
		height = document.images["obrazek"].height;

		if( width > screen.availWidth ){
			width = screen.availWidth - screen.availWidth/5;
			document.body.scroll = "yes";
		}
		if( height > screen.availHeight ){
			height = screen.availHeight - screen.availHeight/5;
			document.body.scroll = "yes";
		}
		window.innerWidth =		width;
		window.innerHeight =	height;
	}
	else {
		window.resizeTo( 100, 100 );
		width =		100 - ( document.body.clientWidth - document.images[0].width );
		height =	100 - ( document.body.clientHeight - document.images[0].height );

		if( width > screen.availWidth ){
			width = screen.availWidth - screen.availWidth / 5;
			document.body.scroll = "yes";
		}
		if( height > screen.availHeight ){
			height = screen.availHeight - screen.availHeight / 5;
			document.body.scroll = "yes";
		}
		width = width+20;
		//  		height = height+10;
		window.resizeTo( width, height );
	}

	moveWindowToImage( width, height );

}
function moveWindowToImage( iWindowWidth, iWindowHeight ){

	var iPosX = (( screen.availWidth - iWindowWidth ) / 2)-40;
	var iPosY = (( screen.availHeight - iWindowHeight ) / 2);
	//  alert (screen.availWidth + " h: " + screen.availHeight + " d\nw: " + iWindowWidth + " h: "+iWindowHeight + " \ny: " + iPosY + " X: " + iPosX);
	//	if (iPosY > screen.availHeight
	window.moveTo( iPosX, iPosY );

} // end function moveWindowImage
function doTitle( ){
	document.title = "Argent 3:";
}


function hide_obj(name) {
    var agt=navigator.userAgent.toLowerCase();
    var is_ie5 = ((parseInt(navigator.appVersion) == 4) && (agt.indexOf("msie 5.0")!=-1) && (agt.indexOf("opera") == -1));

    if (document.getElementById && !is_ie5) {
        obj=document.getElementById(name).style.visibility = "hidden";
        document.getElementById(name).style.display = "none";
    } else if (document.layers) {
        obj=document.layers[name].visibility = "hide";
        document.layers[name].display = "none";
    } else if (document.all) {
        obj=document.all[name].style.visibility = "hidden";
        document.all[name].display = "none";
    } else {
        obj=false;
    }
}

function show_obj(name) {
    var agt=navigator.userAgent.toLowerCase();
    var is_ie5 = ((parseInt(navigator.appVersion) == 4) && (agt.indexOf("msie 5.0")!=-1) && (agt.indexOf("opera") == -1));
    if (document.getElementById && !is_ie5) {
        obj=document.getElementById(name).style.visibility = "visible";
        document.getElementById(name).style.display = "block";
    } else if (document.layers) {
        obj=document.layers[name].visibility = "show";
        document.layers[name].display = "block";
    } else if (document.all) {
        obj=document.all[name].style.visibility = "visible";
        document.all[name].display = "block";
    } else {
        obj=false;
    }
}


/*
function winres() {
var el=document.getElementById('obrazek');
var ow=el.offsetWidth;
var oh=el.offsetHeight;
if (ow<100) ow=100;
if (oh<100) oh=100;
var mp=false;
var mp1,mp2;
var w,h,i;



mp1=1;mp2=1;
if (ow>screen.availWidth-30) {
mp1=(screen.availWidth-30)/ow;
mp=true;
}
if (oh>screen.availHeight-50) {
mp2=(screen.availHeight-50)/oh;
mp=true;
}

if (mp) {
if (mp1>mp2) mp1=mp2;
ow=Math.floor(mp1*ow);
oh=Math.floor(mp1*oh);
el.width=ow;
el.height=oh;
}
for (i=0;i<3;i++) {
if (window.innerWidth) {
w=window.innerWidth;
h=window.innerHeight;
}
else {
w=document.body.clientWidth;
h=document.body.clientHeight;
}
if (i <2) h-=20;
window.resizeBy(ow-w,oh-h);
}
window.resizeTo(w+15, h+50);
w=(screen.availWidth-ow)/2;
h=(screen.availHeight-oh)/2;
if (w<0) w=0;
if (h<0) h=0;
window.moveTo(w,h);
}
*/
