/*  TODO: check all search_click */


debugAllowed = false;
var SPLIT_DELIMITER = "___REP___"  ;


var jsActivateTabBox = false;
var jsActivateTabSearch = false;

  


/*
docs for jCarouselLite
http://gmarwaha.com/jquery/jcarousellite/index.php#doc

*/
var  _mouseCoordinatesX = 0;
var  _mouseCoordinatesY  = 0;



function html_entity_decode( string, quote_style ) {
	// http://kevin.vanzonneveld.net
	// +   original by: john (http://www.jd-tech.net)
	// +      input by: ger
	// +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   bugfixed by: Onno Marsman
	// +   improved by: marc andreu
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// -    depends on: get_html_translation_table
	// *     example 1: html_entity_decode('Kevin &amp; van Zonneveld');
	// *     returns 1: 'Kevin & van Zonneveld'
	// *     example 2: html_entity_decode('&amp;lt;');
	// *     returns 2: '&lt;'

	var histogram = {}, symbol = '', tmp_str = '', entity = '';
	tmp_str = string.toString();

	if (false === (histogram = get_html_translation_table('HTML_ENTITIES', quote_style))) {
		return false;
	}

	// &amp; must be the last character when decoding!
	delete(histogram['&']);
	histogram['&'] = '&amp;';

	for (symbol in histogram) {
		entity = histogram[symbol];
		tmp_str = tmp_str.split(entity).join(symbol);
	}

	return tmp_str;
}



