 

function masolas()
{
document.rendeles.szamlnev.value=document.rendeles.csomnev.value;
document.rendeles.szamlirsz.value=document.rendeles.csomirsz.value;
document.rendeles.szamlvaros.value=document.rendeles.csomvaros.value;
document.rendeles.szamlcim.value=document.rendeles.csomcim.value;


}


function kosarba(tid)
{
window.open('/lib/page/kosar.php?tid='+tid,'serverAction');
}


function PlayMp3(emid)
{
window.open('/lib/saction/playmp3.php?emid='+emid,'serverAction');
}


function kosarbejar() {
  if(!document.kosarform) return;

  for( var i=0;  i<document.kosarform.elements.length; i++ )
    {
    
      document.kosarform.elements[i].onchange=function() { document.kosarform.submit(); }
    }
  
  }
function kosarkuldes() {
//document.getElementById('kosar').innerHTML+='<center><img src="/images/ajax-loader.gif" /></center>';
document.kosarform.action='/lib/page/kosar.php?check=1';
document.kosarform.target='serverAction';
//document.kosarform.target='_blank';
document.kosarform.submit();
}

var loginpanelhide=function()
  {
  document.getElementById('loginpanel').style.display='none';
  }

function loginpanelopen()
{
var hei=document.getElementById('loginpanel').style.height;
hei=parseInt( hei );
if( hei == '0' ){
document.getElementById('loginpanel').style.display='block';

  var attributes = {
        height: { to: 165 }
    };
    var anim = new YAHOO.util.Anim('loginpanel', attributes, 1.5);
    
    anim.animate();
}
  else
    {
    var attributes = {
        height: { to: 0 }
    };
    var anim = new YAHOO.util.Anim('loginpanel', attributes, 1.5);
      anim.onComplete.subscribe(loginpanelhide);

    anim.animate();
    }


}


function get_radio_value()
{
var rad_val=0;
for (var i=0; i < document.rendeles.vasarlotipus.length; i++)
   {
   if (document.rendeles.vasarlotipus[i].checked)
      {
      rad_val= document.rendeles.vasarlotipus[i].value;
      }
   }
   return rad_val;
}



function rendelesbejelentkezve()
{
var hiba='';

if( strlen( document.rendeles.nev.value )<3  ) hiba=hiba+'Kérem helyes nevet adjon meg. ';
if( strlen( document.rendeles.emailcim.value )<5  ) hiba=hiba+'Kérem helyes email címet adjon meg. ';
if( strlen( document.rendeles.telszam.value )<3  ) hiba=hiba+'Kérem helyes telefonszámot adjon meg. ';
if( strlen( document.rendeles.szuldatum.value )<5  ) hiba=hiba+'Kérem helyes születési dátumot adjon meg. ';

if( strlen( document.rendeles.csomnev.value )<5  ) hiba=hiba+'Kérem helyes szállítási nevet adjon meg. ';
if( strlen( document.rendeles.csomirsz.value )<3  ) hiba=hiba+'Kérem helyes szállítási irányítószámot adjon meg. ';
if( strlen( document.rendeles.csomvaros.value )<2  ) hiba=hiba+'Kérem helyes szállítási várost adjon meg. ';
if( strlen( document.rendeles.csomcim.value )<2  ) hiba=hiba+'Kérem helyes szállítási címet adjon meg. ';
//if( get_radio_value() == 0 ) hiba=hiba+'Kérem válasszon vásárlási módot. ';

 
if( strlen(hiba)>0 )  alert(hiba);
else
  {
  document.rendeles.action='';
  document.rendeles.submit();
  }

}


function hlpanel()
{
//document.hirlevel.emailcim.value='';
document.getElementById('emailcim').value='';
document.getElementById('adjameg1').style.display='block';
document.getElementById('adjameg2').style.display='block';
}




