jQuery(document).ready(function(){
    jQuery("a.fancy").fancybox({'hideOnContentClick': false, 'frameWidth': 643, 'frameHeight': 483});
    jQuery(".taxnum").mask("99999999-9-99");
});

function innerDimension() {
	var x,y;

	// all except Explorer
	if (self.innerHeight)
	{
		x = self.innerWidth;
		y = self.innerHeight;

	// Explorer 6 Strict Mode
	} else if (document.documentElement && document.documentElement.clientHeight) {
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;

	// other Explorers
	} else if (document.body) {
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}

	return {width: x, height: y};
}

function offsetDimension() {
	var x,y;

	// all except Explorer
	if (self.pageYOffset)
	{
		x = self.pageXOffset;
		y = self.pageYOffset;

	// Explorer 6 Strict
	} else if (document.documentElement && document.documentElement.scrollTop) {
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;

	// all other Explorers
	} else if (document.body) {
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}

	return {x: x, y: y}
}

function popup(url,name,width,height,position,wplus,hplus,focus,left,top,menubar,status,toolbar,scrollbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

	if ( position == '1' ) {
		var winleft = (screen.width - width) / 2;
		var wintop = (screen.height -  height) / 2;
	} else {
		var winleft = left;
		var wintop = top;
	}

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+winleft+',top='+wintop+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

function $( name ) {
	if (typeof name == 'string')
		return document.getElementById(name);

	return name;
}

var recipe = 0;
function showRecipe( num ) {
    $('r'+recipe).style.display = 'none';
    $('r'+num).style.display = 'block';

    recipe = num;
}

function changeImage(img, img_src) {
  img.src = img_src;
}

function downloadConfirmMsg(FirmName) {
	var downloadConfirm = confirm('A letöltött anyagokért (fájlokért) vagy a megjelenített információkért a(z) '+ FirmName +' nem vállal felelőséget!\nAz Adatvédelem menüpontban leírtakat tudomásul veszem!\nA folytatáshoz kattintson az OK gombra, megszakításhoz a Mégse gombra!');
	if (downloadConfirm) return true;
	else return false;
}

function setSubCat( el, lang ) {
  gRPC.request('/'+lang+'/handler/jsRPC/subcat/'+el.value+'/', loadedPage);
}

function loadedPage(p) {
    document.getElementById('subcat').innerHTML = p;
}

/* IE6 bugix - a select kitakarasa - kezdete */

function disableSelect() {
    if ( !document.getElementById('search_cid') )
        return false;

    document.getElementById('search_cid').style.display = 'none';
    document.getElementById('search_gid').style.display = 'none';
}

function enableSelect() {
    if ( !document.getElementById('search_cid') )
        return false;

    document.getElementById('search_cid').style.display = 'block';
    document.getElementById('search_gid').style.display = 'block';
}

/* IE6 bugix - a select kitakarasa - vege */

