function intelicopyright(var1,var2)
{
	var currdate=new Date();
	var Year=currdate.getFullYear();
	var itext="";
	if(var1=="") { itext="&copy; "+Year+" "+var2; } else { itext="&copy; "+var1+" - "+Year+" "+var2; }
	document.write(itext);
}
function intelifieldcheck(var1,var2,var3,var4)
{
var color="";
var unicode="";
	if(var1=="num")
	{
		var unicode=var2.charCode? var2.charCode : var2.keyCode
		if (unicode!=8) { if (unicode<48||unicode>57) return false; }
	}
	else if(var1=="char")
	{
		var unicode=var2.charCode? var2.charCode : var2.keyCode
		if (unicode!=8) { if (unicode<64 && unicode<90) return false; }
	}
	else if(var1=="maxnum")
	{
		if(var2.value.length < var3)
		{
		var color="lightcoral";
		var2.style.background = color;
		}
		else
		{
			if(var2.value.length > var4)
			{
			var color="lightcoral";
			var2.style.background = color;
			var2.value= var2.value.substring(0,var4) 
			}
			else
			{
			var color="lightgreen";
			var2.style.background = color;
			}
		}		
	}
	else
	{
	
	}
}
function loader(url, target)
{
	//document.getElementById(target).innerHTML = ' Betoltes...';
	if (window.XMLHttpRequest)
	{
	req = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (req != undefined)
	{
	req.onreadystatechange = function() {loaderDone(url, target);};
	req.open("GET", url, true);
	req.send("");
	}
}  

function loaderDone(url, target)
{
	if (req.readyState == 4)
	{
		if (req.status == 200)
		{
		document.getElementById(target).innerHTML = req.responseText;
		}
		else
		{
		document.getElementById(target).innerHTML=" Hiba a betoltes soran:\n"+ req.status + "\n" +req.statusText;
		}
	}
}

function inteliloader(name, div)
{
	if(name)
	{
	loader(name,div);
	}
return false;
}


function inteliprint(id)
{
str=document.getElementById(id).innerHTML;
newwin=window.open('','printwin','left=200,top=100,width=540,height=600');
newwin.document.write('<html>\n<head>\n');
newwin.document.write('<title></title>\n');
newwin.document.write('<style type="text/css">\n');
newwin.document.write('body { font-family: Arial; font-weight: normal; background-color: #FFFFFF; }\n');
newwin.document.write('.prod_left { width: 279px; height: 210px; float: left; }\n');
newwin.document.write('.prod_left img { width: 279px; height: 210px; border:0; }\n');
newwin.document.write('.prod_right { width: 182px; height: 170px; padding: 20px; float: left; }\n');
newwin.document.write('.prod_right .pricebox { width: 182px; height: 170px; color: #7D7D7D; font-weight: normal; font-size: 8pt; }\n');
newwin.document.write('.prod_right .tipbox { display: none; }\n');
newwin.document.write('.prod_right .cartbox { display: none; }\n');
newwin.document.write('.prod_desc {width: 501px; padding: 20px; color: #7D7D7D; font-size: 8pt; font-weight: normal; }\n');
newwin.document.write('.prod_sc {width: 501px; padding: 20px; color: #7D7D7D; font-size: 8pt; font-weight: normal; }\n');
newwin.document.write('h4 { color: #999999; clear: both; width: 487px; line-height: 100px; height: 100px; font-weight: normal; font-size: 8.5pt; text-align: center; }\n');
newwin.document.write('body { margin: 0; padding: 10px; text-align: left; }\n');
newwin.document.write('</style>\n');
newwin.document.write('<script type="text/javascript">\n');
newwin.document.write('function chkstate(){\n');
newwin.document.write('if(document.readyState=="complete"){\n');
newwin.document.write('window.close();\n');
newwin.document.write('}\n');
newwin.document.write('else{\n');
newwin.document.write('setTimeout("chkstate()",2000);\n');
newwin.document.write('}\n');
newwin.document.write('}\n');
newwin.document.write('function print_win(){\n');
newwin.document.write('window.print();\n');
newwin.document.write('chkstate();\n');
newwin.document.write('}\n');
newwin.document.write('<\/script>\n');
newwin.document.write('</head>\n');
newwin.document.write('<body onload="print_win();">\n');
newwin.document.write(str);
newwin.document.write('<h4><script type="text/javascript">var currdate=new Date(); var Year=currdate.getFullYear(); var Month=currdate.getMonth()+1; var Day=currdate.getDate(); document.write(document.location.host+" - "+Year+"/"+Month+"/"+Day);</script></h4>\n');
newwin.document.write('</body>\n');
newwin.document.write('</html>\n');
newwin.document.close();
}

function inteliplayer(src,width,height)
{
var id=Math.round(Math.random()*100000000);
var version="9.0.0.0";
var bgcolor="FFFFFF";
var flashtohtml = new String();
	
	flashtohtml += '<object width="'+width+'" height="'+height+'" id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';
	flashtohtml += '<param name="movie" value="c/t/gfx_hu/'+src+'" />';
	flashtohtml += '<param name="menu" value="false" />';
	flashtohtml += '<embed src="c/t/gfx_hu/'+src+'" width="'+width+'" height="'+height+'" name="'+id+'" type="application/x-shockwave-flash" />';
	flashtohtml += '<\/object>';
	
document.write(flashtohtml);
}


function inteliwindow(var1,var2,var3,var4,var5,var6,var7)
{
	if (var3=="pictures") { url='picture?pid='+var1+'&name='+var2+'&IMRSID='+var6; }
	if (var3=="orders") { url='print?pid='+var1+'&mode='+var3+'&IMRSID='+var6; }
	if (var3=="newsletter") { url='dump.php?file='+var1+'&mode='+var3+'&IMRSID='+var6; }
	if (var4=="") var4=200;
	if (var5=="") var5=200;
	if (var7=="") var7=no;
	felso=Math.floor((screen.height-var4)+30);
	bal=Math.floor((screen.width-var5)/4);
	if (typeof usrwindow != 'undefined') { if (!usrwindow.closed) { usrwindow.close(); } }
	usrwindow=window.open(url, var3, 'toolbar=no,scrollbars='+var7+',menubar=no,top='+felso+',left='+bal+',resizable=no,status=yes,hotkeys=no,width='+var4+',height='+var5);
}
//alert(screen.width);

function intelicallcenter(var1,var2,var3)
{
	Hours=var1.getHours(); Day=var1.getDay();
	if (Hours>=9  & Hours<17 & Day!=6 & Day!=0)
	{
	ctext = '<ul><li class=\"left\"><span>Skype státusz:<\/span><br /><font color=\"#'+var3+'\">Online<\/font><\/li><li class=\"right\"><a href=\"callto:'+var2+'\" title=\"Ingyenesen hívható ügyfélszolgálat: '+ var2 + '\"><img src=\"c/t/gfx_hu/skype_online.jpg\" alt=\"\" /><\/a><\/li><\/ul>';
	}
	else
	{
	ctext = '<ul><li class=\"left\"><span>Skype státusz:<\/span><br />Offline<\/li><li class=\"right\"><img src=\"c/t/gfx_hu/skype_offline.jpg\" alt=\"\" /><\/li><\/ul>';
	} 
	document.write(ctext);
}



















function getCookie(Name)
{
var c_status = Name + "=";
	if (document.cookie.length > 0)
	{
    	offset = document.cookie.indexOf(c_status);
    		if (offset != -1)
		{
      		offset += c_status.length;
      		end = document.cookie.indexOf(";", offset);
      		if (end == -1) end = document.cookie.length;
      		return unescape(document.cookie.substring(offset, end));
    		}
  	}
}
function setCookie(name,value,expire)
{
var path="/";
var domain="";
var secure="";
document.cookie = name + "=" +escape( value ) +
( ( expire ) ? ";expires=" + expire.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}


function intelisearch(var1)
{
	if (var1=="simple")
		{
		expDate = new Date();
  		expDate.setTime(expDate.getTime() + (1*24*60*60*1000));
  		setCookie("sstatus",var1,expDate);
		document.getElementById('search_text').innerHTML = "<ul><li class=\"searchkey\"><a href=\"javascript:intelisearch('advanced');\">Speciális keresés<\/a></li><li class=\"searchbutt\">&nbsp;</li></ul>";
		}
	if (var1=="advanced")
		{
		expDate = new Date();
  		expDate.setTime(expDate.getTime() + (1*24*60*60*1000));
  		setCookie("sstatus",var1,expDate);
		document.getElementById('search_text').innerHTML = "<ul><li class=\"searchkey\">Hasonló nevűeket is</li><li class=\"searchbutt\"><input type=\"checkbox\" name=\"s\" style=\"width:15px;\" /></li></ul><ul><li class=\"searchkey\">Gyártó nevében</li><li class=\"searchbutt\"><input type=\"checkbox\" checked name=\"b\" style=\"width:15px;\" /></li></ul><ul><li class=\"searchkey\">Termék leírásában</li><li class=\"searchbutt\"><input type=\"checkbox\" checked name=\"d\" style=\"width:15px;\" /></li></ul><ul><li class=\"searchkey\"><a href=\"javascript:intelisearch('simple');\">Egyszerű keresés<\/a></li><li class=\"searchbutt\">&nbsp;</li></ul>";
		}
}

function intelilink(var1,var2)
{
var wwidth=300;
var wheight=150;
felso=Math.floor((screen.height-460)/2);
bal=Math.floor((screen.width-700)/2);
felso=Math.floor((screen.height-wheight)/2);
bal=Math.floor((screen.width-wwidth)/2);
if (typeof usrwindow != 'undefined'){
if (!usrwindow.closed){usrwindow.close();}}
usrwindow=window.open('html.htm?mode='+var1+'&target='+var2, 'html', 'toolbar=no,scrollbars=no,menubar=no,top='+felso+',left='+bal+',resizable=no,status=yes,hotkeys=no,width='+wwidth+',height='+wheight);
}
function intelimail(var1)
{
var alltags=document.getElementsByTagName(var1);
	if(alltags!="")
	{
	var replaces=0;
	var i=0;
		for (i=0; i < alltags.length; i++)
		{
			while (alltags[i].innerHTML.indexOf('#kukac#') != -1 && replaces < 10)
			{
       			alltags[i].innerHTML = alltags[i].innerHTML.replace('#kukac#', String.fromCharCode(64));
			alltags[i].innerHTML = alltags[i].innerHTML.replace('#pont#', String.fromCharCode(46));
			replaces++;
			}
		}
	}
}