// JavaScript Document
(function() {
	var prefix = (window.location.host.indexOf("catalogdev") != -1) ? "http://dev.mystudioproducts.com/?branch=" : "http://www.mystudioproducts.com/?branch=",
		getBranch = function(val) {
			if (typeof(val) != "undefined") val = val.toLowerCase();
			switch (val) {
				// Category: Products & Services
				case "/albums_books/embed_list.aspx":
					return "albums_books";
				case "/greeting_cards/embed_list.aspx":
					return "greeting_cards";
				case "/fine_art/embed_list.aspx":
					return "fine_art";
				case "/metal_products/embed_list.aspx":
					return "metal_products";
				case "/photo_gifts/embed_list.aspx":
					return "photo_gifts";
				case "/press_specialty/embed_list.aspx":
					return "press_specialty";
				case "/sports/default.aspx":
				case "/sports/graphics.aspx":
					return "sports";
				
				// Category: Albums & Books
				case "/albums_books/flush_mount_albums.aspx":
					return "flush_mount_albums";
				case "/albums_books/flush_mount_metal_albums.aspx":
					return "flush_mount_metal_albums";
				case "/albums_books/platinum_albums.aspx":
					return "platinum_albums";
				case "/albums_books/premira_albums.aspx":
					return "premira_albums";
				case "/albums_books/summit_albums.aspx":
					return "summit_albums";
				case "/albums_books/hard_cover_books.aspx":
					return "hard_cover_books";
				case "/albums_books/lay_flat_books.aspx":
					return "lay_flat_books";
				case "/albums_books/soft_cover_books.aspx":
					return "soft_cover_books";
				case "/albums_books/image_folios.aspx":
					return "image_folios";
					
				// Category: Announcement & Greeting Cards
				case "/greeting_cards/flat_photo_cards/":
					return "flat_photo_cards";
				case "/greeting_cards/flat_press_cards/":
					return "flat_press_cards";
				case "/greeting_cards/folded_press_cards/":
					return "folded_press_cards";
				
				// Category: Gallery Wraps & Fine Art
				case "/fine_art/thin_wraps.aspx":
					return "thin_wraps";
				case "/fine_art/75_gallery_wraps.aspx":
					return "75_gallery_wraps";
				case "/fine_art/15_gallery_wraps.aspx":
					return "15_gallery_wraps";
				case "/fine_art/25_gallery_wraps.aspx":
					return "25_gallery_wraps";
				case "/fine_art/bevel_wraps.aspx":
					return "bevel_wraps";
				case "/fine_art/fine_art_canvas.aspx":
					return "fine_art_canvas";
				case "/fine_art/fine_art_paper.aspx":
					return "fine_art_paper";
				
				// Category: Metal Prints
				case "/metals/metal_prints.aspx":
					return "metal_prints";
				case "/metals/standout.aspx":
					return "standout";
				case "/metals/standup_base.aspx":
					return "standup_base";
				case "/metals/standup_curve.aspx":
					return "standup_curve";
				case "/metals/standup_flex.aspx":
					return "standup_flex";
				
				// Category: Photo Gifts
				case "/metals/wallet_albums.aspx":
					return "pg_wallet_albums";
				case "/metals/bag_tags.aspx":
					return "pg_bag_tags";
				case "/metals/calendars.aspx":
					return "pg_calendars";
				case "/metals/mugs.aspx":
					return "pg_mugs";
				case "/metals/ornaments.aspx":
					return "pg_ornaments";
				case "/metals/clipboards.aspx":
					return "pg_clipboards";
				case "/metals/coasters.aspx":
					return "pg_coasters";
				case "/metals/dog_tags.aspx":
					return "pg_dog_tags";
				case "/metals/dog_tags.aspx":
					return "pg_dog_tags";
				case "/metals/dry_erase_boards.aspx":
					return "pg_dry_erase_boards";
				case "/metals/flashlight_key_chains.aspx":
					return "pg_flashlight_key_chains";
				case "/metals/key_chains.aspx":
					return "pg_key_chains";
				case "/metals/license_plates.aspx":
					return "pg_license_plates";
				case "/metals/business_card_cases.aspx":
					return "pg_business_card_cases";
				case "/metals/mouse_pads.aspx":
					return "pg_mouse_pads";
				case "/metals/buttons.aspx":
					return "pg_buttons";
				case "/metals/plaques.aspx":
					return "pg_plaques";
				case "/metals/puzzles.aspx":
					return "pg_puzzles";
				case "/metals/travel_mugs.aspx":
					return "pg_travel_mugs";
				case "/metals/wallet_magnets.aspx":
					return "pg_wallet_magnets";
				case "/metals/wallet_tins.aspx":
					return "pg_wallet_tins";
				case "/metals/water_bottles.aspx":
					return "pg_water_bottles";
				
				// Category: Press Specialty Products
				case "/press_specialty/bookmarks/":
					return "ps_bookmarks";
				case "/press_specialty/brochures.aspx":
					return "ps_brochures";
				case "/press_specialty/business_cards.aspx":
					return "ps_business_cards";
				case "/press_specialty/calendars.aspx":
					return "ps_calendars";
				case "/press_specialty/cd_covers.aspx":
					return "ps_cd_covers";
				case "/press_specialty/gift_tags/":
					return "ps_gift_tags";
				case "/press_specialty/magnets.aspx":
					return "ps_magnets";
				case "/press_specialty/playing_cards.aspx":
					return "ps_playing_cards";
				case "/press_specialty/portrait_galleries.aspx":
					return "ps_portrait_galleries";
				case "/press_specialty/posters.aspx":
					return "ps_posters";
				case "/press_specialty/press_wallets.aspx":
					return "ps_press_wallets";
				case "/press_specialty/rep_cards.aspx":
					return "ps_rep_cards";
				case "/press_specialty/stickers.aspx":
					return "ps_stickers";
			}
			return "";
		};
	
	// Force frames, if needed
	if (parent == self) top.location = prefix + getBranch(self.location.pathname);
})();
