 function showFlashHome(src, width){
   $('#flashcontent').flash({
    src: src,
    width: 973,
    height: 420,
    bgcolor: '#000000',
    wmode: 'transparent'
   });
  }

function showFlash(src, width){
  	$('#flashcontent').flash({
  		src: src,
  		width: width,
  		//height: 510,
  		bgcolor: '#000000',
  		wmode: 'transparent'
  	});
  }
  
  function showFlashFixedSize(div, src, width, height){
  	$('#'+div).flash({
  		src: src,
  		width: width,
  		height: height,
  		bgcolor: '#000000',
  		wmode: 'transparent'
  	});
  }
  
  function showFlashAutoSize(div, src){
  	$('#'+div).flash({
  		src: src,
  		//width: width,
  		//height: 510,
  		bgcolor: '#000000',
  		wmode: 'transparent'
  	});
  }
$(document).ready(function(){
  /**/
	$("#main_menu ul.sf-menu").css('display', 'block');
	$(function(){
		$("#main_menu ul.sf-menu")
    /*.supersubs({
	    minWidth:    5,   // minimum width of sub-menus in em units 
	    maxWidth:    127,   // maximum width of sub-menus in em units 
	    extraWidth:  1     // extra width can ensure lines don't sometimes turn
							// over
	                       // due to slight rounding differences and
							// font-family
		})*/
    .superfish({delay : 1});
	});
	$("#main_menu ul.sf-menu").css('display', 'none');
		/**/
	   
	$("#bottom_menu ul.sf-menu").css('display', 'block');
	$(function(){
		$("#bottom_menu ul.sf-menu ul")./*supersubs({ 
	    minWidth:    5,   // minimum width of sub-menus in em units 
	    maxWidth:    127,   // maximum width of sub-menus in em units 
	    extraWidth:  1     // extra width can ensure lines don't sometimes turn
							// over
	                       // due to slight rounding differences and
							// font-family
		})./**/superfish({
			delay : 400,
			animation: {height:'show'},
			onBeforeShow:  function(){
				//console.debug($(this).parent().children('ul').css('display'));
				//$(this).parent().find('ul.sf-vertical').css('display', 'block');
				//$(this).parent().find('ul.sf-vertical').css('visibility', 'visible');
			},
			onHide	 : function(){
				if($.browser.msie || $.browser.opera){
					$(this).addClass('sfHover').show().css('visibility','visible');
				}
				if($(this).css('visibility') == 'hidden'){
					$(this).css('visibility', 'visible');
					$(this).css('display', 'block');
				}
			}
		});
	});
		
	$('ul.graymenu').children('li').hover(
		function() {$(this).css('z-index', '1');},
		function() {$(this).css('z-index', '0');}
	);
	
	$(".hcs ul li.flevel").children('a').click(function(){
		if($(this).hasClass('down'))
			$(this).removeClass('down');
		else
			$(this).addClass('down');

		$(this).parent('li').children('.border_fq').slideToggle(300);
		$(this).parent('li').siblings('li.top').children().next().slideUp(300);
		$(this).parent('li').siblings('li.top').find('a.ahtop').removeClass('down');
	});

	$(".hcs ul li.flevel").find('a.ahtop').click(function(){
		var parentLi = $(this).parent().parent().parent();
		if($(this).hasClass('down'))
			$(this).removeClass('down');
		else
			$(this).addClass('down');
		parentLi.children().next().slideToggle(300);
		parentLi.siblings().children().next().slideUp(300);
		parentLi.siblings().children('a').removeClass('down');
	});

	$(function(){
		$("ul.left-sf-menu")
    /*
    .supersubs({
		minWidth:    10,   // minimum width of sub-menus in em units
		maxWidth:    127,   // maximum width of sub-menus in em units
		extraWidth:  1     // extra width can ensure lines don't sometimes turn
							// over
						   // due to slight rounding differences and
							// font-family
		})
    */
    .superfish({
			delay : 1,
			autoArrows: false
		});
	});
									
		$(".hcs ul li.flevel2").children('a').click(function(){
			if($(this).hasClass('down'))
				$(this).removeClass('down');
			else
				$(this).addClass('down');

			$(this).parent('li').children('.border_fq2').slideToggle(300);
			$(this).parent('li').siblings('li.top').children().next().slideUp(300);
			$(this).parent('li').siblings('li.top').find('a.ahtop').removeClass('down');
		});

		$(".hcs ul li.flevel2").find('a.ahtop').click(function(){
			var parentLi = $(this).parent().parent().parent();
			if($(this).hasClass('down'))
				$(this).removeClass('down');
			else
				$(this).addClass('down');
			parentLi.children().next().slideToggle(300);
			parentLi.siblings().children().next().slideUp(300);
			parentLi.siblings().children('a').removeClass('down');
		});

});

function searchDefaultText(defaultText) {
	$("#searchQuery").focus(function(){
		if($(this).val() == defaultText)
			$(this).val("");
		}).blur(function(){
		if($(this).val() == ""){
			$(this).val(defaultText);
		}
	});
}

function isValidEmail( sField )
{
	var emailRegEx = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/
	return( emailRegEx.test( sField ) );
}

function DoRegisterNewsLetter( oForm, sMsgOnError )
{
	if( oForm.newsletter_email.value.length > 0 &&
		isValidEmail( oForm.newsletter_email.value ) &&
		( oForm.newsletter_country.value > 0 ||
			( oForm.newsletter_country.value == -1 && oForm.newsletter_group.value > 0 ) ) )
	{
		return( true );
	}

	alert( sMsgOnError );

	return( false );
}

function DoSearch( oForm )
{
	return( oForm._search.value.length > 0 )
}

