
function submitContactForm(){
        document.contact_form.form_sent.value = 1;
        document.contact_form.submit();
}
function open_print_window(URLtoOpen, left, top, width, height, titlebar, menubar, location, resizable, toolbar, scrollbars, status)
{
window.open(URLtoOpen,'','left='+left+',top='+top+',width='+width+',height='+height+',titlebar='+titlebar+',menubar='+menubar+',location='+location+',resizable='+resizable+',toolbar='+toolbar+',scrollbars='+scrollbars+',status='+status);
}
function isEmail(string)
         {
          if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
           return true;
           else
             return false;
         }
function  check_password(string)
    {
       if (!string) return false;
           var Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
          if ( (string.length<6) || (string.length>14) )
           return false;
         for (var i = 0; i < string.length; i++) {
            if (Chars.indexOf(string.charAt(i)) == -1)
            return false;
           }
         return true;
    }
function updater(option)
{
  document.updater_form.security_login.value='';
  document.updater_form.action='update_profile.php';
  document.updater_form.submit();
}

function updater_codes(option)
{
  document.updater_form_code.security_login_code.value='';
  document.updater_form_code.action='codes.php';
  document.updater_form_code.submit();
}

function set_registration_option(option,extra1)
 {
  //alert(extranr);
  document.register_form.save_form.value=option;
  document.register_form.extra1.value=extra1;
  document.register_form.submit();
 }

 function set_update_option(option,extra1,extra2)
 {
  document.update_form.save_form.value=option;
  document.update_form.extra1.value=extra1;
  document.update_form.extra2.value=extra2;
  document.update_form.submit();
 }

function set_delete_option(option,id,text)
 {
  document.update_form.delete_id.value=id;
   if (option == "delete")  if (!confirm(text)) return;
  document.update_form.action='deletechild.php';
  document.update_form.submit();
 }
 
 function send_pregnancy_calendar(opt, w, cat)
{
	document.pregnancy.action='preg_calendar.php';
	document.pregnancy.week_nr.value=w;
	document.pregnancy.option.value=opt;
	document.pregnancy.categ.value=cat;
	document.pregnancy.submit();
}

function popupWindow( Page, Width, Height ){
	/*if(isNaN(window.screenLeft))
	{
		popWindow = window.open( Page,"popWindow","width="+Width+",height="+Height+",scrollbars=0,left="+((document.width-Width)+window.screenX)+",top="+((document.height-Height)+window.screenY)).focus();		
		
	}
	else
	popWindow = window.open( Page,"popWindow","width="+Width+",height="+Height+",scrollbars=0,left="+((document.width-Width)+window.screenLeft)+",top="+((document.height-Height)+window.screenRight)).focus();		*/
	popWindow = window.open( Page,"popWindow","width="+Width+",height="+Height+",scrollbars=1,left="+((screen.width-Width)/2)+",top="+((screen.height-Height)/2)).focus();
}
function Hide()  
{    
     document.getElementById('DIV').style.display='none'; 
} 
function MM_showHideLayers(layer,something,actions) { //v3.0
  if(actions=='hide')
  {
  	document.getElementById(layer).style.display='none';
  }
}
function back2contact() { //v3.0
  window.opener.location.href="contact.php";
  window.opener.focus();
  //return;
}
function back2awake() { //v3.0
  window.opener.location.href="advertorial.php";
  window.opener.focus();
  //return;
}
function back2art() { //v3.0
  window.opener.location.href="le_read_article.php?artid=20000";
  window.opener.focus();
  //return;
}
function open_priv() { //v3.0
window.open('http://www.pg.com/privacy/hungarian/privacy_notice.html', '', '');
}
function back2home() { //v3.0
  window.opener.location.href="home.php";
  window.opener.focus();
  //return;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function open_popup(){
	popup = window.open('popup/pamppopup_hu.html','','toolbars=no,width=550,height=450');
	popup.window.moveTo(screen.width/2-179,screen.height/2-312);
	//var myLeft = (screen.width/2)-550;
	//var myTop = (screen.height/2)-450;
	//popup = window.open('popup/elmenypark.html','','toolbars=no;width=550;height=450;left=' + myLeft + ';top=' + myTop );
	//popup.window.moveTo(myLeft,myTop);

}

function open_popup_promo(){
	popup = window.open('popup/promo.html','','toolbars=no,width=550,height=450');
	//popup.window.moveTo(screen.width/2-250,screen.height/2-225);
}

