/* adds bookmark in browser */
function CreateBookmarkLink(title, url) {
	if (window.sidebar) {
	 window.sidebar.addPanel(title, url,"");
	} else if( window.external ) {
	 window.external.AddFavorite( url, title);
	} else if(window.opera && window.print) {
	 return true;
	}
}

/* creates hyperlinks for table rows */
function Goto(page) {
	$("tr.highlight").click(function (event) {
	 if ($(event.target).is('td')) {
	 document.location.href = page;
	 }
	});
}

$(function() {
	$("#tabs").tabs();
 
	$(".country").click(function() {
	 var id = $(this).attr('id');
	 $("ul.cities").hide();
	 $("p.stores").hide();
	 $("ul#ul_" + id).show();
	 $("a.country").removeClass("active");
	 $("a#" + id).addClass("active");
	});
 
	$(".city").click(function() {
	 var id = $(this).attr('id');
	 $("p.stores").hide();
	 $("p#p_" + id).show();
	 $("a.city").removeClass("active");
	 $("a#" + id).addClass("active");
	});
 
	$("a").each(function() {
	 if ($(this).attr('href') == "?" + jQuery.url.attr("query")) {
	 $(this).css({color: 'red'});
	 }
	});
});

function LoadImage(image, name) {
	$("#lightbox").empty();
	$("#lightbox").append('<img src="img/' + image + '" alt="" /><br /><p style="float: right;">' + name + '</p>');
}

function LoadProductImage(image) {
	$("#lightbox").empty();
	$("#lightbox").append('<img src="/img/product/' + image + '" alt="" />');
}
