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=7,0,0,0" width="'+iWidth+'" height="'+iHeight+'" id="'+sID+'">');
        write('  <param name="movie" value="'+sPath+'" />');
        write('  <param name="quality" value="high" />');
        write('  <param name="loop" value="true" />');
        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" loop="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:";
}

// ----------- kategorie header ----------------- //


//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=0 //0 for no (default), 1 for yes

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes

////////Stop editting////////////////

var previoustab ="";

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function expandcontent(cid, aobject) {
    if (disabletablinks==1)
    aobject.onclick=new Function("return false")
    if (document.getElementById){
		if (aobject != "undefined") highlighttab(aobject)
        if (turntosingle==0){
            if (previoustab != "")
            document.getElementById(previoustab).style.display="none"
            document.getElementById(cid).style.display="block"
            previoustab=cid;
        }
    }
}

function highlighttab(aobject){
    if (typeof tabobjlinks=="undefined")
    collecttablinks()
    for (i=0; i<tabobjlinks.length; i++)
    tabobjlinks[i].className=""
    aobject.className="current"
}

function collecttablinks(){
    var tabobj=document.getElementById("tablist")
    tabobjlinks=tabobj.getElementsByTagName("A")
}

function do_onload(){
	var currenttab = '';
    collecttablinks()
    //expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
	//rk:
    for (i=0; i<tabobjlinks.length; i++) {
	    if (tabobjlinks[i].className == "current") {
			currenttab = tabobjlinks[i].id.replace('-', '');
			break;
		}
	}
	if (currenttab != '') expandcontent(currenttab, "undefined");
}

/*
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
*/

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 = "inline";
    } else if (document.layers) {
        obj=document.layers[name].visibility = "show";
        document.layers[name].display = "inline";
    } else if (document.all) {
        obj=document.all[name].style.visibility = "visible";
        document.all[name].display = "inline";
    } else {
        obj=false;
    }
}

// magazyn - ukrywa/pokazuje opcje do ustawien
function hideOrUnhide(t, id) {
    if (t.checked) {
        show_obj(id);
    } else {
        hide_obj(id);
    }
}

/*
// magazyn - ukrywa/pokazuje opcje do ustawien
function hideAndUnhide(t, id) {
with (document.forms["contact_form"]) {
if (elements["mag_ustawienia"].checked) {
show_obj('tableToSend');
} else {
hide_obj('tableToSend');
}
}
}
*/
