
function winOpen(type)  {
	if(type == 'typer')
		window.open("http://alvdalsfonster.se/content/5/6/Fonstertyper.html?noheader=1", "popup","width=600,height=490,scrollbars=yes,resizable=yes");
	if(type == 'sprojs')
		window.open("http://alvdalsfonster.se/content/5/7/Sprojs.html?noheader=1", "popup","width=600,height=490,scrollbars=yes,resizable=yes");
	if(type == 'glas')
		window.open("http://alvdalsfonster.se/content/5/10/Glas.html?noheader=1", "popup","width=600,height=490,scrollbars=yes,resizable=yes");
}
var ShowCaseImgURL = 'http://alvdalsfonster.se/www/images/temp/hus_fonster/';
var ShowCaseTargetArray = new Array();

ShowCaseTargetArray['F1'] = new Array('F1b.gif', 'F1c.gif');
ShowCaseTargetArray['F2'] = new Array('F2b.gif', 'F2c.gif');
ShowCaseTargetArray['F3'] = new Array('F3b.gif', 'F3c.gif');
ShowCaseTargetArray['F4'] = new Array('F4b.gif', 'F4c.gif');
ShowCaseTargetArray['F5'] = new Array('F5b.gif', 'F5c.gif');
ShowCaseTargetArray['F6'] = new Array('F6b.gif', 'F6c.gif');

var currentTargetImgElement = null;
var currentTopSmallImgElement = null;

function switchTargetWindows(img, num) {
	$(currentTargetImgElement).css('border', '0px');
	$(img).css('border', '1px dashed #6B99BF');
	currentTargetImgElement = img;
	$('#windowShowCaseTarget1 img').attr('src', ShowCaseImgURL+num+"b.gif");
	$('#windowShowCaseTarget2 img').attr('src', ShowCaseImgURL+num+"b.gif");
	$('#windowShowCaseTarget3 img').attr('src', ShowCaseImgURL+num+"b.gif");
	$('#windowShowCaseTarget4 img').attr('src', ShowCaseImgURL+num+"b.gif");
	$('#windowShowCaseTargetTop2 img').attr('src', ShowCaseImgURL+num+"c.gif");
	$('#windowShowCaseTargetTop3 img').attr('src', ShowCaseImgURL+num+"b.gif");
	$('#windowShowCaseTargetTop4 img').attr('src', ShowCaseImgURL+num+"c.gif");
}
function switchTopSmallWindow(img, num) {
	$(currentTopSmallImgElement).css('border', '0px');
	$(img).css('border', '1px dashed #6B99BF');
	currentTopSmallImgElement = img;
	$('#windowShowCaseTargetTop1 img').attr('src', ShowCaseImgURL+num+"_small.gif");
}

$(document).ready(function() {
	/*$('ul#nav > li').hover(function() {
		$('ul:first', this).show();
	},
	function() {
		$('ul:first', this).hide();
	});

	$('ul#nav li li').hover(function() {
		$('ul:first', this).each(function() {
			$(this).css('top', $(this).parent().position().top );
			$(this).css('left', $(this).parent().position().left + $(this).parent().width() );
			$(this).show();
		});
	},
	function() {
		$('ul:first', this).hide();
	});*/
	$('#banners').cycle({
		fx:'fade',
		speed:3500
	});
	jquerycssmenu.buildmenu("menu", arrowimages);
/*
	$("#gallery li a").click(function(){
		$("#gallery-large img").hide().attr({"src": $(this).attr("href"), "title": $("> img", this).attr("title")});
		return false;
	});
	$("#gallery-large>img").load(function(){$("#gallery-large>img:hidden").fadeIn("slow")});*/

	$("#gallery li a img").click(function(){
		$(this).attr('class', 'current');
	});
});

function setLocation(url){
	window.location.href = url;
}
