// JavaScript Document

/*
function makeRequest(url,iddiv) {
    var http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
         //   http_request.overrideMimeType('text/xml; charset=ISO-8859-2');
            // See note below about this line
        }
    } else if (window.ActiveXObject) { // IE
        try {
			
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
			http_request.createProcessingInstruction("text/xml",
                        "encoding='UTF-8'");
			//http_request.overrideMimeType('text/xml; encoding=ISO-8859-2');
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
				http_request.createProcessingInstruction("text/xml",
                        "encoding='UTF-8'");
//				http_request.overrideMimeType('text/xml; encoding=ISO-8859-2');
            } catch (e) {}
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = function() { topContents(http_request,iddiv); };
    http_request.open('POST', url, true);
    http_request.send(null);
	//http_request.overrideMimeType('text/xml; charset=ISO-8859-2');
}

function topContents(http_request,iddiv) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
			//$(iddiv).fadeTo("slow", 0.1);
            document.getElementById(iddiv).innerHTML = http_request.responseText;
        } else {
            alert('There was a problem with the request.\nError: ' + http_request.status);
        }
    }
}
*/


function blindDown(element){
       new Effect.BlindDown(element);
    }
/*
	function displayEffect(){
       new Effect.Shake('container');
    }
    function initializeElement(){
       Event.observe($('container'),'click',displayEffect,false);
    }
    Event.observe(window,'load',initializeElement,false);
*/
function makeRequest(img, header, back, type){

	new Ajax.Request('/include/bigImg.php',
	   {
		method:'get',
		parameters:{
		img: img,
		header: header,
		back: back,
		type: type
		},
		onCreate: function(){
			
			
		 // new Effect.BlindDown('mainContent');
		},
		onSuccess: function(transport)
		{	
			var response = transport.responseText || "no response text";
			//alert(response);
			//new Effect.BlindDown('mainContent');
		//	blindDown('mainContent');
			$('mainContent').update(response);//.innerHTML=requestObj.responseText;
			
		},
		onComplete: function(){
			blindDown('mainContent');
		},
		
		onFailure: function(){ alert('Something went wrong...') }
	}); 

}

function displayData(requestObj){
	
   $('datacontainer').innerHTML=requestObj.responseText;
}


function loadContent(url, type){
	//alert(url);
	new Ajax.Request(url,
	   {
		method:'get',
		parameters: 'type=' +type,  
		onSuccess: function(transport)
		{	
			var response = (transport.responseText || "no response text");
			//$('mainContent').update(response);
			//alert('succ');
			var elem = document.getElementById('content');
			initMyLightbox();
			elem.innerHTML = response;
		},
		onFailure: function(){ alert('Something went wrong...') }
	}); 
}



