 	var maxExt1 = 1280;
	var maxExt = 1920;
	var minExt1 = 1000;
	var minExt = 1280;
	var k = 322/1920;
	var k1 = 422/1920;
	var swidth = screen.width;
	//var isChrome = (navigator.userAgent.toLowerCase().indexOf('chrome') > -1);
	
	if (swidth > maxExt1) 
	{
		cssFileName = '../../css/style.css';
		imgFolderName = '../../images';
		maxWidth = maxExt; 
		minWidth = minExt;
	}
	else
	{
		cssFileName = '../../css/style_1024.css';
		imgFolderName = '../../images_1024';
		maxWidth = maxExt1;
		minWidth = minExt1;
	}

	$.resizeFlash = function()
	{	
		currentWidth = $('#flashfooter').width();
		//currentWidth = $(window).width();
		
		if (currentWidth > maxWidth)
		{
			$('#flashfooter').height(maxWidth*k);
		}
		else if (currentWidth<minWidth)
		{
			$('.pics img').width(minWidth);
			$('.pics').width(minWidth);
			$('.pics img').height(minWidth*k1);
			$('.pics').height(minWidth*k1);
		}		
		else
		{
			$('.pics img').width(currentWidth);
			$('.pics').width(currentWidth);
			$('.pics img').height(currentWidth*k1);
			$('.pics').height(currentWidth*k1);
			$('#flashfooter').height($(document).width()*k);
		}
	}
	
	$.loadCSS = function() 
	{
		document.write('<link rel="stylesheet" href="'+cssFileName+'" type="text/css" />');
	};

	$(window).resize ( function() {
		$.resizeFlash();
	});
	
	$(document).ready(function () {
		$.resizeFlash();
		if ($.browser.msie && $.browser.version == 6) 
			$(document).pngFix(); 
		
		$('#fade').cycle({ 
			fx:      'fade',	
			pager:  '#nav',
			speed:    2000, 
			timeout:  8000,
			before: $.onBefore,
			pagerAnchorBuilder: function(idx, slide) { 
				return '#nav a:eq(' + idx + ')'; 
			} 
		});
	});
	
	$.onBefore = function() 
	{
		id = this.id; id = id.substr(3,1);
		for (i=1; i<4; i++)
			$('#'+i).attr('class', 'nav'+i);
		$('#'+id).attr('class', 'activenav'+id);
		$('#link').attr('href', links[id-1]);
	};
	
	$(function() { 
		$("form input").keypress(function (e) { 
			if (this.form.className == 'gsc-search-box') return e;
			if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {  				
				this.form.submit();  
				return false;  
			} else {  
				return true;  
			}	  
		});  
	});
	
$.createSelect = function( id_prefix ){
	var hideQJTimeout = false;

	function hideQuickJump(){
		resetQuickJump();
		hideQJTimeout = setTimeout(function(){ if( ! $('#'+id_prefix+'Options li.select-option-hovered').length ){ $('#'+id_prefix+'Options').fadeOut(); } }, 500);
	}
	function resetQuickJump(){
		clearTimeout( hideQJTimeout );
	}

	$('#'+id_prefix+'Area').click(function(){
		if( $('#'+id_prefix+'Options').is(':hidden') ){
			resetQuickJump();
			if( $('#'+id_prefix+'Options').is('.select-options-invisible') )
				$('#'+id_prefix+'Options').removeClass('select-options-invisible').addClass('select-options-visible').appendTo('body');

			$('#'+id_prefix+'Options').css({ position: 'absolute', top: $(this).offset().top + $(this).height() - 1, left: $(this).offset().left + ($.browser.mozilla ? 1 : 0), width: $(this).width() - 2 }).show();

			var offset = $('#'+id_prefix+'Options').offset().top + $('#'+id_prefix+'Options').height();
			offset -= $(window).height();

			var ScrollTop = document.body.scrollTop;
			if (ScrollTop == 0)	{
			    if (window.pageYOffset)
			        ScrollTop = window.pageYOffset;
			    else
			        ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
			}

			offset -= ScrollTop;

			if( offset > 0 ){

				if( $(this).offset().top - $('#'+id_prefix+'Options').height() > ScrollTop ){
					$('#'+id_prefix+'Options').css({ position: 'absolute', 'top': $(this).offset().top - $('#'+id_prefix+'Options').height() - 2, left: $(this).offset().left + ($.browser.mozilla ? 1 : 0), width: $(this).width() - 2 });
				}else{
					$.scrollTo('+=' + (offset + 10) + 'px', { duration:500, easing:'swing' });
				}
			}

		}else{
			$('#'+id_prefix+'Options').hide();
		}
	}).mouseover( resetQuickJump ).mouseout( hideQuickJump )
	.children('#'+id_prefix+'Options').hover( resetQuickJump, hideQuickJump )
	.children('li').hover(function(){
		resetQuickJump();
		$(this).addClass('select-option-hovered');
	},function(){
		$(this).removeClass('select-option-hovered');
	}).children('a').click(function(){
		$('#'+id_prefix+'Text').text($(this).text());
		//document.location = $(this).attr('rel');
	});
}
	
	$.loadCSS();