function get_html_translation_table(table, quote_style) {
	// http://kevin.vanzonneveld.net
	// +   original by: Philip Peterson
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   bugfixed by: noname
	// %          note: It has been decided that we're not going to add global
	// %          note: dependencies to php.js. Meaning the constants are not
	// %          note: real constants, but strings instead. integers are also supported if someone
	// %          note: chooses to create the constants themselves.
	// %          note: Table from http://www.the-art-of-web.com/html/character-codes/
	// *     example 1: get_html_translation_table('HTML_SPECIALCHARS');
	// *     returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}

	var entities = {}, histogram = {}, decimal = 0, symbol = '';
	var constMappingTable = {}, constMappingQuoteStyle = {};
	var useTable = {}, useQuoteStyle = {};

	useTable      = (table ? table.toUpperCase() : 'HTML_SPECIALCHARS');
	useQuoteStyle = (quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT');

	// Translate arguments
	constMappingTable[0]      = 'HTML_SPECIALCHARS';
	constMappingTable[1]      = 'HTML_ENTITIES';
	constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
	constMappingQuoteStyle[2] = 'ENT_COMPAT';
	constMappingQuoteStyle[3] = 'ENT_QUOTES';

	// Map numbers to strings for compatibilty with PHP constants
	if (!isNaN(useTable)) {
		useTable = constMappingTable[useTable];
	}
	if (!isNaN(useQuoteStyle)) {
		useQuoteStyle = constMappingQuoteStyle[useQuoteStyle];
	}

	if (useQuoteStyle != 'ENT_NOQUOTES') {
		entities['34'] = '&quot;';
	}

	if (useQuoteStyle == 'ENT_QUOTES') {
		entities['39'] = '&#039;';
	}

	if (useTable == 'HTML_SPECIALCHARS') {
		// ascii decimals for better compatibility
		entities['38'] = '&amp;';
		entities['60'] = '&lt;';
		entities['62'] = '&gt;';
	} else if (useTable == 'HTML_ENTITIES') {
		// ascii decimals for better compatibility
		entities['38']  = '&amp;';
		entities['60']  = '&lt;';
		entities['62']  = '&gt;';
		entities['160'] = '&nbsp;';
		entities['161'] = '&iexcl;';
		entities['162'] = '&cent;';
		entities['163'] = '&pound;';
		entities['164'] = '&curren;';
		entities['165'] = '&yen;';
		entities['166'] = '&brvbar;';
		entities['167'] = '&sect;';
		entities['168'] = '&uml;';
		entities['169'] = '&copy;';
		entities['170'] = '&ordf;';
		entities['171'] = '&laquo;';
		entities['172'] = '&not;';
		entities['173'] = '&shy;';
		entities['174'] = '&reg;';
		entities['175'] = '&macr;';
		entities['176'] = '&deg;';
		entities['177'] = '&plusmn;';
		entities['178'] = '&sup2;';
		entities['179'] = '&sup3;';
		entities['180'] = '&acute;';
		entities['181'] = '&micro;';
		entities['182'] = '&para;';
		entities['183'] = '&middot;';
		entities['184'] = '&cedil;';
		entities['185'] = '&sup1;';
		entities['186'] = '&ordm;';
		entities['187'] = '&raquo;';
		entities['188'] = '&frac14;';
		entities['189'] = '&frac12;';
		entities['190'] = '&frac34;';
		entities['191'] = '&iquest;';
		entities['192'] = '&Agrave;';
		entities['193'] = '&Aacute;';
		entities['194'] = '&Acirc;';
		entities['195'] = '&Atilde;';
		entities['196'] = '&Auml;';
		entities['197'] = '&Aring;';
		entities['198'] = '&AElig;';
		entities['199'] = '&Ccedil;';
		entities['200'] = '&Egrave;';
		entities['201'] = '&Eacute;';
		entities['202'] = '&Ecirc;';
		entities['203'] = '&Euml;';
		entities['204'] = '&Igrave;';
		entities['205'] = '&Iacute;';
		entities['206'] = '&Icirc;';
		entities['207'] = '&Iuml;';
		entities['208'] = '&ETH;';
		entities['209'] = '&Ntilde;';
		entities['210'] = '&Ograve;';
		entities['211'] = '&Oacute;';
		entities['212'] = '&Ocirc;';
		entities['213'] = '&Otilde;';
		entities['214'] = '&Ouml;';
		entities['215'] = '&times;';
		entities['216'] = '&Oslash;';
		entities['217'] = '&Ugrave;';
		entities['218'] = '&Uacute;';
		entities['219'] = '&Ucirc;';
		entities['220'] = '&Uuml;';
		entities['221'] = '&Yacute;';
		entities['222'] = '&THORN;';
		entities['223'] = '&szlig;';
		entities['224'] = '&agrave;';
		entities['225'] = '&aacute;';
		entities['226'] = '&acirc;';
		entities['227'] = '&atilde;';
		entities['228'] = '&auml;';
		entities['229'] = '&aring;';
		entities['230'] = '&aelig;';
		entities['231'] = '&ccedil;';
		entities['232'] = '&egrave;';
		entities['233'] = '&eacute;';
		entities['234'] = '&ecirc;';
		entities['235'] = '&euml;';
		entities['236'] = '&igrave;';
		entities['237'] = '&iacute;';
		entities['238'] = '&icirc;';
		entities['239'] = '&iuml;';
		entities['240'] = '&eth;';
		entities['241'] = '&ntilde;';
		entities['242'] = '&ograve;';
		entities['243'] = '&oacute;';
		entities['244'] = '&ocirc;';
		entities['245'] = '&otilde;';
		entities['246'] = '&ouml;';
		entities['247'] = '&divide;';
		entities['248'] = '&oslash;';
		entities['249'] = '&ugrave;';
		entities['250'] = '&uacute;';
		entities['251'] = '&ucirc;';
		entities['252'] = '&uuml;';
		entities['253'] = '&yacute;';
		entities['254'] = '&thorn;';
		entities['255'] = '&yuml;';
	} else {
		throw Error("Table: "+useTable+' not supported');
		return false;
	}

	// ascii decimals to real symbols
	for (decimal in entities) {
		symbol = String.fromCharCode(decimal)
		histogram[symbol] = entities[decimal];
	}

	return histogram;
}




function htmlentities (string, quote_style) {
	// http://kevin.vanzonneveld.net
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   improved by: nobbler
	// +    tweaked by: Jack
	// +   bugfixed by: Onno Marsman
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +    bugfixed by: Brett Zamir (http://brett-zamir.me)
	// +      input by: Ratheous
	// -    depends on: get_html_translation_table
	// *     example 1: htmlentities('Kevin & van Zonneveld');
	// *     returns 1: 'Kevin &amp; van Zonneveld'
	// *     example 2: htmlentities("foo'bar","ENT_QUOTES");
	// *     returns 2: 'foo&#039;bar'

	var hash_map = {}, symbol = '', tmp_str = '', entity = '';
	tmp_str = string.toString();

	if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
		return false;
	}
	hash_map["'"] = '&#039;';
	for (symbol in hash_map) {
		entity = hash_map[symbol];
		tmp_str = tmp_str.split(symbol).join(entity);
	}

	return tmp_str;
}

var globalDialogIdMapping = new Array();
var	objectCounter =0 ;
var globalDialogIdMappingIsInitialised =  false;


function addDialogLayer(layerId) {
	objectCounter++;
	//		 var layer_tmp{$smarty.foreach.productIteration.index} = jQuery('#' + layerId);
	globalDialogIdMapping[objectCounter] = new Object();
	globalDialogIdMapping[objectCounter]["name"] =  layerId;
	globalDialogIdMapping[objectCounter]["width"] = jQuery('#' + layerId).width() + 20;
	globalDialogIdMapping[objectCounter]["height"] = jQuery('#' + layerId).height() + 98;
}

function addInfoDialog(layerId) {
	objectCounter++;
	globalDialogIdMapping[objectCounter] = new Object();
	globalDialogIdMapping[objectCounter]["name"] =  layerId;
	globalDialogIdMapping[objectCounter]["width"] =  300;
	globalDialogIdMapping[objectCounter]["height"] = jQuery('#' + layerId).height() +110;
}


function initialiseGlobalDialogMapping( ) {

	/*
	chechenblaikner TODO: 2009 10 27
	initialise this only on demand... errors on booking - fix this

	*/

	if ( globalDialogIdMappingIsInitialised) {
		return;
	}

	if ( _MR_MEASURE_JS_DURATION ) {
		Jiffy.mark("initialiseGlobalDialogMapping");
	}



	jQuery(document).ready(function(){
		//jQuery(window).load(function(){

		jQuery.noConflict();



		// alert ("initialiseGlobalDialogMapping" ) ;


		// initalize dialog variables (width, height -> the are destroyed on first close event)
		var termin = jQuery('#termin');
		var gutschein = jQuery('#gutschein');
		var ort = jQuery('#ort');

		var search_for = jQuery('#search_for');
		var search_price = jQuery('#search_price');
		var search_price_searchpresent = jQuery('#search_price_searchpresent');
		var search_event = jQuery('#search_event');
		var search_location = jQuery('#search_location');
		var result_location = jQuery('#result_location');
		var versicherung = jQuery('#versicherung');
		var filter_price = jQuery('#filter_price');
		var filter_location = jQuery('#filter_location');
		var filter_subkategory = jQuery('#filter_subkategory');
		var filter_maincategory = jQuery('#filter_maincategory');
		var filter_for = jQuery('#filter_for');


		// geschenksuche
		var search_forsearchPresent = jQuery('#search_forsearchPresent');
		var search_pricesearchPresent = jQuery('#search_pricesearchPresent');
		var search_factorsearchPresent = jQuery('#search_factorsearchPresent');
		var search_locationsearchPresent = jQuery('#search_locationsearchPresent');

		// es-suche
		var event_calendar1ticketing = jQuery('#event_calendar1ticketing');
		var event_calendar2ticketing = jQuery('#event_calendar2ticketing');
		var search_categorieticketing = jQuery('#search_categorieticketing');
		var search_priceticketing = jQuery('#search_priceticketing');
		var search_locationticketing = jQuery('#search_locationticketing');

		// Info Buttons Checkout
		var post = jQuery('#post__');
		var express = jQuery('#express__');
		var online = jQuery('#online__');
		var geschenkbox = jQuery('#geschenkbox__');
		var kuvert = jQuery('#kuvert__');


		// productdetail
		var tooltip_anderenTermin = jQuery('#tooltip_anderenTermin');
		var tooltip_anderenTermintakt = jQuery('#tooltip_anderenTermintakt');

		// eventsuche
		var event_calendar = jQuery('#event_calendar');
		var event_location = jQuery('#event_location');

		var event_calendarsearchEvent = jQuery('#event_calendarsearchEvent');
		var event_locationsearchEvent = jQuery('#event_locationsearchEvent');

		//info buttons booking
		var directBookingInfo = jQuery('#directBookingInfo');
		var dateBookingInfo = jQuery('#dateBookingInfo');
		var taktBookingInfo = jQuery('#taktBookingInfo');
		var waitingListInfo = jQuery('#waitingListInfo');
		var attendantInfo = jQuery('#attendantInfo');

		//datefilter listNew
		var listNew_dateFrombooking = jQuery('#listNew_dateFrombooking');
		var listNew_dateTobooking = jQuery('#listNew_dateTobooking');
		var listNew_locationbooking = jQuery('#listNew_locationbooking');

		var kundenkonto = jQuery('#kundenkonto');
		var cvc_info = jQuery('#cvc_info');

		var sort_by = jQuery('#sort_by');
		var display_mode = jQuery('#display_mode');



		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "ort";
		globalDialogIdMapping[objectCounter]["width"] = 410;
		globalDialogIdMapping[objectCounter]["height"] = ort.height();

		objectCounter++;

		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "gutschein";
		globalDialogIdMapping[objectCounter]["width"] = 410 ;
		globalDialogIdMapping[objectCounter]["height"] = gutschein.height() + 30;

		objectCounter++;

		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "termin";
		globalDialogIdMapping[objectCounter]["width"] = 550;
		globalDialogIdMapping[objectCounter]["height"] = termin.height() + 5;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_for";
		globalDialogIdMapping[objectCounter]["width"] = 150;
		globalDialogIdMapping[objectCounter]["height"] = search_for.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_price";
		globalDialogIdMapping[objectCounter]["width"] = 150;
		globalDialogIdMapping[objectCounter]["height"] = search_price.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_event";
		globalDialogIdMapping[objectCounter]["width"] = 150;
		globalDialogIdMapping[objectCounter]["height"] = search_event.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_location";
		globalDialogIdMapping[objectCounter]["width"] = 200 /*search_location.width()+20;*/;
		globalDialogIdMapping[objectCounter]["height"] = search_location.height()+20;
		globalDialogIdMapping[objectCounter]["truncateAt"] = 15;


		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "result_location";
		globalDialogIdMapping[objectCounter]["width"] = result_location.width();
		globalDialogIdMapping[objectCounter]["height"] = result_location.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter]= new Object();
		globalDialogIdMapping[objectCounter]["name"] = "versicherung";
		globalDialogIdMapping[objectCounter]["width"] = versicherung.width()+5;
		globalDialogIdMapping[objectCounter]["height"] = versicherung.height()+5;

		objectCounter++;
		globalDialogIdMapping[objectCounter]= new Object();
		globalDialogIdMapping[objectCounter]["name"] = "filter_price";
		globalDialogIdMapping[objectCounter]["width"] = 140
		globalDialogIdMapping[objectCounter]["height"] = filter_price.height()+5;

		objectCounter++;
		globalDialogIdMapping[objectCounter]= new Object();
		globalDialogIdMapping[objectCounter]["name"] = "filter_for";
		globalDialogIdMapping[objectCounter]["width"] = 150
		globalDialogIdMapping[objectCounter]["height"] = filter_for.height()+5;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "filter_location";
		globalDialogIdMapping[objectCounter]["width"] = 200 /*filter_location.width()*/;
		globalDialogIdMapping[objectCounter]["height"] = filter_location.height()+5;
		globalDialogIdMapping[objectCounter]["truncateAt"] = 15;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "filter_subkategory";
		globalDialogIdMapping[objectCounter]["width"] = 200;
		globalDialogIdMapping[objectCounter]["height"] = filter_subkategory.height()+5;
		globalDialogIdMapping[objectCounter]["truncateAt"] = 14;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "filter_maincategory";
		globalDialogIdMapping[objectCounter]["width"] = 200;
		globalDialogIdMapping[objectCounter]["height"] = filter_maincategory.height()+5;
		globalDialogIdMapping[objectCounter]["truncateAt"] = 14;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "post__";
		globalDialogIdMapping[objectCounter]["width"] = post.width();
		globalDialogIdMapping[objectCounter]["height"] = post.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter]= new Object();
		globalDialogIdMapping[objectCounter]["name"] = "express__";
		globalDialogIdMapping[objectCounter]["width"] = express.width();
		globalDialogIdMapping[objectCounter]["height"] = express.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "online__";
		globalDialogIdMapping[objectCounter]["width"] = online.width();
		globalDialogIdMapping[objectCounter]["height"] = online.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "geschenkbox__";
		globalDialogIdMapping[objectCounter]["width"] = geschenkbox.width();
		globalDialogIdMapping[objectCounter]["height"] = geschenkbox.height()+20;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "kuvert__";
		globalDialogIdMapping[objectCounter]["width"] = kuvert.width();
		globalDialogIdMapping[objectCounter]["height"] = kuvert.height()+30;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_price_searchpresent";
		globalDialogIdMapping[objectCounter]["width"] = search_price_searchpresent.width();
		globalDialogIdMapping[objectCounter]["height"] = search_price_searchpresent.height();


		//	geschenksuche start
		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_forsearchPresent";
		globalDialogIdMapping[objectCounter]["width"] =/* search_forsearchPresent.width()*/ 140;
		globalDialogIdMapping[objectCounter]["height"] = search_forsearchPresent.height();


		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_pricesearchPresent";
		globalDialogIdMapping[objectCounter]["width"] =/* search_pricesearchPresent.width()*/  140;
		globalDialogIdMapping[objectCounter]["height"] = search_pricesearchPresent.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_factorsearchPresent";
		globalDialogIdMapping[objectCounter]["width"] = /*search_factorsearchPresent.width()*/  140;
		globalDialogIdMapping[objectCounter]["height"] = search_factorsearchPresent.height();


		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_locationsearchPresent";
		globalDialogIdMapping[objectCounter]["width"] = 200 /*search_locationsearchPresent.width()*/;
		globalDialogIdMapping[objectCounter]["height"] = search_locationsearchPresent.height();
		globalDialogIdMapping[objectCounter]["truncateAt"] = 15;

		//	geschenksuche end

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "tooltip_anderenTermintakt";
		globalDialogIdMapping[objectCounter]["width"] = tooltip_anderenTermintakt.width();
		globalDialogIdMapping[objectCounter]["height"] = tooltip_anderenTermintakt.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "tooltip_anderenTermin";
		globalDialogIdMapping[objectCounter]["width"] = tooltip_anderenTermin.width();
		globalDialogIdMapping[objectCounter]["height"] = tooltip_anderenTermin.height();

		// eventsuche
		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "event_calendar";
		globalDialogIdMapping[objectCounter]["width"] = /*event_calendar.width();*/ 190;
		globalDialogIdMapping[objectCounter]["height"] = /*event_calendar.height();*/ 155;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "event_location";
		globalDialogIdMapping[objectCounter]["width"] = 200 /*event_location.width()+20*/;
		globalDialogIdMapping[objectCounter]["height"] = event_location.height();
		globalDialogIdMapping[objectCounter]["truncateAt"] = 15;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "event_calendarsearchEvent";
		globalDialogIdMapping[objectCounter]["width"] = /*event_calendar.width();*/ 190;
		globalDialogIdMapping[objectCounter]["height"] = /*event_calendar.height();*/ 155;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "event_locationsearchEvent";
		globalDialogIdMapping[objectCounter]["width"] = 200 /*event_locationsearchEvent.width()*/;
		globalDialogIdMapping[objectCounter]["height"] = event_locationsearchEvent.height();
		globalDialogIdMapping[objectCounter]["truncateAt"] = 15;

		//	es-suche start

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_categorieticketing";
		globalDialogIdMapping[objectCounter]["width"] = search_categorieticketing.width();
		globalDialogIdMapping[objectCounter]["height"] = search_categorieticketing.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_priceticketing";
		globalDialogIdMapping[objectCounter]["width"] = search_priceticketing.width();
		globalDialogIdMapping[objectCounter]["height"] = search_priceticketing.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "search_locationticketing";
		globalDialogIdMapping[objectCounter]["width"] = search_locationticketing.width();
		globalDialogIdMapping[objectCounter]["height"] = search_locationticketing.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "event_calendar1ticketing";
		globalDialogIdMapping[objectCounter]["width"] = 190;
		globalDialogIdMapping[objectCounter]["height"] = 155;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "event_calendar2ticketing";
		globalDialogIdMapping[objectCounter]["width"] = 190;
		globalDialogIdMapping[objectCounter]["height"] = 155;

		//	info-button booking

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "directBookingInfo";
		globalDialogIdMapping[objectCounter]["width"] = 270;
		globalDialogIdMapping[objectCounter]["height"] = directBookingInfo.height()+85;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "dateBookingInfo";
		globalDialogIdMapping[objectCounter]["width"] = 270;
		globalDialogIdMapping[objectCounter]["height"] = dateBookingInfo.height()+100;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "taktBookingInfo";
		globalDialogIdMapping[objectCounter]["width"] = 270;
		globalDialogIdMapping[objectCounter]["height"] = taktBookingInfo.height()+130;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "waitingListInfo";
		globalDialogIdMapping[objectCounter]["width"] = 270;
		globalDialogIdMapping[objectCounter]["height"] = waitingListInfo.height()+130;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "attendantInfo";
		globalDialogIdMapping[objectCounter]["width"] = 270;
		globalDialogIdMapping[objectCounter]["height"] = attendantInfo.height()+50;

		// listNew filter

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "listNew_dateFrombooking";
		globalDialogIdMapping[objectCounter]["width"] = 190;
		globalDialogIdMapping[objectCounter]["height"] = 155;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "listNew_dateTobooking";
		globalDialogIdMapping[objectCounter]["width"] = 190;
		globalDialogIdMapping[objectCounter]["height"] = 155;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "listNew_locationbooking";
		globalDialogIdMapping[objectCounter]["width"] = listNew_locationbooking.width();
		globalDialogIdMapping[objectCounter]["height"] = listNew_locationbooking.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "kundenkonto";
		globalDialogIdMapping[objectCounter]["width"] = 240;
		globalDialogIdMapping[objectCounter]["height"] = 155;


		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "cvc_info";
		globalDialogIdMapping[objectCounter]["width"] = 260;
		globalDialogIdMapping[objectCounter]["height"] = 200;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "cvc_info";
		globalDialogIdMapping[objectCounter]["width"] = 260;
		globalDialogIdMapping[objectCounter]["height"] = 200;

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "sort_by";
		globalDialogIdMapping[objectCounter]["width"] = 160;
		globalDialogIdMapping[objectCounter]["height"] = sort_by.height();

		objectCounter++;
		globalDialogIdMapping[objectCounter] = new Object();
		globalDialogIdMapping[objectCounter]["name"] = "display_mode";
		globalDialogIdMapping[objectCounter]["width"] = 155;
		globalDialogIdMapping[objectCounter]["height"] = 100;



		globalDialogIdMappingIsInitialised =  true;

		if ( _MR_MEASURE_JS_DURATION ) {
			Jiffy.measure("initialiseGlobalDialogMapping", "initialiseGlobalDialogMapping");
		}




	});




}





