﻿/// <reference path="jquery-1.3.2-vsdoc2.js" />
var Phototheque = {
	DoSearch: function(obj, txt, ddl) {
		var result = WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(obj.id, '', true, 'Search', '', true, false));
		if (result && ('#' + ddl).val() != '' || $('#' + txt).val() != '') {
			top.location.href = '/Pages/Album.aspx?albumid=' + $('#' + ddl).val() + '&search=' + $('#' + txt).val();
		}
	},
	AddToBasket: function(itemid, box) {
		if (isAuthenticated) {
			AddToBasketQuick(itemid, box);
		} else {
			$('html, body').animate({ scrollTop: '0px' }, 500);
			$('#pnlNotRegistered').toggle();
		}
	},
	DisplayCartMessage: function(box) {
		$('.delete-bubble').css("display", "none");
		var msg = $('#cart_msg');
		var box = $('#' + box);
		msg.css('top', (box.position().top + box.height() - 18) + 'px');
		msg.css('left', box.position().left + 'px');
		msg.show();
		Phototheque.DelayHide('cart_msg', 2500);
	},
	HideAllDeleteBubble: function(id) {
		$('.delete-bubble').css("display", "none");
		$('#' + id).show();
	},
	QuickCartHideMessageTimerID: -1,
	QuickCartHideMessage: function(id) {
		window.clearTimeout(Phototheque.QuickCartHideMessageTimerID);
		Phototheque.QuickCartHideMessageTimerID = Phototheque.DelayHide(id, 2500);
	},
	DelayHide: function(id, delay) {
		return window.setTimeout(function() { $('#' + id).hide(); }, delay)
	},
	DownloadSetTimeout: function() {
		window.setTimeout('RefreshDownload()', 3000);
	}
}