// JavaScript Document

menu_pos = 1;

// jQuery ////////////////////////////////////////////
//
//bg_pos=0;
//
//jQuery(document).ready(function(){
//	
////	var backgroundheight = 0;
//// 
////	var offset = 10;
//// 
////	// graphic starts at approx 6am, so adjust offset by 1/4
////	var offset = offset - (backgroundheight / 4);
//// 
////	
////	function scrollbackground() {
////		// decrease the offset by 1, or if its less than 1 increase it by
////		// the background height minus 1
////   		offset = (offset < 1) ? offset + (backgroundheight - 1) : offset - 1;
////		// apply the background position
////   		jQuery('body').css("background-position", "50% " + offset + "px");
////   		// call self to continue animation
////   		setTimeout(function() {
////			scrollbackground();
////			}, 10
////		);
////   }
////	
////	scrollbackground();
//
//
//	jQuery(window)
//					.css( {backgroundPosition: "0 0"} )
//					
//					.scroll(function(event) {
//  					//jQuery('body').css("background-position", "-"+(event.pageX/30)+"px -"+(event.pageY/30)+"px");
//  					
//  					//alert(document.height);
//  					//alert(jQuery(this).scrollTop());
//  					
//  					percentage = jQuery(window).scrollTop() / document.height;
//  					telescope = 200;
//  					
//  					jQuery('body').css("background-position", "0px -"+(percentage*telescope)+"px");
//  					
//  					/*jQuery('body').animate(
//							//{backgroundPosition:"(-"+(event.pageX/10)+"px -"+(event.pageY/10)+"px)"}, 
//							{backgroundPosition:"0px -"+(percentage*telescope)+"px" }, 
//							
//							{duration:500})*/
//  					
//						})
////					
////					.mouseover(function(){
////						jQuery(this).stop().animate(
////							{backgroundPosition:"(0 -10px)"}, 
////							{duration:500})
////						})
////					.mouseout(function(){
////						jQuery(this).stop().animate(
////							{backgroundPosition:"(0 0)"}, 
////							{duration:500})
////						})		 
////					
//					
//     });

//----------------------------------------------------------------------- builtin functions

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

//------------------------------------------------------------------------ user functions

function MM_swapImgRestore_menu(obj, x) { //v3.0
  if (menu_pos!=x) obj.src = 'images/menu/menu_'+x+'.png';
}

//-------------------------------------------


function showHideLayer(layerName, isVisible){
	if (isVisible == 1 && $(layerName).style.opacity != 100) $(layerName).appear({ duration: 0.5, from: 0, to: 1 });
//	if (isVisible == 0) document.getElementById(layerName).style.visibility = 'hidden';
	if (isVisible == 0) $(layerName).fade({ duration: 0.0, from: 1, to: 0 });
}

//-------------------------------------------

function MM_effectSlide(targetElement, duration, from, to, toggle)
{		
	Spry.Effect.DoSlide(targetElement, {duration: duration, from: from, to: to, toggle: toggle});		
}

function element_kapcs(targetElement){
	x = MM_findObj(targetElement);
	if (x.style.display == "none") Effect.BlindDown(x, { duration: 0.15 });//$(x).BlindDown();
	else  Effect.BlindUp(x, { duration: 0.15 }); //$(x).BlindUp();
}

//-------------------------------------------

function element_kapcs_lassu(targetElement){
	x = MM_findObj(targetElement);
	if (x.style.display == "none") Effect.SlideDown(x, { duration: 0.5 });//$(x).BlindDown();
	//if (x.style.display == "none") $(x).appear();
	else  Effect.SlideUp(x, { duration: 0.5 }); //$(x).BlindUp();
	//else  $(x).fade();
}

//-------------------------------------------

function element_kapcs_w_scroll(targetElement){
	x = MM_findObj(targetElement);
	if (x.style.display == "none"){
		Effect.SlideDown(x, { duration: 0.7 });
		Effect.ScrollTo(targetElement+'_anchor', { duration:'0.7', offset:-90 });
	}
	else  Effect.SlideUp(x, { duration: 0.7 }); 
	
}

//-------------------------------------------

