function MM_preloadImages() 
{
	var d=document; 
	if(d.images)
	{ 
		if(!d.MM_p) d.MM_p=new Array();
    	var i, j=d.MM_p.length, a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
    		if (a[i].indexOf("#")!=0)
			{ 
				d.MM_p[j]=new Image; 
				d.MM_p[j++].src=a[i];
			}
	}
}

function znajdzFlasha(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function wznow() {
	 var flashMovie=znajdzFlasha("menuSWF");
	 flashMovie.SetVariable("wylaczloading", "mam");
}

function ustawUklad($ukl) {
	
	if($ukl=="2cols_gall_2"){
		document.getElementById("container").style.background="url(img/bck_2cols_gall.gif) repeat-y";
	}
	else {
		document.getElementById("container").style.background="url(img/bck_"+$ukl+".gif) repeat-y";
	}
	var flashMovie=znajdzFlasha("menuSWF");
	flashMovie.SetVariable("uklad", $ukl);

}


function jah(url,target) {
	//History.pushback();
    // native XMLHttpRequest object
    document.getElementById(target).innerHTML = '';
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {jahDone(target);};
		//req.onload = wznow;
        req.open("GET", url, true);
        req.send(null);
		
    // IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {jahDone(target);};
            req.open("GET", url, true);
            req.send();
        }
    }
}    

function jahDone(target) {
    // only if req is "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            results = req.responseText;
            document.getElementById(target).innerHTML = results;
			wznow();
        } else {
            document.getElementById(target).innerHTML="jah error:\n" +
                req.statusText;
        }
    }
}

function requestMultimedia(){
	jah('content/c_multimedia.php','content');	
	ustawUklad("3cols");
}
function requestInfo(){
	jah('content/c_info.php','content');
	ustawUklad("2cols");
}
function requestBio(){
	jah('content/c_bio.php','content');
	ustawUklad("2cols");
}
function requestClubs()	{
	jah('content/c_clubs.php','content');
	ustawUklad("2cols");
}
function requestContact(){
	jah('content/c_contact.php','content');
	ustawUklad("2cols");
}
function requestLinks(){
	jah('content/c_links.php','content');
	ustawUklad("2cols");
}
function requestNews($offset){	
	var openWithParam= "content/c_info.php?offset="+$offset;
	jah(openWithParam,'content');
	ustawUklad("2cols");
}
		
/* to bedzie funkcja dla pliku posters_main.php includowanego w c_multi.php */
function requestPosters($chosen_poster)	{
	var openWithParam= "content/multimedia/posters.php?chosen_poster="+$chosen_poster;
	jah(openWithParam,'content');	
	ustawUklad("2cols_gall");
}
	

function requestPoster($chosen_poster){
	var openWithParam= "content/multimedia/show_poster.php?chosen_poster="+$chosen_poster;
	jah(openWithParam,'right_column21');
	ustawUklad("2cols_gall");
}



function requestPhotos($chosen_poster,$gallery)	{
	var openWithParam= "content/multimedia/photos.php?chosen_poster="+$chosen_poster+"&gallery="+$gallery;
	jah(openWithParam,'content');	
	ustawUklad("2cols_gall");
}
		

function requestPhoto($chosen_poster,$gallery)
	{var openWithParam= "content/multimedia/show_photo.php?chosen_poster="+$chosen_poster+"&gallery="+$gallery;
	jah(openWithParam,'right_column21');
	ustawUklad("2cols_gall");
}


function requestVideos($chosen_video){
	var openWithParam= "content/multimedia/videos.php?chosen_video="+$chosen_video;
	jah(openWithParam,'content');	
	ustawUklad("2cols_gall");
}
		

function requestVideo($chosen_video){
	var openWithParam= "content/multimedia/show_video.php?chosen_video="+$chosen_video;
	jah(openWithParam,'right_column21');
	ustawUklad("2cols_gall");
}


		
function requestBioEng(){jah('content/c_bio_eng.php','left_column2');
	ustawUklad("2cols");
}
		
function requestBioArb(){ 
	jah('content/c_bio_arb.php','left_column2'); 
	ustawUklad("2cols");
}
		
function requestBioEsp(){ 
	jah('content/c_bio_esp.php','left_column2'); 
	ustawUklad("2cols");
}

function requestConEng(){
	jah('content/c_contact_eng.php','left_column2'); 
	ustawUklad("2cols");
}
		
function requestConArb(){ 
	jah('content/c_contact_arb.php','left_column2'); 
	ustawUklad("2cols");
}
		
function requestConEsp(){ 
	jah('content/c_contact_esp.php','left_column2'); 
	ustawUklad("2cols");
}
		
function requestBioAsh_ENG(){ 
	jah('content/c_bio_ash_eng.php','left_column2'); 
	ustawUklad("2cols");
}
		
function requestBioAsh_ESP(){ 
	jah('content/c_bio_ash_esp.php','left_column2'); 
	ustawUklad("2cols");	
}
		
function requestBioAsh_ARB(){ 
	jah('content/c_bio_ash_arb.php','left_column2'); 
	ustawUklad("2cols");
}

		
function requestBioMag_ENG(){ 
	jah('content/c_bio_mag_eng.php','left_column2'); 
	document.getElementById("container").style.background="url(img/bck_2cols.gif) repeat-y";
}
		
function requestBioMag_ESP(){ 
	jah('content/c_bio_mag_esp.php','left_column2'); 
	ustawUklad("2cols");
}
		
function requestBioMag_ARB(){ 
	jah('content/c_bio_mag_arb.php','left_column2');
	ustawUklad("2cols");
}
		
function requestExtraExp(){ 
	jah('content/c_extra.php','left_column2');
	ustawUklad("2cols");
}
function photoPrev($chosen_poster,$gallery){
	var openWithParam= "content/multimedia/show_photo.php?chosen_poster="+$chosen_poster+"&gallery="+$gallery+"&act=prev";
	jah(openWithParam,'right_column21');
	ustawUklad("2cols_gall");
}
function photoNext($chosen_poster,$gallery){
	var openWithParam= "content/multimedia/show_photo.php?chosen_poster="+$chosen_poster+"&gallery="+$gallery+"&act=next";
	jah(openWithParam,'right_column21');
	ustawUklad("2cols_gall");
}
		
