/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$(".accordion2 .dynbox_content p").hide();

function ajaxCall(surl,params) {
    $.ajax({
        type:"post",
        url:surl,
        data:params,
        success:function(xhtml) {
    		$("#achivement").html(xhtml);
    	}
    })	
}




function getSimpleAjaxContent(surl,id,params) {
    var inner = document.getElementById(id);
    if (!params) {
        $.ajax({
            type:"post",
            url:surl,
            data:params,
            success:function(html) {
                
                inner.innerHTML = html;
                
            }
        })
    } else {
             $.ajax({
                type:"post",
                url:surl,
                data:params,
                success:function(html){
                    inner.innerHTML = html;
                }
            })
    }
}





function getAjaxContent(phpClass,id,params) {
    var inner = document.getElementById(id);
    if (!params) {
       
            $.ajax({
                type:"post",
                url:"http://www.otherworld.hu/t_components/ajax/display.php",
                data:"display="+phpClass,
                success:function(html){
                    inner.innerHTML = html;
                    //toggleAccordion();
                    
                }
            })
        
    } else {
       
            $.ajax({
                type:"post",
                url:"http://www.otherworld.hu/t_components/ajax/display.php",
                data:"display="+phpClass+"&"+params,
                success:function(html){
                    inner.innerHTML = html;
                    //toggleAccordion();
                   
                }
            })
        
    }
}

function contentChanger(phpClass,id,params) {
    getAjaxContent(phpClass,id,params);
    auto=false;
    autocc=false;
    return id;
}

function newsContentChanger(hrefid,phpClass,id,params) {
    getAjaxContent(phpClass,id,params);
    auto=false;
    autocc=false;
    changeContent = hrefid;
}


function toggleAccordion() {
    $(".accordion2 .dynbox_content h3").eq(0).addClass("active");
    $(".accordion2 .dynbox_content p").eq(0).show();
    $(".accordion2 .dynbox_content em").eq(0).show();
    $(".accordion2 .dynbox_content h3").click(function(){
        $(this).next("p").slideToggle("fast").siblings("p:visible").slideUp("fast");
        $(this).next("em").slideToggle("fast").siblings("em:visible").slideUp("fast");
        $(this).toggleClass("active");
        $(this).siblings("h3").removeClass("active");
    });
}


function toggleInfo() {
    $(".accordion2 .dynbox_content p").hover(function() {
		$(this).next("em").animate({opacity: "show", top: "-75"}, "slow");
	}, function() {
		$(this).next("em").animate({opacity: "hide", top: "-85"}, "fast");
	});   
}


