    
	function dinamikusujratoltes(url,id)
    {
            var httpRequest;

                if (window.XMLHttpRequest)
                { // Mozilla, Safari, ...
                    httpRequest = new XMLHttpRequest();
                        if (httpRequest.overrideMimeType)
                        {
                                httpRequest.overrideMimeType('text/xml');
                        }
                }
                else
                        if (window.ActiveXObject)
                        { // IE
                                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
                        }

                if (!httpRequest)
                {
                        alert('Giving up :( Cannot create an XMLHTTP instance');
                        return false;
                }

                httpRequest.open('GET', url, true);
                httpRequest.onreadystatechange = function() {
				alertContents(httpRequest,id); };
				httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=ISO-8859-2');
                httpRequest.send(null);
     }
     
     function alertContents(httpRequest,id)
        {
                if (httpRequest.readyState == 4)
                {
                        if (httpRequest.status == 200)
                        {
                                //if (window.ActiveXObject)

                                if (document.getElementById(id).type=='select-one')
                                {
                                    select_innerHTML(document.getElementById(id), httpRequest.responseText);
                                }
                                else
								{
                                    document.getElementById(id).innerHTML = httpRequest.responseText;
								}
								
                        }
                        else
                        {
                                alert('Prola ttt az oldal betoltodesekor!');
                        }
                }
        }





function select_innerHTML(objeto,innerHTML){


    objeto.innerHTML = ""
    //creating phantom element to receive temp innerHTML
    var selTemp = document.createElement("micoxselect")
    var opt;
    selTemp.id="micoxselect1"
    document.body.appendChild(selTemp)
    selTemp = document.getElementById("micoxselect1")
    selTemp.style.display="none"
    if(innerHTML.toLowerCase().indexOf("<option")<0){//if not option, convert do option
        innerHTML = "<option>" + innerHTML + "</option>"
    }
    innerHTML = innerHTML.replace(/<option/g,"<span").replace(/<\/option/g,"</span")
    selTemp.innerHTML = innerHTML
    //transfering childs of phantom element to options
    for(var i=0;i<selTemp.childNodes.length;i++){
        if(selTemp.childNodes[i].tagName){
            opt = document.createElement("OPTION")
            for(var j=0;j<selTemp.childNodes[i].attributes.length;j++){
                opt.setAttributeNode(selTemp.childNodes[i].attributes[j].cloneNode(true))
            }
            opt.value = selTemp.childNodes[i].getAttribute("value")
            opt.text = selTemp.childNodes[i].innerHTML
            if(document.all){ //IEca
                objeto.add(opt)
            }else{
                objeto.appendChild(opt)
            }
        }
    }
    //clear phantom
    document.body.removeChild(selTemp)
    selTemp = null
}

String.prototype.replaceAll = function(
strTarget, // The substring you want to replace
strSubString // The string you want to replace in.
){
var strText = this;
var intIndexOfMatch = strText.indexOf( strTarget );

// Keep looping while an instance of the target string
// still exists in the string.
while (intIndexOfMatch != -1){
// Relace out the current instance.
strText = strText.replace( strTarget, strSubString )

// Get the index of any next matching substring.
intIndexOfMatch = strText.indexOf( strTarget );
}

// Return the updated string with ALL the target strings
// replaced out with the new substring.
return( strText );
}


function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function alkalmazasok(){
	
	document.write('<script type="text/javascript" src="js/reflex/reflex.js"></scr' + 'ipt>');
	
	document.write('<link rel="stylesheet" type="text/css" href="js/jquery.fancybox/jquery.fancybox.css" media="screen" />');
	document.write('<script type="text/javascript" src="js/jquery.fancybox/jquery-1.3.2.min.js"></scr' + 'ipt>');
	document.write('<script type="text/javascript" src="js/jquery.fancybox/jquery.easing.1.3.js"></scr' + 'ipt>');
	document.write('<script type="text/javascript" src="js/jquery.fancybox/jquery.fancybox-1.2.1.pack.js"></scr' + 'ipt>');
	
	$(function() {
		$('a[rel=lightbox]').fancybox(); // Minden link, amely rel="lightbox" attribútummal rendelkezik
		$('a[rel=sugooldal]').fancybox(
		{
			'frameWidth':	700,
		}
		); // Minden link, amely rel="lightbox" attribútummal rendelkezik
		
	});
	
	
}

function reset_vote(vote, rate){
	for(var i = 1; i < 6; i++){
		if ((i * 2) <= rate){
			document.getElementById("votes_"+i).className = "votes_full";
		}
		else if ((i * 2) - 1 <= rate){
			document.getElementById("votes_"+i).className = "votes_half";
		}
		else{
			document.getElementById("votes_"+i).className = "votes_empty";
		}
	}
	document.getElementById("votes_text").innerHTML = "<font class=\"piros_szoveg\">" + vote + "</font> szavazat";

}

		