function locFelScroll()
{
//alert("fel");
 var attributes = {
        scroll: { to: [400,0] }
        
    };
    var anim = new YAHOO.util.Scroll('loc', { scroll: { to: [450, 0] } }, 0.02, null);
    anim.duration = 30;
    anim.onComplete.subscribe( function(){ locLeScroll();  }  );
 anim.animate();

}


function locLeScroll()
{
 var attributes = {
        scroll: { to: [0,400] }
        
    };
    var anim = new YAHOO.util.Scroll('loc', { scroll: { to: [0, 450] } }, 0.02, null );
    anim.duration = 30;
    anim.onComplete.subscribe( function(){ locFelScroll();  }  );
 anim.animate();
 

}
            
            YAHOO.util.Event.onContentReady("termekekmenu", function () {

               

                var oMenu = new YAHOO.widget.Menu(
                                    "termekekmenu", 
                                    {
                                        position: "static", 
                                        hidedelay: 750, 
                                        lazyload: true, 
                                        effect: { 
                                            effect: YAHOO.widget.ContainerEffect.FADE,
                                            duration: 0.25
                                        } 
                                    }
                                );

                

                oMenu.render();            
            
            });
YAHOO.util.Event.onContentReady("loc", function () {
  locLeScroll();
});


YAHOO.util.Event.onContentReady("lenyegtartalom", function () {

YAHOO.namespace("example.container");

var tomb = YAHOO.util.Dom.getElementsByClassName('mimi', 'a');
var t2 = new Array();
for( var i=0; i<tomb.length; i++ )
  {
  elem=tomb[i];
 // alert( elem.href );
 new YAHOO.widget.Tooltip("tt"+i, { context:elem, text:elem.title, autodismissdelay:15000 }  );
  }
 document.getElementById('leadhatja').innerHTML='Rendelését leadhatja email-ben is az <a href="mailto:info@naturalvitamin.hu">info@naturalvitamin.hu</a> címre, valamint telefonon is a 70/457-5113 számon'; 
  
});


 $(document).ready(function() {
    window.open('/lib/page/kosar.php','serverAction');
    
    
        $('#slider').s3Slider({
            timeOut: 7500
        });
    });
    
    
    $(document).ready(function()
{
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$("div.termekbencikkeleje").click(function()
    {
    if( $(this).next("div.termekbencikktartalom").is(":hidden" ) )
         $(this).next("div.termekbencikktartalom").show("slow");
    else
        $(this).next("div.termekbencikktartalom").slideUp();
    
	//	$(this).next("div.termekbencikktartalom").slideToggle(300).siblings("div.termekbencikktartalom").slideUp("slow");
       	//$(this).siblings().css({backgroundImage:"url(left.png)"});
	});
	//slides the element with class "menu_body" when mouse is over the paragraph      
  
  bannerjobb();
    	
});


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3211198-17']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


  function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return myWidth;
}

  function bannerjobb()
  {
  //alert( window.innerWidth );
  var szelesseg=alertSize();
  szelesseg=parseInt(szelesseg);
//  alert( szelesseg );
  if( szelesseg>1200 )
    {
    
        var ajanlatdiv=window.document.createElement("div");
        var jobb=(szelesseg/2)+500;
       ajanlatdiv.style.position='absolute';
       ajanlatdiv.style.top='200px';
       ajanlatdiv.style.left=jobb+'px';
     //  ajanlatdiv.style.width="100%";
     
     ajanlatdiv.style.width="100px";
       ajanlatdiv.style.height="131px";
       ajanlatdiv.setAttribute("id","bannerdiv");
    //   ajanlatdiv.style.backgroundImage='url(images/overlay.png)';
     
       ajanlatdiv.innerHTML='<a href="http://www.mlmuzlet.hu" target="_blank" ><img src="/banner0.jpg" style="border:2px solid green;  " ></a>';
       window.document.body.appendChild(ajanlatdiv);
    
    
    }
  
  }

        
