var IE6 = (($.browser.msie) && ($.browser.version < 7));
$(document).ready(function() {
	if (!IE6)
		nothing_into_frame();

	$("#header").css({overflow:"visible"});

	if ($.browser.msie) {
		$(window).load(function() {
			$("img").each(function() {
				if ($(this)[0].complete == false)
					if ($(this).hasClass("img"))
						$(this).attr("src", "templates/israir/images/default.jpg");
			});
		});
	}
	else if ($.browser.webkit || $.browser.mozilla) {
		$(window).load(function() {
			$("img").each(function() {
				if ($(this)[0].naturalHeight == 0)
					if ($(this).hasClass("img"))
						$(this).attr("src", "templates/israir/images/default.jpg");
			});
		});
	}
	$("img").each(function() {
		if ($(this).attr("src") == "") {
			if (!$(this).hasClass("img"))
				$(this).attr("src", "templates/israir/images/blank.gif");
		}
		$(this).error(function() {
			if (!$(this).hasClass("img"))
				$(this).attr("src", "templates/israir/images/blank.gif");
		});
	});

	var max = 0;
	$("#footer-blocks > .right").each(function() {
		if ($(this).height() > max)
			max = parseInt($(this).height());
	});
	$("#footer-blocks > .right").each(function() {
		$(this).height(max);
	});
	
	$('div.contactBox').click(function() {
		var wrapHeight = $(document).height();
		 $('html').animate({scrollTop : 0},'fast');
		$('.contactHideAll').show().css({'opacity' : '0.8' , 'height' : wrapHeight});
		if (!($.browser.msie)) { $('#wrap').addClass('wrapHidden'); }
		$('.contactPopUp').show();
	})
	$('.contactClose').click(function() {
		$('.contactHideAll,.contactPopUp').hide();
		$('#wrap').removeClass('wrapHidden');
	});
	
	
});

var $_GET = {};
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
    function decode(s) {
        return decodeURIComponent(s.split("+").join(" "));
    }

    $_GET[decode(arguments[1])] = decode(arguments[2]);
});
function nothing_into_frame() {
	if ($_GET["test"]) {
		return false;
	}
}
var log = function() {}
if ($_GET["test"]) {
	log = function(t) { alert(t) }
}
