﻿$(document).ready(function() {
	$("#allaharrad a.btn").click(function() {
		if ($("#allaharrad #btn_bar").css("width") != "814px") {
			$("#allaharrad #btn_bar").animate({
				width: "814px"
			}, 800, "swing");
		} else {
			$("#allaharrad #btn_bar").animate({
				width: "5px"
			}, 800, "swing");
		}
		return false;
	});

	$("#startflash").flash({ src: '/screen.swf', width: 429, height: 264 });

	$("#galleri a").lightBox();
	
});

function swapDiv(elColl, elShow) {
	var toDo = 0;
	subLength = elColl.length;
	if ($("#" + elShow).css("display") == "none") { toDo = 1; }
	$("body div").each(function() {
		if ($(this).attr("id").substring(0, subLength) == elColl && $(this).attr("id") != elShow) {
			$(this).slideUp();
		}
	});
	if (toDo == 1) {
		$("#" + elShow).slideDown();
	} else {
		$("#" + elShow).slideUp();
	}
}


function swapDiv2(elColl, elShow) {
	var toDo = 0;
	subLength = elColl.length;
	$("body div").each(function() {
		if ($(this).attr("id").substring(0, subLength) == elColl && $(this).attr("id") != elShow) {
			$(this).hide();
		}
	});
	$("#" + elShow).show();
}

function swapDiv3(elColl, elShow) {
	subLength = elColl.length;
	$("body div").each(function() {
		if ($(this).attr("id").substring(0, subLength) == elColl && $(this).attr("id") != elShow && $(this).css("display") == "block") {
			$(this).fadeOut(200,function() { $("#" + elShow).fadeIn(); });
		}
	});
}