function element_kapcs2(targetElement, _value){
	x = MM_findObj(targetElement);
	if (_value == 1) Effect.BlindDown(x, { duration: 0.15 });//$(x).BlindDown();
	if(_value == 0)  Effect.BlindUp(x, { duration: 0.15 }); //$(x).BlindUp();
}

//-------------------------------------------

function gotoURL(_url){
	  this.location.href = _url;
}

//-------------------------------------------
//--------------------------------------------

function elkuld($para)
{	
	$form = document.getElementsByTagName('form');
	$critical = new Array();
	
	switch($form[0].name){
		
		case 'hirlevel':   
			$critical.push('nev','email');
			break;
		
		case 'vendegkonyv':   
			$critical.push('nev');			
			
			if ($form[0].uzenet.value == ''){
				alert('Kérjük töltsön ki minden *-gal jelölt rubrikát!');
				return;
			}
			break;
	}
	
	for (i=0; i<=$critical.length; i++){
		for(j=0; j<=$critical.length ; j++){
			if ($form[0].elements[i].name == $critical[j]){
				if ($form[0].elements[i].value == ''){
					alert('Kérjük töltsön ki minden *-gal jelölt rubrikát!');
					return;
				}
			}
		}
	}
	
	$form[0].submit();
	
}

//********************************************
//********************************************
//********************************************

var mask2load = new Array();

var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if ((browser=="Netscape"||browser=="Microsoft Internet Explorer") && (version<=4))
{
	mask2load[0] = "addons/edge/masks/2bit/parvati.gif";
}
else
{
	mask2load[0] = "addons/edge/masks/8bit/parvati_galeria.png";
}




/*****************************************************************************
The sIFR configuration should typically go in `sifr-config.js`, but in order to
keep the config file clean, and to give a quick overview, it's done here instead.
*****************************************************************************/
//
//var cochin = {
//  src: 'sifr.swf'
//};
//
//// You probably want to switch this on, but read <http://wiki.novemberborn.net/sifr3/DetectingCSSLoad> first.
//// sIFR.useStyleCheck = true;
//sIFR.activate(cochin);
//
//sIFR.replace(cochin, {
//  selector: '.cimsor, h1, h2'
//  ,css: [
//	'.sIFR-root {  padding:0; margin:0; letter-spacing:0; color:#82b308; font-weight:normal; font-size:25; text-transform:uppercase;}'
//	,'a { text-decoration: none; }'
//	,'a:link { color: #9A9A9A; }' 
//	,'a:hover { color: #f8a031; text-decoration:underline;}'
//  ]
//  ,wmode:'transparent'
//});
//
//sIFR.replace(cochin, {
//  selector: 'h5'
//  ,css: [
//	'.sIFR-root {  padding:0; margin:0; letter-spacing:0; color:#82b308; font-weight:normal; font-size:25; text-transform:uppercase; text-align:center;}'
//	,'a { text-decoration: none; }'
//	,'a:link { color: #9A9A9A; }' 
//	,'a:hover { color: #f8a031; text-decoration:underline;}'
//  ]
//  ,wmode:'transparent'
//});
//
//sIFR.replace(cochin, {
//  selector: 'h3, h4'
//  ,css: [
//	'.sIFR-root {  padding:0; margin:0; letter-spacing:0; color:#82b308; font-weight:normal; font-size:16; text-transform:uppercase;}'
//	,'a { text-decoration: none; }'
//	,'a:link { color: #9A9A9A; }' 
//	,'a:hover { color: #f8a031; text-decoration:underline;}'
//  ]
//  ,wmode:'transparent'
//});
//
//
//sIFR.replace(cochin, {
//  selector: '.also_menu_sifr'
//  ,css: [
//	'.sIFR-root {  text-transform: uppercase; letter-spacing:0; color:#327c00; font-weight:normal; font-size:9;}'
//	,'a { text-decoration: none; }'
//	,'a:link { color: #e4bdce; }' 
//	,'a:hover { color: #f8a031; text-decoration:underline;}'
//  ]
//  ,wmode:'transparent'
//});
//
//sIFR.replace(cochin, {
//  selector: '.hirek'
//  ,css: [
//	'.sIFR-root { text-transform: uppercase; letter-spacing:0; color:#327c00; font-weight:normal; font-size:12; text-align: center}'
//  ]
//  ,wmode:'transparent'
//});	

