
/***********************************************
* Image Thumbnail Viewer II script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Specify image paths and optional link (set link to "" for no link):

//Preload images ("yes" or "no"):
var preloadimg="no"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
//var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"
var filterstring=""

///////No need to edit beyond here/////

if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=""
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'"'
imghtml+=' alt="'+theimg[1]+'">'
return imghtml
}


function modifyimage(loadarea, descarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
var imgdobj=document.getElementById(descarea)

imgobj.innerHTML=returnimgcode(dynimages[imgindex])
imgdobj.innerHTML=dynimages[imgindex][2]
return false
}
}

function addEvent(obj, evType, fn) {
	if (obj.addEventListener) {
		obj.addEventListener(evType, fn, true);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}

function getElementsByClass(name) {
	var found = 0;
	var elems = new Array();
	var alltags = document.getElementsByTagName("*");
	if (alltags) {
		for (i=0; i < alltags.length; i++) {
			if (alltags[i].className==name) {
				elems[found++]=alltags[i];
			}
		}
	}
	return(elems);
}

function printPage() {
  if (window.print) {
    setTimeout('window.print();', 200);
  }
  else if (agt.indexOf("mac") != -1) {
    alert("Az oldal nyomtat?s?hoz nyomd meg a 'Cmd+p' gombokat!");
  }
  else {
    alert("Az oldal nyomtat?s?hoz nyomd meg a 'Ctrl+p' gombokat!");
  }
}

function atReplacer() {
	var replaces=0;
	while (document.body.innerHTML.indexOf('##'+'kukac##')!=-1 && replaces<30) {
		document.body.innerHTML=document.body.innerHTML.replace('##'+'kukac##',String.fromCharCode(64));
		replaces++;
	}
}
function hideIndicator(melyik){
	var indicatorinfo = document.getElementById("ajaxmessage");
   	indicatorinfo.style.display="none";
    var indicator = document.getElementById(melyik);
   	indicator.style.display="none";

}
function showIndicator(melyik, w, h){
    var availHeight;
    var availWidth;
	var yOffset=0;
	// all except Explorer
	if (self.pageYOffset){
	    yOffset = self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop){
	// Explorer 6 Strict
	    yOffset = document.documentElement.scrollTop;
	}
	else if (document.body){
	// all other Explorers
	    y = document.body.scrollTop;
	}

    if(typeof(window.innerWidth) == 'number'){
        availHeight = window.innerHeight;
        availWidth = window.innerWidth;
    }else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
        availHeight = document.documentElement.clientHeight;
        availWidth = document.documentElement.clientWidth;
    }else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
        availHeight = document.body.clientHeight;
        availWidth = document.body.clientWidth;
    }

    var indicatorinfoWidth = availWidth/2;
    var indicatorinfoHeight = availHeight/2;
    var leftinfo = (availWidth/2) - (indicatorinfoWidth/2);
	var topinfo = ((availHeight/2)+yOffset) - (indicatorinfoHeight/2);
	var indicatorinfo = document.getElementById("ajaxmessage");
    indicatorinfo.style.position="absolute";
    indicatorinfo.style.zIndex="998";
    indicatorinfo.style.top=topinfo+"px";
    indicatorinfo.style.left=leftinfo+"px";
    indicatorinfo.style.height=indicatorinfoHeight+"px";
    indicatorinfo.style.width=indicatorinfoWidth+"px";
    indicatorinfo.style.display="block";

    var indicator = document.getElementById(melyik);
    var indicatorWidth = w;
    var indicatorHeight = h;
    var left = (availWidth/2) - (indicatorWidth/2);
	var top = ((availHeight/2)+yOffset) - (indicatorHeight/2);
    indicator.style.position="absolute";
    indicator.style.zIndex="999";
    indicator.style.top=top+"px";
    indicator.style.left=left+"px";
    indicator.style.height=h+"px";
    indicator.style.width=w+"px";
    indicator.style.display="block";
}

//********************************************************************************************
// Kedvencekhez
//********************************************************************************************
function createBookmarkLink(url, title)
{
	// IE Favorite
	if (window.external) {
		window.external.AddFavorite(window.location.href, title);
		return false;
	}
	// Mozilla Firefox Bookmark
	else if (window.sidebar) {
		return false;
	}
	// Opera Hotlist
	else if(window.opera && window.print) {
		return true;
	}
}


//********************************************************************************************
// Kezdolapnak
//********************************************************************************************
function setStartPage(obj, url)
{
	// IE Favorite
	if (window.external) {
		obj.style.behavior = "url(#default#homepage)";
		obj.setHomePage(url);
	}
	// Mozilla Firefox Bookmark
	else if (window.sidebar) {
		return false;
	}
	// Opera Hotlist
	else if(window.opera && window.print) {
		return false;
	}
}



addEvent(window, 'load', atReplacer);