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 putMovie(sPath, iWidth, iHeight)
{
   with (document)            //     #565656
   {
      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+'">');
      //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+'">');
      write('  <param name="movie" value="'+sPath+'" />');
      write('  <param name="quality" value="high" />');
      write('  <param name="loop" value="false" />');
      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" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
      //write('  <embed src="'+sPath+'" quality="high" wmode="transparent" menu="false" width="'+iWidth+'" swLiveConnect="true" loop="true" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
      write('<\/object>');
   }
}

function expand(id)
{
    obj = document.getElementById('expand_bar_'+id);
    if (obj)
    {
       obj.style.display = ((obj.style.display=='none')?'block':'none');
       objL = document.getElementById('expand_link_'+id);
       if (objL)
       {
          objL.innerHTML = ((obj.style.display=='none')?'expand':'close');
       }
       objF = document.getElementById('footer');
       if (objF)
       {
          objF.style.top = 'auto';
       }
    }
}

function editBlur(sender, defValue)
{
   if (trim(sender.value)=='')
      sender.value = defValue;
}

function editFocus(sender, defValue)
{
   if (trim(sender.value)==defValue)
      sender.value = '';
}

function trim(text)
{
   text = text.replace(/^\s+/, '');
   return text.replace(/\s+$/, '');
}

function showWin(pFile, pTop, pWidth, pHeight)
{
    objBody = document.getElementsByTagName("body").item(0);
    shadow  = document.getElementById("shadow");
    iframe  = document.getElementById('iframe_dialog');
    iframeb = document.getElementById('iframe_dialog_bg');

    if (!shadow)
    {
        shadow     = document.createElement('img');
        shadow.id             = 'shadow';
        shadow.src            = '/_i/shadow.png';
        shadow.style.position = 'absolute';
        shadow.style.top      = '0px';
        shadow.style.left     = '0px';
        shadow.style.zIndex   = '90';
        shadow.style.width    = '100%';
        shadow.style.height   = document.body.offsetHeight+'px';
        shadow.onclick     = hideWin;
        objBody.insertBefore(shadow, objBody.firstChild);
    }
    else
        shadow.style.display = 'block';

    if (!iframeb)
    {
        iframeb = document.createElement('div');
        iframeb.id             = 'iframe_dialog_bg';
        iframeb.style.left     = '100px';
        iframeb.style.top      = '100px';
        iframeb.style.width    = '100px';
        iframeb.style.height   = '100px';
        iframeb.style.zIndex   = '91';
        iframeb.style.position = 'absolute';
        iframeb.style.backgroundColor = 'ButtonFace';
        objBody.insertBefore(iframeb, objBody.firstChild);
    }
    else
        iframeb.style.display = 'block';

    if (!iframe)
    {
        iframe = document.createElement('iframe');
        iframe.id             = 'iframe_dialog';
        iframe.frameBorder    = '0';
        iframe.scrolling      = 'no';
        iframe.style.left     = '100px';
        iframe.style.top      = '100px';
        iframe.style.width    = '100px';
        iframe.style.height   = '100px';
        iframe.style.zIndex   = '92';
        iframe.style.position = 'absolute';
        objBody.insertBefore(iframe, objBody.firstChild);
    }
    else
        iframe.style.display = 'block';

    if (!(!iframeb))
    {
        iframeb.style.width  = pWidth+'px';
        iframeb.style.height = pHeight+'px';
        if (typeof document.height == "undefined")
        {
           iframeb.style.left   = ((document.body.offsetWidth / 2)  - (pWidth / 2)) +'px';
           iframeb.style.top    = pTop+'px'; //((document.body.offsetHeight / 2) - (pHeight / 2))+'px';
        }
        else
        {
           iframeb.style.left   = ((window.innerWidth / 2)  - (pWidth / 2)) +'px';
           iframeb.style.top    = pTop+'px'; //((window.innerHeight / 2) - (pHeight / 2))+'px';
        }
    }
    if (!(!iframe))
    {
        iframe.src          = pFile;
        iframe.style.width  = iframeb.style.width;
        iframe.style.height = iframeb.style.height;
        iframe.style.left   = iframeb.style.left;
        iframe.style.top    = iframeb.style.top;
    }
}

function hideWin()
{
    shadow = document.getElementById("shadow");
    if (!(!shadow))
        shadow.style.display = 'none';
    iframeb = document.getElementById("iframe_dialog_bg");
    if (!(!iframeb))
        iframeb.style.display = 'none';
    iframe  = document.getElementById('iframe_dialog');
    if (!(!iframe))
    {
        iframe.src           = 'about:blank';
        iframe.style.display = 'none';
    }
}













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:";
}

// ---------------------------- //


//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){
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(){
collecttablinks()
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}

/*
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');
		}
	}
}
*/
