<!--

var ProductGallery =  {
    path : '',
    images : null,

    switchImage : function (index, obj) {
        $('#middlePhotoPosition').attr("href", ProductGallery.path + ProductGallery.images[index].photo1);
        $('#middlePhotoPosition2').attr("href", ProductGallery.path + ProductGallery.images[index].photo1);
        $('#middlePhotoPositionImage').attr("src", ProductGallery.path +ProductGallery.images[index].photo2);
        //document.getElementById('middlePhotoPosition').setAttribute("href", ProductGallery.path + ProductGallery.images[index].photo1);
        //document.getElementById('middlePhotoPosition2').setAttribute("href", ProductGallery.path + ProductGallery.images[index].photo1);
        //document.getElementById('middlePhotoPositionImage').src = ProductGallery.images[index].photo2_obj);
	//alert(ProductGallery.path +ProductGallery.images[index].photo2);

        $(obj).parent().children("a").children("span").removeClass("selectedPhoto")
        $(obj).children("span").addClass("selectedPhoto");
    }
};

function initColorChager() {
    $("td.catalog_color div").click(
        function() {
            $(this).parent().children("input").attr("value", $(this).attr("_id"));
            $(this).parent().children("div").removeAttr("class");
            $(this).attr("class", "selected");
        }
    );
}

function showGroupImage(image) {
    var item = false
    try {
        item = eval( 'groupsImages.' + image );
    } catch(e){ return false; }

    if(item) {
        $('#groupLink').show();
        $('#groupLink').attr("href", item.link);
        $('#groupLink').attr("title", item.name);

        $('#groupImage').attr("alt", item.name);
        $('#groupImage').attr("src", item.image);
    } else {
        $('#groupLink').hide();
    }
}

SSS_faq = {
	init : function() {
		$('div.faq .question').click(function() { SSS_faq.toggle(this) });
	},
	
	toggle : function(elt) {
		$(elt).toggleClass('active_faq');
		$(elt).siblings('.answer').slideToggle('fast');
	}
}

$(function() { 
	SSS_faq.init();
});


SSS_feed = {
	init : function() {
		$('div.feedback2 .feed_link').click(function() { SSS_feed.toggle(this) });
	},
	
	toggle : function(elt) {
		$(elt).toggleClass('active_faq');
		$(elt).siblings('.feed_form').slideToggle('slow');
	}
}

$(function() { 
	SSS_feed.init();
});


$(document).ready( function() {
    $("#appl_collapse").click(
        function() {
            $("#appl_collapse").hide();
            $("#appl_expand").show();
        }
    );

    $("#appl_expand_header").click(
        function() {
            $("#appl_expand").hide();
            $("#appl_collapse").show();
        }
    );

 	$(".tooltip_big").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	top: -65,
	left: 16,
	extraClass: "big_style",
	bodyHandler: function() {
		return $(this).html();
	}
	});

 	$(".tooltip_big2").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	top: -47,
	left: 16,
	extraClass: "big2_style",
	bodyHandler: function() {
		return $(this).html();
	}
	});

	$(".tooltip_middle").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	showBody: " - ",
	extraClass: "middle_style",
	top: -37,
	left: 16,
	bodyHandler: function() {
		return $(this).html();
	}
	});
	$(".tooltip_middlest").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	showBody: " - ",
	extraClass: "middlest_style",
	top: -37,
	left: 16,
	bodyHandler: function() {
		return $(this).html();
	}
	});

	$(".tooltip_small").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	showBody: " - ",
	extraClass: "small_style",
	top: -23,
	left: 16,
	bodyHandler: function() {
		return $(this).html();
	}
	});

	$(".tooltip_smallest").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	showBody: " - ",
	extraClass: "smallest_style",
	top: -23,
	left: 16,
	bodyHandler: function() {
		return $(this).html();
	}
	});


}
);

function ShowBanner(_ele_ids, _uri, _location) {
	var objs = new Array();
	for (var i in _ele_ids) {
		var obj = document.getElementById(_ele_ids[i]);
		if (obj) {
			objs.push(obj);
		}
	}
	
	$.ajax({
		type: "POST",
		url: '/show_banner.php',
		data: 'uri=' + _uri + '&location=' + _location,
		success: function(xml) {
			if (xml) {
				var i = 0;
				$(xml).find('banner').each(function(){
					objs[i].innerHTML = $(this).find('content').text();
					i++;
				});
			}
		}
	});		 
}

//-->
