
$(document).ready(function(){

ua = navigator.userAgent.toLowerCase(); 
isIE = ((ua.indexOf("msie") != -1) );
isIE6 = ((ua.indexOf("msie 6.0") != -1) );
isOPERA = ((ua.indexOf("opera") != -1) );
isFF = ((ua.indexOf("firefox") != -1) );
isSafari = ((ua.indexOf("safari") != -1) );

Inittopmenu();

});
//-----------------------------------------------
function Inittopmenu()
{
last=0;

$('#topmenu > li ul').each(function(i){
  width=0;
  
  $(this).find('a').each(function(j) {    
        
				width = Math.max( width, $(this).outerWidth() );

      //alert($(this).outerWidth());
			});
			  
	$(this).css('width', width+'px');			
  $(this).css('display', 'none');
  $(this).css('left', '0px');		        
});

$('#topmenu > li ul a').css('float', 'none');

$('#topmenu > li > a').bind("mouseenter",
	function(event) 
		{
		var index= $('#topmenu > li').index( $(this).parent('li') );
		
		if(last!=index)
		$('#topmenu ul').slideUp(200);
		
		last=index;
								  		  
		$('#topmenu > li:eq('+index+')').find('ul').slideDown(200, function() {  } );		
    } 
  );
  
$('#topmenu').bind("mouseleave",
	function(event) 
		{
		$('#topmenu >li ul').slideUp(200);	        	
    }
  );

}
//--------------------------------------
function DecWriteMail(decstring)
{
var buff='';

for(var i=0;i<decstring.length;i++)
	{
	if(i%2==0)
		buff+=decstring.charAt(i);
		

	}
document.write('<a href="mailto:'+buff+'">'+buff+'</a>');
}
//-----------------------------------------------
function WriteFlash(width,height,src)
{
fobj='';
fobj+='<object type="application/x-shockwave-flash" data="'+src+'" width="'+width+'" height="'+height+'">';
fobj+='<param name="movie" value="'+src+'"/>';
fobj+='<param name="wmode" value="transparent"/>';
fobj+='</object>';

document.write(fobj);
}
//-----------------------------------------------
function InputBlur(inp,deftext)
{
if(inp.value=='')
inp.value=deftext;
}
//-----------------------------------------------
function InputFocus(inp,deftext)
{
if(inp.value==deftext)
inp.value='';
}
//-----------------------------------------------
function openImageWin(url,w,h,hwin)
{
  url='http://www.portfolio.hu'+url;
	var ztop  = ((screen.availHeight-h)/2)-80;
	var zleft = ((screen.availWidth-w)/2);
	parem='status=0,menubar=0,resizable=1,copyhistory=no,directories=no,scrollbars=1,width='+w+',height='+hwin+',top='+ztop+',left='+zleft+'';
	window2=window.open('','window2',parem);
	window2.document.open("text/html","replace");
	window2.document.writeln("<html><head><title>Portfolio.hu</title></head><body bgcolor=white style='margin:0 0 0 0'>");
	window2.document.writeln("<a href='javascript:self.close()'><img src="+url+" width="+w+" height="+h+" border=0></a>");
	window2.document.writeln("</body></html>");
	window2.document.close();
	window2.focus();
}
//-----------------------------------------------
function View(wth,hei,src) 
{
srcp="imgview.php?width="+wth+"&height="+hei+"&src="+src;

view=window.open(srcp,'user','width='+wth+',height='+hei+',status=0,resizable=0');
var xc =(screen.width - wth) / 2;
var yc =(screen.height - hei) / 2;
view.moveTo(xc, yc);
}
//-----------------------------------------------
function TickerInfo(papirid)
{
$.ajax({
   type: "POST",
   url: "ajaxindex.php",
   data: ({f : 1 ,s : 1, papirid : papirid}),
   success: function(result){  $('#tickinfotablecontainer').html(result); }
 });
}