function ajaxSubmitForm(formObject)	{

	if (typeof(_MR_INCLUDE_DO_JAVACRIPT_AJAX_REQUEST) != "undefined" && _MR_INCLUDE_DO_JAVACRIPT_AJAX_REQUEST == '1') {

		jQuery('body').animate({scrollTop:0},'normal');/*  "slow", "normal", or "fast */

		/*
		var optionsAAJX = {
		target: '#output1', // target element(s) to be updated with server response
		beforeSubmit: showRequest, // pre-submit callback
		success: showResponse // post-submit callback

		// other available options:
		url:       url         // override for form's 'action' attribute
		type:      type        // 'get' or 'post', override for form's 'method' attribute
		dataType:  null        // 'xml', 'script', or 'json' (expected server response type)
		clearForm: true        // clear all form fields after successful submit
		resetForm: true        // reset the form after successful submit
		$.ajax options can be used here too, for example:
		timeout:   3000
		};
		jQuery(currentForm).ajaxSubmit();
		jQuery(currentForm).ajaxForm(optionsAAJX);
		*/

		queryString = jQuery(formObject).formSerialize();
		//alert (  	currentForm.action   	+" \n\n" +  	queryString    	) ;
		//var urlToSubmit = currentForm.action  +"&" +queryString+"&ajaxMode=1" ;

		jQuery.ajax({
			type: "GET",
			url: formObject.action,
			data: queryString+"&ajaxMode=1",
			cache: true,
			success: function(msg){
				//alert( "ajax submit function msg: " + msg );

				if(msg>1)	{
					jQuery(formObject).children('.countContainer').html("Suche ergibt<br />"+msg+" Erlebnisse");
				}else	{
					if(msg==0)	{
						jQuery(formObject).children('.countContainer').html("Suche ergibt<br />kein Erlebnis");
					}else	{
						jQuery(formObject).children('.countContainer').html("Suche ergibt<br />ein Erlebnis");
					}
				}
			}
		});

		// bind form using 'ajaxForm'
		//$('#myForm1').ajaxForm(options);

		return false;
	}

}



