﻿var ns4=document.layers;
var ie4=document.all;
var ns6=document.getElementById&&!document.all;

function imgChange(imgID,pTodo,pMode) {
	if (pMode == 1) {
		if (document.images && imgID && pTodo && ( document.getElementById(imgID).src.search("_off") != -1 ||  document.getElementById(imgID).src.search("_on") != -1 ) ) {
			var imgStatus = "off";
			if (pTodo==1) imgStatus = "on";
			if (document.getElementById(imgID)) {
				var wsrc = document.getElementById(imgID).src;
				var w = wsrc.substr(0,wsrc.lastIndexOf("_")+1);
				var wExt = wsrc.substr(wsrc.lastIndexOf("."),4);
				document.getElementById(imgID).src = w + imgStatus + wExt;
			}
		}
	} else {
		if (document.images && imgID && pTodo && ( imgID.src.search("_off") != -1 ||  imgID.src.search("_on") != -1 ) ) {
			var imgStatus = "off";
			if (pTodo==1) imgStatus = "on";
			if (imgID) {
				var wsrc = imgID.src;
				var w = wsrc.substr(0,wsrc.lastIndexOf("_")+1);
				var wExt = wsrc.substr(wsrc.lastIndexOf("."),4);
				imgID.src = w + imgStatus + wExt;
			}
		}
	}
}

function menuBuilder( obj ) {
	document.write('<div><img src="images/title_'+obj+'.gif" alt="" width="373" height="34" border="0"></div>');
	document.write('<div><img src="images/spacer.gif" width="1" height="4" alt=""></div>');
	/*if (obj != 1) {
		document.write('<div><a href="lazito_programok.html"><img src="images/menu_1_off.gif" width="373" height="22" alt="" onmouseover="imgChange(this,1)" onmouseout="imgChange(this,2)"></a></div>');
	}*/
	if (obj != 2) {
		document.write('<div><a href="kitkatalogus.html"><img src="images/menu_2_off.gif" width="373" height="22" alt="" onmouseover="imgChange(this,1)" onmouseout="imgChange(this,2)"></a></div>');
	}
	if (obj != 3) {
		document.write('<div><a href="kitkat_sztori.html"><img src="images/menu_3_off.gif" width="373" height="22" alt="" onmouseover="imgChange(this,1)" onmouseout="imgChange(this,2)"></a></div>');
	}
	/*if (obj != 4) {
		document.write('<div><a href="kitkatv.html"><img src="images/menu_4_off.gif" width="373" height="22" alt="" onmouseover="imgChange(this,1)" onmouseout="imgChange(this,2)"></a></div>');
	}*/
	if (obj != 5) {
		document.write('<div><a href="csak_lazan.html"><img src="images/menu_5_off.gif" width="373" height="22" alt="" onmouseover="imgChange(this,1)" onmouseout="imgChange(this,2)"></a></div>');
	}
	/*if (obj != 7) {
		document.write('<div><a href="gallery.aspx"><img src="images/menu_7_off.gif" width="373" height="22" alt="" onmouseover="imgChange(this,1)" onmouseout="imgChange(this,2)"></a></div>');
	}
	if (obj != 8) {
		document.write('<div><a href="kivanj.html"><img src="images/menu_1_off.gif" width="373" height="22" alt="" onmouseover="imgChange(this,1)" onmouseout="imgChange(this,2)"></a></div>');
	}*/
}

function footerBuilder() {
	document.write('<br><img src="images/spacer.gif" width="1" height="10" alt=""><br><a href="http://www.nestle.hu/StaticPages/0_01_JogiTudnivalok.aspx" target="_blank">Jogi tudnivalók</a>&nbsp; | &nbsp;');
	document.write('<a href="http://www.nestle.hu" target="_blank">www.nestle.hu</a>&nbsp; | &nbsp;');
	document.write('<a href="http://www.nestle.hu/StaticPages/5_01_Koszonto.aspx" target="_blank">Nestlé Fogyasztói Szolgálat</a><br><br>');
}

function flashAblakOpen() {
	nyit = window.open("jatek.html","flash","width=625,height=420,top=10,left=10,status=no,menubar=no,toolbar=no,location=no,history=no,resizable=no,scrollbars=yes");
	nyit.focus();
}

function danceAblakOpen() {
	tancol = window.open("tanc.html","flashdance","width=530,height=400,top=10,left=10,status=no,menubar=no,toolbar=no,location=no,history=no,resizable=no,scrollbars=no");
	tancol.focus();
}



function displayFlashObject( path, w, h, id, bg ) {
      if ( ie4 ) {
            document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" id="' + id + '" align="middle">');
            document.write('<param name="allowScriptAccess" value="sameDomain">');
            document.write('<param name="movie" value="' + path + '">');
            document.write('<param name="quality" value="high">');
            document.write('<param name="wmode" value="transparent">');
			if ( bg != "" ) {
            	document.write('<param name="bgcolor" value="' + bg + '">');
			}
			if (navigator.userAgent.search("Opera") != -1) {
				document.write('<embed src="' + path + '" width="' + w + '" height="' + h + '" bgcolor="#B80404"></embed>');
			}
            document.write('</object>');
      } else {
            document.write('<div style="z-index: -1"><object data="' + path + '" width="' + w + '" height="' + h + '" id="' + id + '" type="application/x-shockwave-flash">');
            document.write('<param name="quality" value="high">');
            if ( bg != "" ) {
            	document.write('<param name="bgcolor" value="' + bg + '">');
			}
			document.write('<param name="wmode" value="transparent">');
            document.write('<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">');
            document.write('</object></div>');
      }
}



function popup( page, width, height ) {
	var screenLeft = (screen.width - width) / 2;
	var screenTop = (screen.height - height) / 2;
	window.open( page, '',"left=" + screenLeft +",top=" + screenTop + ",width=" + width + ",height=" + height + ",menubar=no,location=no,resizable=yes,scrollbars=no,status=no" )
}