function open_popup_code_pleaselogin(){
	//popupcode = window.open('popup/code.html','popup_code','toolbars=no,width=550,height=450');
	//window.open('popup/code_pleaselogin.html','','toolbars=no,width=550,height=450');
	//popup.window.moveTo(screen.width/2-250,screen.height/2-225);
}

function open_popup_code_typecode(){
	//popupcode = window.open('popup/code.html','popup_code','toolbars=no,width=550,height=450');
	//window.open('code_typecode.php','','toolbars=no,width=550,height=450');
	//popup.window.moveTo(screen.width/2-250,screen.height/2-225);
}

function open_popup1(){
	popup1 = window.open('popup/incentive.php','','toolbars=no,width=450,height=350');
	popup1.window.moveTo((screen.width-450)/2,screen.height/2-300);
}

function open_popup2(){
	popup1 = window.open('popup/naturals.php','','toolbars=no,width=550,height=450');
	popup1.window.moveTo((screen.width-550)/2,(screen.height-450)/2);
}

function open_vizilo(){
	popup0 = window.open('popup/vizilo.html','','toolbars=no,width=352,height=288');
	popup0.window.moveTo((screen.width-352)/2,(screen.height-288)/2);
}

function MM_showHideLayers(layer,something,actions) { //v3.0
  if(actions=='hide')
  {
  	document.getElementById(layer).style.display='none';
  }
}

function close_overlay() { //v3.0
  document.getElementById('overlay').style.display='none';
  document.getElementById('overlay1').style.display='block';
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		en_GB_nav_101002 = newImage("images/{$lang_loc}_nav_101-02.gif");
		en_GB_nav_102005 = newImage("images/{$lang_loc}_nav_102-05.gif");
		en_GB_nav_103008 = newImage("images/{$lang_loc}_nav_103-08.gif");
		en_GB_nav_104011 = newImage("images/{$lang_loc}_nav_104-11.gif");
		preloadFlag = true;
	}
}

function open_dr(){
	popup0 = window.open('popup.php','','toolbars=no,width=980,height=590');
}

function animation_banner()
{
	if(document.getElementById('overlay').style.display=='none')
	{
		var toleft = (window.screen.width - 475)/2;
		document.getElementById('overlay').style.left=toleft+'px';
		if(document.getElementById('over1ay1'))
		{
			document.getElementById('over1ay1').style.display='none';
		}
		document.getElementById('overlay').style.display='block';
		
	document.getElementById('overlay').innerHTML="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='455' height='186' id='cz' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='false' /><param name='movie' value='banners/home_hu.swf' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='bgcolor' value='#ffffff' /><embed src='banners/home_hu.swf' quality='high' wmode='transparent' bgcolor='#ffffff' width='455' height='186' name='cz' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
	
		document.getElementById('overlay').style.zindex='110000';
	}
}

function animation_banner2()
{
	if(document.getElementById('over').style.display=='none')
	{
		var toleft = (window.screen.width - 475)/2;
		document.getElementById('over').style.left=toleft+'px';
		if(document.getElementById('over1'))
		{
			document.getElementById('over1').style.display='none';
		}
		document.getElementById('over').style.display='block';
		
		/*document.getElementById('overlay').innerHTML="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='825' height='600'><param name='movie' value='swf/site/home_banner.swf'><param name='quality' value='high'><param name='flashvars' value='&awake_page={/literal}{$url.awake_page}&article_page={$url.article_page}&product_page={$url.product_page}&article_page1={$url.article_page1}'><param name='wmode' value='transparent'> <embed src='swf/site/home_banner.swf' quality='high' flashvars='&awake_page={$url.awake_page}&product_page={$url.product_page}&article_page={$url.article_page}&article_page1={$url.article_page1}{literal}' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='825' height='600' wmode='transparent'></embed></object>";*/
	
		document.getElementById('over').style.zindex='1000';
	}
}
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_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;
}

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_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_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;
}

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 SwapMyImg(obj,src){
    obj.src = src;
  }

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
   if ((version >= 5.5) && (version < 7) && (document.body.filters))
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
}  

function hideBlaster()
{
	if(document.getElementById('overlay').style.display=='none')
	{
		var toleft = (window.screen.width)/2 - 225;		
		document.getElementById('overlay').style.left=toleft+'px';
		if(document.getElementById('overlay1'))
		{
			
			document.getElementById('overlay1').style.display='none';
		}
		document.getElementById('overlay').style.display='block';
		
	}
}

function closing_overlay(){
	document.getElementById('overlay').style.display='none';
}

function cls(){
	document.getElementById('over').style.display='none';
		
}