jQuery(document).ready(function(){
	jQuery.noConflict();
	//     jQuery(document).pngFix();

	var debugIt  = true;

	jQuery(function(){


		if ( _MR_MEASURE_JS_DURATION ) {
			Jiffy.mark("jd_jquery_doc_ready_start");
		}





		//		jQuery.profile.start();
		//Jiffy.mark("Load Items");


		/* moved to productdetail
		jQuery('.number').spin({max:10,min:1,imageBasePath:'<? BASE_URL ?>themes/jollydays/images/spin/'});
		*/

		jQuery('ul.sf-menu').superfish({
			delay:       1000,                            // one second delay on mouseout
			animation:   {height:'show'},  // fade-in and slide-down animation
			speed:       'fast',                          // faster animation speed
			autoArrows:  false,                           // disable generation of arrow mark-up
			dropShadows: false                            // disable drop shadows
		});

		jQuery('ul.sf-menu2').superfish({
			delay:       1000,                            // one second delay on mouseout
			animation:   {height:'show'},  // fade-in and slide-down animation
			speed:       'fast',                          // faster animation speed
			autoArrows:  false,                           // disable generation of arrow mark-up
			dropShadows: false                            // disable drop shadows
		});






		/*
		var product_corners = {
		tl: { radius: 6 },
		tr: { radius: 6 },
		bl: { radius: 6 },
		br: { radius: 6 },
		antiAlias: true,
		autoPad: true,
		validTags: ["div"]
		};

		var categoryintro_corners = {
		tl: { radius: 6 },
		tr: { radius: 6 },
		bl: { radius: 6 },
		br: { radius: 6 },
		antiAlias: true,
		autoPad: false,
		validTags: ["div"]
		};




		//		jQuery('.productbox').corner(product_corners);
		//		jQuery('.categoryintro').corner(categoryintro_corners);
		//		jQuery('#scroller').corner(product_corners);
		//		jQuery('#jollyFooter').corner(categoryintro_corners);
		jQuery('#productDetail').corner(categoryintro_corners);
		jQuery('.boxside').corner(product_corners);
		//		jQuery('.category-typo3-content').corner(product_corners);
		//		jQuery('#leftcolumn-searchbox-container').corner(product_corners);
		jQuery('h2.rounded').corner(product_corners);
		jQuery('div.roundedHome').corner(product_corners);
		//		jQuery('.pager-container').corner(product_corners);
		//		jQuery('.sliderProducts').corner(product_corners);
		jQuery('.textform_check').corner(product_corners);
		jQuery('.success_msg').corner(product_corners);
		//		jQuery('.scrollerBottom-container').corner(product_corners);
		jQuery('#colNormal').corner(product_corners);
		jQuery('.colNormalWide').corner(product_corners);
		jQuery('.csc-frame').corner(product_corners);
		jQuery('.csc-frame-inner').corner(product_corners);
		//	 	jQuery('#colNormalGenericContent').corner(product_corners);
		//		jQuery('.account-textcontainer').corner(product_corners);
		jQuery('#account-menu').corner(product_corners);
		jQuery('.textform_check_notopmargin').corner(product_corners);

		*/


		initialiseGlobalDialogMapping( );

		var height,width;

		///////////////////////////////////////////////
		// a.dialog CLICK START -----------
		///////////////////////////////////////////////

		jQuery('a.dialog').click(function(  mouseCoordinates ) {

			initialiseGlobalDialogMapping( );

	 

			var dialogId = jQuery(this ).attr ( 'href' )
			dialogId = '#'+dialogId.split('#')[1];

			//		alert (  mouseCoordinates.pageX +', '+ mouseCoordinates.pageY);

			_mouseCoordinatesX = mouseCoordinates.pageX;
			_mouseCoordinatesY = mouseCoordinates.pageY;


			/* 		for (key in myArray)
			document.write("For the key " + key
			+ " element value is " + myArray[key]); */

			// alert (globalDialogIdMapping.length);
			//		alert ( globalDialogIdMapping[i] ['name'] );

			for (var i = 0; i < globalDialogIdMapping.length; i++) {

				if ( "#" +globalDialogIdMapping[i] ['name'] ==  dialogId ) {
					height = globalDialogIdMapping[i] ['height']+60;
					width = globalDialogIdMapping[i] ['width']+ 30;
					break;
				}

			}
			
			
			/* this is not jquery 1.4 compatible */
			//	var dialogSourceOffset = jQuery( this ).offset ({ margin: true, padding: true,border: true, scroll: false });
				var dialogSourceOffset = jQuery( this ).offset ();
						
			
			var scroll = {
				left: jQuery( window ).scrollLeft(),
				top: jQuery( window ).scrollTop()
			};

			var top, left;
			/*var viewportWidth = jQuery( window ).width();
			var viewportHeight = jQuery( window ).height();


			if ( (dialogSourceOffset.left - scroll.left) < (viewportWidth / 1.5) ) {
			left = dialogSourceOffset.left+20;
			} else {
			left = dialogSourceOffset.left + jQuery( this ).width();
			}
			if ( (dialogSourceOffset.top - scroll.top) < (viewportHeight / 1.5) ) {
			top = dialogSourceOffset.top + jQuery( this ).height() + 5;
			} else {
			top = dialogSourceOffset.top;
			}*/

	
			
			left = dialogSourceOffset.left - scroll.left;
			top = (dialogSourceOffset.top - scroll.top) + 20;

		 
			

			if (!jQuery(dialogId).parents(".ui-dialog").is(":visible")) {
//	 alert ("0000" ) ;
				jQuery(dialogId).dialog({
					position:[left,top],
					draggable: false,
					resizable: false,
					/*height: height,*/
					/*height: 'auto',*/
					width: width,
					/*width: 'auto',*/
					autoOpen: false,
					close: function(dialogId)	{
//						alert(dialogId  ) ;

//		 alert ("1111" ) ;
						jQuery(dialogId).dialog('destroy');
					//	jQuery(dialogId).dialog('close').dialog('destroy');
					}
				}).dialog('open');

				/*width fix for ie6 start */
				jQuery(document).find('.ui-dialog').each(function() {
					maxWidth = 750;
					jQuery(this).css({width:((jQuery(this).width()>maxWidth)?275:jQuery(this).width())});
				});
				/*width fix for ie6 end */

			} else {
//				alert ("2") ;
		 		jQuery(dialogId).dialog('close').dialog('destroy');
			}
			return false;
		});

		///////////////////////////////////////////////
		// a.dialog CLICK END  -----------
		///////////////////////////////////////////////




		///////////////////////////////////////////////
		// a.search_click CLICK START  -----------
		///////////////////////////////////////////////

		// Function for data transfer to hidden form fields

		jQuery('a.search_click').click(function( ) {

			// get value of the selected option
			var value = jQuery(this).attr("id");

			jQuery(this).parent().find(".selected").each(function(){
				jQuery(this).removeClass("selected");
			});

			jQuery(this).addClass("selected");

			// get the label of the selected value
			var selectedText = jQuery(this).html();

			// find the parent element (input type name)
			//var parent = jQuery(this).parent().attr("name");
			var parent = jQuery(this).parent().attr("class");
 

			//alert ( value  + "<--> "+ selectedText + "<-->"  +parent + "\n" + '#'+parent) ;

			tmpValueArray = value.split( SPLIT_DELIMITER );

			// wenn elemente gefunden worden sind
			if  (tmpValueArray.length  > 1) {
				valueReal = tmpValueArray[1];
			}else {
				valueReal = value;
			}

			if ( debugAllowed) {
				alert ( value  + "<--> "+ selectedText + "<-->" + parent + "\n" + '#' + parent + "\n" + 'value: ' + valueReal);
			}

			//find the elment which to close after data transfer
			var dialogLayer = jQuery(this).parents().filter(':eq(1)').attr('id');

			//set value of form field (search val) - hidden value
			//jQuery('#'+parent).val(value);
			jQuery('#'+parent).val(valueReal);

			//finde the real form to submit
			tmpHidden =	 jQuery('#'+parent);
			var	theRealFormName ='';
			if(tmpHidden.attr("type") =='hidden') {
				// find form
				tmpForm = tmpHidden.parents().find('form') ;
				theRealFormName = tmpForm.attr("name")  ;
				//alert (theRealFormName) ;
			}

			//find form end
			textToInsert = html_entity_decode(selectedText);

			//check if value needs to be truncated
			for(var i = 0; i < globalDialogIdMapping.length; i++) {

				if(globalDialogIdMapping[i]['name']  == dialogLayer) {

					if(globalDialogIdMapping[i]['truncateAt'] > 0) {

						if(textToInsert.length  > globalDialogIdMapping[i]['truncateAt']) {
							textToInsert  = textToInsert.substr(0,	globalDialogIdMapping[i]['truncateAt'] ) + "..." ;
						}
					}
					break;
				}
			}

			//set label of the selected option start

			/*
			var cssObj = {
			fontWeight:'bold',
			color:'#008dd0'
			}

			jQuery('span.'+dialogLayer).html(textToInsert);
			jQuery('span.'+dialogLayer).css(cssObj);
			*/

			if(parent=="displayMode" ||
			parent=="sortBy" ||
			parent=="displayModesearchEvent" ||
			parent=="sortBysearchEvent")	{
				var cssObj = {
					fontWeight:'bold',
					color:'#ffffff'
				}

			}else	{
				var cssObj = {
					fontWeight:'bold',
					color:'#008dd0'
				}
			}

			var cssObjEmptyField = {
				fontWeight:'normal',
				color:'#000000'
			}

			if(textToInsert != "---")	{
				jQuery('span.'+dialogLayer).css(cssObj);
			}else	{
				jQuery('span.'+dialogLayer).css(cssObjEmptyField);
			}

			//maybe sexier?

			if(textToInsert == "---")	{
				if(parent == "forWhomSelect" || parent == "forWhomSelectcategoryViewForm")	{
					textToInsert = "Für";
				}
				if(parent == "priceToOptionSelect" || parent == "cat_price")	{
					textToInsert = "Preis";
				}
				if(parent == "factorSelect")	{
					textToInsert = "Erlebnis";
				}
				if(parent == "location" || parent == "locationEvent" || parent == "cat_locationcategoryViewForm")	{
					textToInsert = "Ort";
				}
				if(parent == "mainCatIdcategoryViewForm")	{
					textToInsert = "Kategorie";
				}
				if(parent == "catIdcategoryViewForm")	{
					textToInsert = "Themenwelt";
				}
				if(parent == "cat_pricecategoryViewForm")	{
					textToInsert = "Preis";
				}
			}

			jQuery('span.'+dialogLayer).html(textToInsert);

			//set label of the selected option end

			//var forms = jQuery(this).parents().find('form:first');
			//var forms = jQuery(this).parent().find('form:first');
			var forms = jQuery(this).parents().find('form');

			//autosubmit forms on dialog
			forms.each(function( intIndex ){

				var formname = jQuery(this).attr('name');

				if (theRealFormName == formname) {

					currentForm = this;

					if(formname == 'catfilter'  ||
					formname == 'searchpresent_center_search'  ||
					formname == 'searchevent_center_search'    ||
					formname == 'eventCalenderfilter'    ||
					formname == 'themengutschein-form' ||
					formname == 'checkSearch_top_search' ||
					formname == 'checkSearch_ew_search' ||
					formname == 'wertgutschein-form' ||
					formname == 'listNew_filter') {

						jQuery('#'+dialogLayer).dialog('close').dialog('destroy');
						jQuery(this).submit();
						//alert(this);
						return;
					}

				}

			});

			//alert (dialogLayer) ;
			jQuery('#'+dialogLayer).dialog('close').dialog('destroy');

			//alert( _mouseCoordinatesX  + " -- " +    _mouseCoordinatesY  +  " SCROLL");
			//alert( yyyyyyyyyy.pageX +', '+yyyyyyyyyy.pageY );
			//jQuery('body').animate({scrollTop:_mouseCoordinatesY}, 'slow');
			//alert(theRealFormName + "1");
			//alert(theRealFormName.val());
			//$("#my_form").attr("action",$(this).val());
			//alert ( currentForm.name);

			ajaxSubmitForm(currentForm);

			/*
			jQuery(currentForm).ajaxForm(function() {
			alert("Thank you for your comment!");
			});
			*/
			//return ( false );
		});

		///////////////////////////////////////////////
		// a.search_click CLICK END  -----------
		///////////////////////////////////////////////

		///////////////////////////////////////////////
		// a.selected START  -----------
		///////////////////////////////////////////////
		jQuery( "a.selected" ).each(function( intIndex ){


			initialiseGlobalDialogMapping( );

			// get value of the selected option
			var value = jQuery(this).attr("id");

			//if ( debugAllowed) {
			/// new seo start

			parentZZZZ  = jQuery(this).parent().attr("name");

			tmpValueArray = value.split( SPLIT_DELIMITER );


			if  (tmpValueArray.length  > 1) {
				valueReal = tmpValueArray[1];
			} else {
				valueReal = value;
			}

			if ( debugAllowed) {
				alert (intIndex + " " + value

				+"\n" + parentZZZZ
				+	"\n" + 'value: '+valueReal
				) ;
			}

			value =   valueReal  ;
			/// new seo end

			if (value.length > 1  ||  (parseInt(value) != 'NaN'  && parseInt(value) >0) ) {
				// get the label of the selected value
				var selectedText = jQuery(this).html();


				if (selectedText.length > 0) {
					// find the elment which to close after data transfer
					var dialogLayer = jQuery(this).parents().filter(':eq(1)').attr('id');


					//					truncateMe = 0;
					textToInsert = html_entity_decode(selectedText);

					// check if value needs to be truncated
					for (var i = 0; i < globalDialogIdMapping.length; i++) {
						if ( globalDialogIdMapping[i]['name']  == dialogLayer) {

							//			alert (globalDialogIdMapping[i]['name'] ) ;

							if ( 	globalDialogIdMapping[i]['truncateAt'] > 0) {
								if   (  textToInsert.length  > globalDialogIdMapping[i]['truncateAt'] ) {
									textToInsert  = textToInsert.substr(0,	globalDialogIdMapping[i]['truncateAt'] ) + "..." ;
								}
							}
							break;
						}
					}

					// set label of the selected option
					jQuery('span.'+dialogLayer).html(textToInsert);


					if(dialogLayer=="display_mode" || dialogLayer=="sort_by")	{
						var cssObj = {
							fontWeight:'bold',
							color:'#ffffff'
						}

					}else	{
						var cssObj = {
							fontWeight:'bold',
							color:'#008dd0'
						}
					}

					jQuery('span.'+dialogLayer).css(cssObj);
				}
			}


			//		alert (jQuery(this).attr("id")) ;
			//		for (var i = 0; i < globalDialogIdMapping.length; i++) {

			//	if ( "#" +globalDialogIdMapping[i] ['name'] ==  dialogId ) {
			//					height = globalDialogIdMapping[i] ['height']+60;
			//					width = globalDialogIdMapping[i] ['width']+ 30;
			//					break;
			//		}
			///		}
			//

		});

		///////////////////////////////////////////////
		// a.selected END  -----------
		///////////////////////////////////////////////




		//		 if (jQuery.browser.msie) {
		//		  if (parseInt(jQuery.browser.version) == 6) {
		//		  	var cssObjInput = {
		//					borderStyle:'inset',
		//					borderColor:'#808080',
		//					borderWidth:'2px',
		//					borderBottomWidth:'1px',
		//					borderRightWidth:'1px'
		//					}
		//		  		var inputfields = jQuery(':text').css(cssObjInput);
		//		  }
		//		}


		jQuery("#noAccountWarningGuthaben").hide();

		jQuery('#anmeldenradio').click(function() {
			//	jQuery("#anmeldeformular").toggle();
			//	jQuery("#loginformular").toggle();
			//	alert ( jQuery("#loginradio")[0].checked  ) ;

			jQuery("#anmeldeformular").show();
			jQuery("#loginformular").hide();
			jQuery("#anmeldeformularohne").hide();

			if(jQuery("#loginradio")[0])	{
				jQuery("#loginradio")[0].checked = false;
			}
			
			if(jQuery("#anmeldenradioohne")[0])	{
				jQuery("#anmeldenradioohne")[0].checked = false;
			}
			
			jQuery("div.bluerow:eq(0)").html("Ich bin bereits Kunde ...");
			jQuery("div.bluerow:eq(1)").html("<strong class=\"blue\">Ich bin ein Neukunde ...</strong>");
			jQuery("div.bluerow:eq(2)").html("Ich bin ein Neukunde ...");

			jQuery("#noAccountWarningGuthaben").hide();

		});

		jQuery('#loginradio').click(function() {
			//		jQuery("#anmeldeformular").toggle();
			//	jQuery("#loginformular").toggle();

			jQuery("#anmeldeformular").hide();
			jQuery("#anmeldeformularohne").hide();
			jQuery("#loginformular").show();

			//	 	alert ( jQuery("#anmeldenradio")[0].checked  ) ;

			if(jQuery("#anmeldenradio")[0])	{
				jQuery("#anmeldenradio")[0].checked = false;
			}
			
			if(jQuery("#anmeldenradioohne")[0])	{
				jQuery("#anmeldenradioohne")[0].checked = false;
			}
			
			jQuery("div.bluerow:eq(0)").html("<strong class=\"blue\">Ich bin bereits Kunde ...</strong>");
			jQuery("div.bluerow:eq(1)").html("Ich bin ein Neukunde ...");
			jQuery("div.bluerow:eq(2)").html("Ich bin ein Neukunde ...");

			jQuery("#noAccountWarningGuthaben").hide();

		});


		jQuery('#anmeldenradioohne').click(function() {
			//	jQuery("#anmeldeformular").toggle();
			//	jQuery("#loginformular").toggle();
			//	alert ( jQuery("#loginradio")[0].checked  ) ;

			jQuery("#anmeldeformular").hide();
			jQuery("#loginformular").hide();
			jQuery("#anmeldeformularohne").show();

			if(jQuery("#loginradio")[0])	{
				jQuery("#loginradio")[0].checked = false;
			}
			
			if(jQuery("#anmeldenradio")[0])	{
				jQuery("#anmeldenradio")[0].checked = false;
			}
			
			jQuery("div.bluerow:eq(0)").html("Ich bin bereits Kunde ...");
			jQuery("div.bluerow:eq(1)").html("Ich bin ein Neukunde ...");
			jQuery("div.bluerow:eq(2)").html("<strong class=\"blue\">Ich bin ein Neukunde ...</strong>");

			jQuery("#noAccountWarningGuthaben").show();

		});


		/*
		jQuery("a.bestprice").click(
		function () {

		var dialogId = '#bestpricedialog';


		var dialogSourceOffset = jQuery( this ).offset ({ margin: true, padding: true,border: true, scroll: false });
		var scroll = {
		left: jQuery( window ).scrollLeft(),
		top: jQuery( window ).scrollTop()
		};

		var top, left;
		var width = 430;
		var height = 390;

		left = dialogSourceOffset.left - scroll.left;
		top = (dialogSourceOffset.top - scroll.top) + 20;




		if (!jQuery(dialogId).parents(".ui-dialog").is(":visible")) {

		jQuery(dialogId).dialog({
		position:[left,top],
		draggable: false,
		resizable: false,
		height: height,
		width: width,
		autoOpen:false
		}).dialog('open');
		} else {

		jQuery(dialogId).dialog('close') ;
		}
		return false;
		}
		);
		*/







		/* info boxen   -on click */
// chechenblaikner fix this
//		jQuery("span.quickInfoLink a").click(function () {
		jQuery("span.quickInfoLink a").live('click',function () {

//		 console.log("logger bleiben: " + jQuery(this).attr('class'));

			clsTmpName = jQuery(this).attr('class')  ;

			//	console.log(jQuery('.'+infoContainerClass));

			var infoContainerClass = 'infoBox_' + clsTmpName;

//			alert (  jQuery('.'+infoContainerClass).size()  ) ;
			
			/*	noch kein element erzeugt - create it	*/
			if ( jQuery('.'+infoContainerClass).size() == 0) {
				htmlStr = '<div class="hide"> <div class="infoBox_'+  clsTmpName  +'" title="Quickinfo"> </div>	</div>' ;
				jQuery(htmlStr).appendTo("body") ;
				//alert ("+++" +clsTmpName) ;
			}


			var parentContainer = jQuery(this).parent("span.quickInfoLink");

			//alert(infoContainerClass);

			var loading = jQuery('<img src="'+tb_pathToImage+'" alt="loading" />');

			if(jQuery(parentContainer).hasClass("quickInfoLinkSelected"))	{
				var quickInfoDialog = jQuery('.'+infoContainerClass+":first");
			}else	{
				var quickInfoDialog = jQuery('.'+infoContainerClass+":first").append(loading);
				jQuery(parentContainer).addClass("quickInfoLinkSelected");
			}

			//alert (jQuery(quickInfoDialog).dialog('isOpen'));
			//console.log(quickInfoDialog);

			if(!jQuery(quickInfoDialog).parents(".ui-dialog").is(":visible")) {
				jQuery(quickInfoDialog)
				.load(jQuery(this).attr('href') + ' #quickInfoContent')
				.dialog({
					title: jQuery(this).attr('title')  ,
					width: 308,
					resizable: false,
					autoOpen:false
					// 			height: 300
				}).dialog('open');

			}else {
				jQuery(quickInfoDialog).dialog('close').dialog('destroy');
			}

			return false;
		});

		jQuery("span.ui-icon-closethick").click(function () {
			//alert("ddddd");
		});

		//	Jiffy.measure("EndLoad", "Load Items");
		//	jQuery.profile.done();



		if ( _MR_MEASURE_JS_DURATION ) {
			Jiffy.measure("jd_jquery_doc_ready_start", "jd_jquery_doc_ready_start");
		}



	});


	jQuery("a.productDetailInfoLink").click(function () {

		clsTmpName = jQuery(this).attr('id');

		infoContainerClass = "info_"+clsTmpName;

		if (jQuery('.'+infoContainerClass).size() == 0) {
			htmlStr = '<div class="hide"><div class="'+  infoContainerClass  +'" title="Quickinfo"> </div></div>';
			jQuery(htmlStr).appendTo("body") ;
		}

		var loading = jQuery('<img src="'+tb_pathToImage+'" alt="loading" />');

		if(jQuery(this).find('span.linkContent').hasClass("quickInfoLinkSelected"))	{
			var quickInfoDialog = jQuery('.'+infoContainerClass+":first");
		}else{
			var quickInfoDialog = jQuery('.'+infoContainerClass+":first").append(loading);
			jQuery(this).find('span.linkContent').addClass("quickInfoLinkSelected");
		}

		if(!jQuery(quickInfoDialog).parents(".ui-dialog").is(":visible")) {
			jQuery(quickInfoDialog)
			.load(jQuery(this).attr('href') + ' #quickInfoContent')
			.dialog({
				title: jQuery(this).attr('title')  ,
				width: 308,
				resizable: false,
				autoOpen:false
				// 			height: 300
			}).dialog('open');

		}else {
			jQuery(quickInfoDialog).dialog('close').dialog('destroy');
		}

		return false;
	});




	jQuery("a#bestPriceDialogLink").click(function () {

		clsTmpName = jQuery(this).attr('id');

		//alert(clsTmpName);

		infoContainerClass = "info_"+clsTmpName;

		if (jQuery('.'+infoContainerClass).size() == 0) {
			htmlStr = '<div class="hide"><div class="'+  infoContainerClass  +'" title="Best price"> </div></div>';
			jQuery(htmlStr).appendTo("body") ;
		}

		var loading = jQuery('<img src="'+tb_pathToImage+'" alt="loading" />');

		if(jQuery(this).parent('div.bestPriceContainer').hasClass("quickInfoLinkSelected"))	{
			var quickInfoDialog = jQuery('.'+infoContainerClass+":first");
		}else{
			var quickInfoDialog = jQuery('.'+infoContainerClass+":first").append(loading);
			jQuery(this).parent('div.bestPriceContainer').addClass("quickInfoLinkSelected");
		}

		if(!jQuery(quickInfoDialog).parents(".ui-dialog").is(":visible")) {
			jQuery(quickInfoDialog)
			.load(jQuery(this).attr('href') + ' #quickInfoContent')
			.dialog({
				title: jQuery(this).attr('title')  ,
				width: 430,
				resizable: false,
				autoOpen:false
				// 			height: 300
			}).dialog('open');

		}else {
			jQuery(quickInfoDialog).dialog('close').dialog('destroy');
		}

		return false;
	});


});