// DEBUG-Hilfe
// Auf dem Template einfügen: <span style="color:#FFF" id="debug"></span>
// In die Funtion einfügen: document.getElementById('debug').innerHTML  = document.images['head_' + headerImageAct[groupCounter]].src;


// Prüft im GET-Parameter auf einen übergebenen Kategorie-Index  und weist die Highlight-Klasse zu
// Für Seiten, die keiner Kategorie zugeordnet sind und das Highlightning nicht vom System übernommen werden kann
// catIndex: Indizes der Kategorien, auf die geprüft werden soll, Trenner ist das Pipesymbol
// catGroup: Anzahl der Elemente einer Gruppe. Wird benötigt, um das Headerbild zu ermitteln im Array headerImageAct
function checkIfCurrentNav (catIndex, catPre, catGroup, headGroup) {

	var catIndex_arr = catIndex.split("|");
	var catIndex_size = catIndex_arr.length;
	
	switch (headGroup) {
		case "themen": headerImageAct = new Array('giftPerson','giftTyp','giftAnlass','giftThema','giftInteresse'); break;
		case "koffer": headerImageAct = new Array('koffer','marke'); break;
		case "kontobereiche": headerImageAct = new Array('kontobereiche'); break;	
		case "aktuelles": headerImageAct = new Array('aktuelles'); break;		
	}
	
	for (var i = 0; i<catIndex_size; i++) {	
	
		if (window.location.href.indexOf(catPre+catIndex_arr[i]) != -1) { 
			
			elementID = 'extLink_' + catPre + catIndex_arr[i]; 
			document.getElementById(elementID).className  = 'selected';
			
			if (typeof catGroup != 'undefined') {
					
					var catGroup_arr = catGroup.split("|");
					var catGroup_size = catGroup_arr.length;
					var groupElements = 0;
					
					for (var groupCounter = 0; groupCounter<catGroup_size; groupCounter++) {
						
						groupElements += Number(catGroup_arr[groupCounter]);
						
						if (typeof headerImageAct != 'undefined') {
						
							if (i < groupElements) { 							
								document.images['head_' + headerImageAct[groupCounter]].src = "images/left_navi/head_" + headerImageAct[groupCounter] + "_act.png"; 
								break;
							}
							
						}

					}
			}
			break;
		}
		
    };

}

//Live-Result
function showLiveResult(str) {
	
	if (str.length<=3) {
	  document.getElementById("livesearch").innerHTML="";
	  document.getElementById("livesearch").style.border="0px";	  
	  return;
	}
	if (window.XMLHttpRequest) {
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
		$('#livesearch').show();
		document.getElementById("livesearch").innerHTML="<div style='position: absolute; background-color: #FFF;width: 274px; height: 150px; top: 0; left: 0x; z-index: 99999999; border:1px solid #BFBFBF; text-align:center'><br><br><img src='http://www.noble-life.de/$WS/promondo/websale7_shop-promondo/benutzer/templates/02-aa/images/common/preloader.gif' style='margin-left: 120px;'></div>";
	}
	else {
		// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function() {
	
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {
			document.getElementById("livesearch").innerHTML=xmlhttp.responseText;			
		}
	}
	xmlhttp.open("GET","http://www.noble-life.de/02-aa%2fliveresult_proxy%2ehtm?websale7=promondo;02-aa&tpl=02-aa/liveresult_proxy.htm&Ctx=%7bver%2f7%2fver%7d%7bst%2f40d%2fst%7d%7bcmd%2f0%2fcmd%7d%7bm%2fwebsale%2fm%7d%7bs%2fpromondo%2fs%7d%7bl%2f02%2daa%2fl%7d%7btpl%2f02%2daa%2fliveresult%5fproxy%2ehtm%2ftpl%7d%7bp1%2ff7766db0dfe298208df1dde8d915ca0e%2fp1%7d%7bmd5%2ff11830db706817f232bbafffba8588a7%2fmd5%7d&otp3="+str,true);
	xmlhttp.send();
}

	// Resize iframe to full height
function resizeIframe(height) {
	// "+60" is a general rule of thumb to allow for differences in
	// IE & and FF height reporting, can be adjusted as required..
	document.getElementById('ext_window').height = parseInt(height)+60;	
	window.scrollTo(0, 0);
}


// Funktion zum Absenden des Formulars in der Order History (Vom System gefordert)
function SubmitSelection() {
	document.forms['OrderHistory'].js_order_history.value = "on";
	document.forms['OrderHistory'].submit();
}

// Verzgerter Hover-Effekt bei Dropdown
function hoverDelay(containerID) {	
	document.getElementById(containerID).style.display = 'none'; 
	window.setTimeout("$('#"+containerID+"').fadeIn(0)", 200);
}

// Schreibt Individuellen Gutscheincode in vom System generierten um fr Marketingaktionen
function transform_voucher(voucherID) { 

	voucherID = voucherID.toLowerCase();

	switch (voucherID) {
		case 'reisen2011': {
			document.getElementsByName('input_voucher')[0].value = "R176-HC72-A85B-U53B"; break;
		}			
		case 'ostern-2011': {
			document.getElementsByName('input_voucher')[0].value = "VD3S-FTHT-8RNI-NPQ3"; break;
		}	
		case 'vip-geschenke': {
			document.getElementsByName('input_voucher')[0].value = "Z3NR-98RT-3HDA-J5UP"; break;
		}	
		case 'mvsv2011': {
			document.getElementsByName('input_voucher')[0].value = "LJCN-PJZ3-AFS9-GKG1"; break;
		}
		case 'aktionsrabatt2011': {
			document.getElementsByName('input_voucher')[0].value = "P2MJ-T71Z-25DC-DVLZ"; break;
		}		
		
		
			
		default: {
			// NOOP
		}
	} 

}

function divwechsel(tb, tc, tbsub, status) {
		if (status == 1)
			{
				window.clearInterval(themen_aktiv);
			}
		
		var i = 1;
		
		while(i <= 3)
		{
			var tb1 = "tb" + i; 
			var tc1 = "tc" + i;
			var tbsub1 = "tbsub" + i;
			
			document.getElementById(tb1).style.background = "#EFEFEF url(images/ws_start/themen_buttonbg.png) no-repeat";
			document.getElementById(tb1).style.color = "#4A4A4A";
			document.getElementById(tb1).style.fontWeight = "normal";
			document.getElementById(tc1).style.display = "none";
			document.getElementById(tbsub1).style.display = "none";
			i++;
		}
		
		// Aktives Element Effekte
		// BUG: Springt an Stelle wo Skript eingebunden ist beim Bildwechsel. Liegt voraussichtlich an dem display:none. Mit $('#'+tc).css("display","none"); springts nicht - dafr wird der Effekt auch nur einmal pro Bild angezeigt
		// $('#'+tc).fadeIn('slow');
		
		// Aktives Element Style ndern
		document.getElementById(tb).style.background = "#EFEFEF url(images/ws_start/"+tb+"_up.png) 215px 2px no-repeat";
		document.getElementById(tb).style.color = "#4A4A4A";
		document.getElementById(tb).style.fontWeight = "bold";
		document.getElementById(tc).style.background = "url(images/ws_start/thema_"+tc+".jpg)";
		document.getElementById(tc).style.display = "block";
		document.getElementById(tbsub).style.display = "block";

	}
	
function divwechsel_slider(sliderNr)
	{ 
		var button_slider = "slidepic" + sliderNr; 
		var div_slider = "sb" + sliderNr;
		var content_slider = "sc" + sliderNr;
		var carousel_slider = "mycarousel" + sliderNr;	
		var j = 1;
		
		while(j <= 4)
		{
			var button_slider1 = "slidepic" + j;
			var div_slider1 = "sb" + j;
			var content_slider1 = "sc" + j;
			var carousel_slider1 = "mycarousel" + j;
			
			//document.images[button_slider1].src="images/ws_start/slider_buttonmap"+j+".png";
			document.images[button_slider1].style.marginTop = "-34px";
			document.getElementById(div_slider1).style.borderBottom = "solid thin #c9c9c9";	
			document.getElementById(content_slider1).style.visibility = "hidden";
			document.getElementById(content_slider1).style.display = "none";
			document.getElementById(carousel_slider1).style.display = "none";
			j++;
		}
		
		//document.images[button_slider].src="images/ws_start/slider_buttonmap"+sliderNr+".png";
		document.images[button_slider].style.marginTop = "0px";
		document.getElementById(div_slider).style.borderBottom = "0px #FFFFFF";
		document.getElementById(content_slider).style.display = "block";
		document.getElementById(content_slider).style.visibility = "visible";
		document.getElementById(carousel_slider).style.display = "block";

	}
	
function close_ajaxinfo(globaldiv, reload) { 

	$('#mainwrap').css('opacity','1'); 
	$('#'+globaldiv).fadeOut('slow'); 
	if (reload==1) {
		location.reload(); 		
	}
	return false;
	
}
	
function timer_themen()
	{
		t = t + 1;
		if (t == 4)
			{
				t = 1;
			}
		var timer_button1 = "tb" + t;
		var timer_content1 = "tc" + t;
		var timer_tbsub = "tbsub" + t;
		divwechsel(timer_button1, timer_content1, timer_tbsub, 0);
	}
	
var t = 1;

function themen_ref(url)
	{
		window.location.href = url;
	}
	
function aktionen() 
	{
 		images = new Array
			(
				new Array("images/ws_start/links1.jpg",527,"-Topseller Schmelzfeuer","http://www.promondo.de"),
				new Array("images/ws_start/links2.jpg",527,"-Topseller Schmelzfeuer","/456"),
				new Array("images/ws_start/links3.jpg",527,"-Topseller Schmelzfeuer","/789")
			);
			
		for (i=0; i < images.length + i; i++) 
			{
		 		a = Math.round(Math.random()*images.length);
		 		if ((a >= 0) && (a < images.length)) 
					{
						bild = images[a];
						URL = bild[0];
						breite = bild[1];
						bildname = bild[2];
						verlinkung = bild[3];
						 
						if (navigator.appName.indexOf('Netscape') != -1) 
							{
								FensterBreite = self.innerWidth; 
							}
						else if (navigator.appName.indexOf('Microsoft') != -1) 
							{ 
								FensterBreite = document.body.clientWidth; 
							}
						var bildweite;
						bildweite = ( FensterBreite >= breite ) ? breite : ( ( FensterBreite < 350 ) ? 350 : "100%" );
						document.write("<a href=\""+verlinkung+"\"><img src=\""+URL+"\" border=\"0\" alt=\""+bildname+"\" align=\"left\" \/></a>");
						break;
		  			}
		 	}
	}



function aktionen2() 
	{
 		images = new Array
			(
				new Array("images/ws_start/rechts1.jpg",527,"-Pflanzgefe","/123"),
				new Array("images/ws_start/rechts2.jpg",227,"-Akkuschere","/345"),
				new Array("images/ws_start/rechts3.jpg",227,"-Akkuschere","/678")
			);
			
		for (i=0; i < images.length + i; i++) 
			{
				a = Math.round(Math.random()*images.length);
				if ((a >= 0) && (a < images.length)) 
					{
						bild = images[a];
						URL = bild[0];
						breite = bild[1];
						bildname = bild[2];
						verlinkung = bild[3];
						if (navigator.appName.indexOf('Netscape') != -1) 
							{ 
								FensterBreite = self.innerWidth;
							}
						else if (navigator.appName.indexOf('Microsoft') != -1) 
							{ 
								FensterBreite = document.body.clientWidth;
							}
						var bildweite;
						bildweite = ( FensterBreite >= breite ) ? breite : ( ( FensterBreite < 350 ) ? 350 : "100%" );
						document.write("<a href=\""+verlinkung+"\"><img src=\""+URL+"\" border=\"0\" alt=\""+bildname+"\" align=\"left\" \/></a>");
						break;
					}
			}
	}


	
/*var slider_aktiv = window.setInterval("divwechsel_slider('sb1', 'sc1', 1)", 1000);*/

// Blendet Teil des Textes aus und setzt Button zum Aus-/Einklappen
function texttoggler (textcontainerID, klapptextID, action) {	
	
	var text_ext = '<img src="images/products/button-text-ausklappen.png">';
	var text_cut = '<img src="images/products/button-text-einklappen.png">';
	
	if (document.getElementById(textcontainerID).innerHTML.length >= 600) { 

		if (document.getElementById(textcontainerID).style.overflow == 'visible'  || action=='init') {
			document.getElementById(textcontainerID).style.overflow = 'hidden';
			document.getElementById(textcontainerID).style.height = '14.50em';
			document.getElementById(klapptextID).innerHTML = text_ext;
		}
		else {
			document.getElementById(textcontainerID).style.overflow = 'visible';
			document.getElementById(textcontainerID).style.height = '100%';
			document.getElementById(klapptextID).innerHTML = text_cut;
		}
				
	}
		
}

// Blendet Errormessage bei falschem Formular aus (Hintergrund: Es gibt nur eine globale Variable vom System. Bsp. Login)
// Searchstring enthält die Fehlercodes des msgcontainer1
function hideWrongMsg(message, searchstring, msgcontainer1, msgcontainer2) {

	var searchstring_arr = searchstring.split("|");	
	var searchstring_size = searchstring_arr.length;
	var showMsgcontainer2 = true;
	
	for (var i = 0; i<searchstring_size; i++) {

		if ( message.indexOf(searchstring_arr[i]) != -1) { 
			document.getElementById(msgcontainer2).style.display = 'none';
			showMsgcontainer2 = false;
			break;
		}		
				
    };
	
	if ( showMsgcontainer2 ) {
		document.getElementById(msgcontainer1).style.display = 'none';
	}
	
}

function showSuperZoom (bildnr) {

   var w = 710;
   var h = 650;
   var hori = screen.availWidth;
   var verti = screen.availHeight;
   var mywin = window.open('http://media.promondo-produkte.de/savoir_vivre_neu/superzoom.php?id='+bildnr+'', 'SuperZoom','scrollbars=yes,resizable=no,width='+ w +',height='+ h +',left='+((hori - w- 10)* .5) +',top='+((verti - h- 30)*.5));   
   // mywin.focus();		Deaktiviert, da Scriptfehler im IE 7
   
}

function showBig (largeImgUrl) {

	var mywin=window.open('','Grossansicht','scrollbars=yes,resizable=yes,width=580,height=580,location=no,menubar=no,status=no,toolbar=no,top=100,left=100');
	mywin.document.open();
	mywin.document.write('<html><head><base href="http://www.promondo.de/$WS/promondo/websale7_shop-promondo/benutzer/templates/02-aa/"><title>Detailansicht</title><link rel="stylesheet" type="text/css" href="styles.css">');
	mywin.document.write('</head><body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">');
	mywin.document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="2" align="center"><tr><td align="center">');
	mywin.document.write('<img sr');
	mywin.document.write('c="'+largeImgUrl+'" border="0">');
	mywin.document.write('</td></tr><tr><td align="center" valign="bottom" class="text"><br>');
	mywin.document.write('<a href="javascript:window.close();"><img src=\"buttons/b_fenster_schliessen.gif\" border=\"0\"></a>');
	mywin.document.write('</td></tr></table>');
	mywin.document.write('</bo');
	mywin.document.write('dy></ht');
	mywin.document.write('ml>');
	mywin.document.close();
	mywin.focus();
	
}

function PopupVideo (video) {

	var w = 710;
	var h = 650;
	var hori = screen.availWidth;
	var verti = screen.availHeight;
	var mywin = window.open('http://media.promondo-produkte.de/video/getvideo.php?pn='+video, 'SuperZoom','scrollbars=yes,resizable=no,width='+ w +',height='+ h +',left='+((hori - w- 10)* .5) +',top='+((verti - h- 30)*.5));
	mywin.focus();
	
}

var blaetterKatalogFenster;

function openpopup(shopSessionID, page, bereich, katalog) {
	var folder = "";
	
	switch (bereich) {
		case 'fashion': folder = '01-aa/blaetterkatalog/fashion/' + katalog + '.html'; break;
		case 'lifestyle': folder = '01-aa/blaetterkatalog/lifestyle/' + katalog + '.html'; break;
		case 'herbst': folder = '01-aa/blaetterkatalog/herbst/' + katalog + '.html'; break;
		case 'noblelife': folder = '01-aa/blaetterkatalog/noblelife/' + katalog + '.html'; break;
		default: folder = '01-aa/blaetterkatalog.html';
	}
	
	blaetterKatalogFenster = window.open("http://www.promondo.de/$WS/promondo/websale7_shop-promondo/benutzer/templates/" + folder + "?SID="+shopSessionID+"&PAGE="+page, "bkparent", "width=" + screen.availWidth +", height=" +screen.availHeight + ",left=0,top=0,toolbar=no,status=no,menubar=no,resizable=yes,location=no");
	blaetterKatalogFenster.focus();
}

function blaetterkatalog(shopSessionID, page, bereich, katalog) {
	openpopup(shopSessionID, page, bereich, katalog);
	return false;
}


// Funktionen, die Javascript bentigen werden standardmig ausgeblendet. Mit der show-Funktion, die beim onLoad-Event aufgerufen wird, werden diese wieder anzeigt.
function show(elementIDs) {

	var elementIDs_arr = elementIDs.split("|");	
	var elementIDs_size = elementIDs_arr.length
	
	for (var i = 0; i<elementIDs_size; i++) {
		if (document.getElementById(elementIDs_arr[i]).value != -1) {
			document.getElementById(elementIDs_arr[i]).style.display = 'inline';
		}
    };
		
}

// Markiert Bilder bei Klick auf Thumbnails
function toggleProduct (prodArtNr, action, videoID) { 
				
		var activeProduct = "http://www.promondo.de/$WS/promondo/websale7_shop-promondo/produkte/medien/bilder/378px/" + prodArtNr + ".jpg"; 
		var activeProductThumb = prodArtNr + "_thumb";
		var activeOrderbox = prodArtNr + "_orderbox";
		var mainpicID = 'mainpicture'; // ID des auszutauschenden Bilds
		var zoomlinkID = 'btn_zoom';  // ID des Zoom-Buttons
		var zoompicID = 'link_zoom';  // ID des Artikelbilds
		var zoomtextlinkID = 'textlink_zoom';  // ID des Text-Links
		var videoBtnID = 'btn_video';  // ID des Video-Buttons
		var videoLnkID = 'link_video';  // ID des A-Tags
		
		// Es wurde schon mindestens einmal geklickt
		if (typeof lastOrderbox != 'undefined') {
			// Rueckgaengigmachen der Styles
			document.getElementById(lastOrderbox).className = "produktdetail_bestellbox";
			document.getElementById(lastProductThumb).style.borderColor = '#B3B3B3';
		} 
		
		document.getElementById(activeProductThumb).style.borderColor = '#C9C9C9';
		document.images[mainpicID].src = activeProduct; 
		
		document.getElementById(zoomlinkID).href = "http://www.promondo.de/$WS/promondo/websale7_shop-promondo/produkte/medien/bilder/superzoom/" + prodArtNr + ".jpg";
		document.getElementById(zoompicID).href = "javascript:showSuperZoom('"+ prodArtNr +"');";
		//document.getElementById(zoomtextlinkID).href = "javascript:showSuperZoom('"+ prodArtNr +"');";
		
		$(".jqzoom").remove;
		$(".jqzoom").jqzoom({zoomWidth: 540, zoomHeight: 328, xOffset: 30, yOffset: 25, title: false, showPreload: true, hideEffect: "fadeout", preloadText: "Lade Details..."});
		
		if (videoID != 1) {
			document.getElementById(videoBtnID).style.display = "none";
		}
		else {
			document.getElementById(videoBtnID).style.display = "inline";
			document.getElementById(videoLnkID).href = "javascript:PopupVideo('"+ prodArtNr +"');";
		}
		
		// Zuweisen der Styles zu den aktuellen Elementen: Bestellbox, Hauptbild & Rahmenfarbe des Thumbs
		if (action!='Detail') {
		
			// Linkaufruf von einem Detailbild
			document.getElementById(activeOrderbox).className = "produktdetail_bestellbox highlight";
					
			// Akutelle Werte werden fr spter gespeichert
			lastOrderbox = activeOrderbox;
			lastProduct = activeProduct;
			lastProductThumb = activeProductThumb;		
		}
		
		if ( typeof (discountArray) != 'undefined' ) { 
		
			if (typeof discountArray['discount_'+prodArtNr] != 'undefined') {
				document.getElementById('reduziert_container').style.display = 'block'; 
				document.getElementById('reduziert_container').innerHTML = discountArray['discount_'+prodArtNr] + "%&nbsp;";
			}
			else if (prodArtNr.search(/G+/) != -1) { 
				document.getElementById('reduziert_container').style.display = 'block'; 
				document.getElementById('reduziert_container').innerHTML = "%&nbsp;&nbsp;";				
			}
			else {
				document.getElementById('reduziert_container').style.display = 'none'; 
			}
			
		}

}

//Rundet den übergebenen Wert auf ganze Stellen	
//Rundet das übergebene Argument und gibt die Zeile mit Suffix und Präfix aus
function roundArgument(discount_id, arg, returnVal)	{
	
		var value;
		
		if (typeof(discountArray) == 'undefined')  {
			discountArray = new Array();
			discountArrayCounter = 0;
		}
		
		if (arg == null)
		  return;

		value = parseFloat(arg);
		if (value == NaN)
		  return;
		//value = Math.floor(value);
		value = Math.round(value);
		
		if (value > 4) {
				
			if (returnVal != 1 ) {				
				document.getElementById(discount_id).innerHTML = '' + value ;
				discountArray[discount_id] = value;
				discountArrayCounter++;
			}
			else {
				discountArray[discount_id] = value;
				discountArrayCounter++;
			}
		}
}

// Tabmenü für Produktcontent
function tabcontents_hide() {
	$("#tabcontent").hide();
	$("#tabmeasurement").hide();
	$("#tabproperties").hide();
	$("#tabcontent_btn").removeClass("tabcontent_active");
	$("#tabmeasurement_btn").removeClass("tabcontent_active");
	$("#tabproperties_btn").removeClass("tabcontent_active");
}
function tabslider_contents_hide() {
	$("#tabslider1_content").hide();
	$("#tabslider2_content").hide();
	$("#tabslider1_btn").removeClass("tabcontent_active");
	$("#tabslider2_btn").removeClass("tabcontent_active");
}

function changeGiftUrl (cat_value, auto_redirect) {
	
	var url_prefix = 'http://www.promondo.de/websale7/?shopid=promondo&';
	var cat_opt = new Array ();
	
	// URLs der Geschenkekategorien
	cat_opt[1] = new Array (
		url_prefix + 'act=category&cat_index=000076&fp1=ges_sie',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Sie&search_cat_index=000076&price_until=50&type=websale&fp1=ges_sie&fp2=bis50',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Sie&search_cat_index=000076&price_from=50&price_until=100&type=websale&fp1=ges_sie&fp2=ab50bis100',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Sie&search_cat_index=000076&price_from=100&type=websale&fp1=ges_sie&fp2=ab100'
	);
	
	cat_opt[2] = new Array (
		url_prefix + 'act=category&cat_index=000076&fp1=ges_ihn',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Ihn&search_cat_index=000077&price_until=50&type=websale&fp1=ges_ihn&fp2=bis50',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Ihn&search_cat_index=000077&price_from=50&price_until=100&type=websale&fp1=ges_ihn&fp2=ab50bis100',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Ihn&search_cat_index=000077&price_from=100&type=websale&fp1=ges_ihn&fp2=ab100'
	);
	
	cat_opt[3] = new Array (
		url_prefix + 'act=category&cat_index=000221&fp1=ges_kinder',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Kinder&search_cat_index=000221&price_until=50&type=websale&fp1=ges_kinder&fp2=bis50',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Kinder&search_cat_index=000221&price_from=50&price_until=100&type=websale&fp1=ges_kinder&fp2=ab50bis100',
		url_prefix + 'act=search&search_input=Geschenke+f%FCr+Kinder&search_cat_index=000221&price_from=100&type=websale&fp1=ges_kinder&fp2=ab100'
	);	
	
	// Automatischer Weiterleitung auf die Seite
	if (typeof auto_redirect != 'undefined') { 
		self.location.href = cat_opt[cat_value][auto_redirect];
	}
	
	// Geschenkefinder
	var selectbox_lvl1ID = 'geschenkefinder_choice1';
	var selectbox_lvl1Length = document.getElementById(selectbox_lvl1ID).length;
	var selectbox_lvl2ID = 'geschenkefinder_choice2';
	var selectbox_lvl2Length = document.getElementById(selectbox_lvl2ID).length;
	var selectbox_linkID = 'geschenkfinder_link';

	for (i=0; i<=selectbox_lvl1Length; i++) {
		document.getElementById(selectbox_lvl2ID).options[i].value = cat_opt[cat_value][i];
	}
		
	// Alte gestylte Selectbox lschen, damit Optionvalues aktualisiert werden knnen 
	var sp = document.getElementById('jgd_dd_geschenkefinder_choice2');
	sp.parentNode.removeChild(sp);

	// Gestylte Selectbox mit aktualisierten Optionvalues wieder hinschreiben
	$("select#geschenkefinder_choice2").jgdDropdown({
		cls: 'select_190px'
	});	
}

// Ein-/Ausfaden bei interaktivem Bild in Rubrikseite
function fadeProduktDetails (prod_fadein, prodnr) {
		
		var triggerpic_src = "images/product_categories/trigger.png";
		var triggerpic_close_src = "images/product_categories/trigger_close.png";
		
		if (typeof prod_active == 'undefined') {
			prod_active = 0; 
		}
				
		for (i=1; i<=prodnr; i++) {
		
			if (i != prod_fadein) {
				var prod_detail = "desc" + i; 
				var trigger_pic = "trigger_desc" + i; 
				document.getElementById(prod_detail).style.display = "none";
				document.images[trigger_pic].src = triggerpic_src;	
			}
			
		}
		
		if (prod_active == prod_fadein) {
			document.images["trigger_desc" + prod_fadein].src = triggerpic_src;		
			$('#desc'+prod_fadein).fadeOut('fast');
			prod_active = 0;
		}
		else {
			document.images["trigger_desc" + prod_fadein].src = triggerpic_close_src;		
			$('#desc'+prod_fadein).fadeIn('slow');		
			prod_active = prod_fadein;
		}
		
}

/*!
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 2.11 (15-JUN-2010)
 * Requires jQuery v1.3.2 or later
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Authors: Dave Methvin and Mike Alsup
 */

/**
 *  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
 *
 *  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
 *  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)
 *  width:   width of the effect; in the case of rounded corners this is the radius. 
 *           specify this value using the px suffix such as 10px (yes, it must be pixels).
 */
;(function($) { 

var style = document.createElement('div').style,
    moz = style['MozBorderRadius'] !== undefined,
    webkit = style['WebkitBorderRadius'] !== undefined,
    radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined,
    mode = document.documentMode || 0,
    noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8),

    expr = $.browser.msie && (function() {
        var div = document.createElement('div');
        try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); }
        catch(e) { return false; }
        return true;
    })();

$.support = $.support || {};
$.support.borderRadius = moz || webkit || radius; // so you can do:  if (!$.support.borderRadius) $('#myDiv').corner();

function sz(el, p) { 
    return parseInt($.css(el,p))||0; 
};
function hex2(s) {
    var s = parseInt(s).toString(16);
    return ( s.length < 2 ) ? '0'+s : s;
};
function gpc(node) {
    while(node) {
        var v = $.css(node,'backgroundColor'), rgb;
        if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') {
            if (v.indexOf('rgb') >= 0) { 
                rgb = v.match(/\d+/g); 
                return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
            }
            return v;
        }
        if (node.nodeName.toLowerCase() == 'html')
            break;
        node = node.parentNode; // keep walking if transparent
    }
    return '#ffffff';
};

function getWidth(fx, i, width) {
    switch(fx) {
    case 'round':  return Math.round(width*(1-Math.cos(Math.asin(i/width))));
    case 'cool':   return Math.round(width*(1+Math.cos(Math.asin(i/width))));
    case 'sharp':  return Math.round(width*(1-Math.cos(Math.acos(i/width))));
    case 'bite':   return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
    case 'slide':  return Math.round(width*(Math.atan2(i,width/i)));
    case 'jut':    return Math.round(width*(Math.atan2(width,(width-i-1))));
    case 'curl':   return Math.round(width*(Math.atan(i)));
    case 'tear':   return Math.round(width*(Math.cos(i)));
    case 'wicked': return Math.round(width*(Math.tan(i)));
    case 'long':   return Math.round(width*(Math.sqrt(i)));
    case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
    case 'dogfold':
    case 'dog':    return (i&1) ? (i+1) : width;
    case 'dog2':   return (i&2) ? (i+1) : width;
    case 'dog3':   return (i&3) ? (i+1) : width;
    case 'fray':   return (i%2)*width;
    case 'notch':  return width; 
    case 'bevelfold':
    case 'bevel':  return i+1;
    }
};

$.fn.corner = function(options) {
    // in 1.3+ we can fix mistakes with the ready state
    if (this.length == 0) {
        if (!$.isReady && this.selector) {
            var s = this.selector, c = this.context;
            $(function() {
                $(s,c).corner(options);
            });
        }
        return this;
    }

    return this.each(function(index){
        var $this = $(this),
            // meta values override options
            o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(),
            keep = /keep/.test(o),                       // keep borders?
            cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]),  // corner color
            sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]),  // strip color
            width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10, // corner width
            re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/,
            fx = ((o.match(re)||['round'])[0]),
            fold = /dogfold|bevelfold/.test(o),
            edges = { T:0, B:1 },
            opts = {
                TL:  /top|tl|left/.test(o),       TR:  /top|tr|right/.test(o),
                BL:  /bottom|bl|left/.test(o),    BR:  /bottom|br|right/.test(o)
            },
            // vars used in func later
            strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz;
        
        if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
            opts = { TL:1, TR:1, BL:1, BR:1 };
            
        // support native rounding
        if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {
            if (opts.TL)
                $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');
            if (opts.TR)
                $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');
            if (opts.BL)
                $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');
            if (opts.BR)
                $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');
            return;
        }
            
        strip = document.createElement('div');
        $(strip).css({
            overflow: 'hidden',
            height: '1px',
            minHeight: '1px',
            fontSize: '1px',
            backgroundColor: sc || 'transparent',
            borderStyle: 'solid'
        });
    
        pad = {
            T: parseInt($.css(this,'paddingTop'))||0,     R: parseInt($.css(this,'paddingRight'))||0,
            B: parseInt($.css(this,'paddingBottom'))||0,  L: parseInt($.css(this,'paddingLeft'))||0
        };

        if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE
        if (!keep) this.style.border = 'none';
        strip.style.borderColor = cc || gpc(this.parentNode);
        cssHeight = $(this).outerHeight();

        for (j in edges) {
            bot = edges[j];
            // only add stips if needed
            if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {
                strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
                d = document.createElement('div');
                $(d).addClass('jquery-corner');
                ds = d.style;

                bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);

                if (bot && cssHeight != 'auto') {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.bottom = ds.left = ds.padding = ds.margin = '0';
                    if (expr)
                        ds.setExpression('width', 'this.parentNode.offsetWidth');
                    else
                        ds.width = '100%';
                }
                else if (!bot && $.browser.msie) {
                    if ($.css(this,'position') == 'static')
                        this.style.position = 'relative';
                    ds.position = 'absolute';
                    ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';
                    
                    // fix ie6 problem when blocked element has a border width
                    if (expr) {
                        bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');
                        ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"');
                    }
                    else
                        ds.width = '100%';
                }
                else {
                    ds.position = 'relative';
                    ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : 
                                        (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';                
                }

                for (i=0; i < width; i++) {
                    w = Math.max(0,getWidth(fx,i, width));
                    e = strip.cloneNode(false);
                    e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
                    bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
                }
                
                if (fold && $.support.boxModel) {
                    if (bot && noBottomFold) continue;
                    for (c in opts) {
                        if (!opts[c]) continue;
                        if (bot && (c == 'TL' || c == 'TR')) continue;
                        if (!bot && (c == 'BL' || c == 'BR')) continue;
                        
                        common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };
                        $horz = $('<div/>').css(common).css({ width: width + 'px', height: '1px' });
                        switch(c) {
                        case 'TL': $horz.css({ bottom: 0, left: 0 }); break;
                        case 'TR': $horz.css({ bottom: 0, right: 0 }); break;
                        case 'BL': $horz.css({ top: 0, left: 0 }); break;
                        case 'BR': $horz.css({ top: 0, right: 0 }); break;
                        }
                        d.appendChild($horz[0]);
                        
                        var $vert = $('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });
                        switch(c) {
                        case 'TL': $vert.css({ left: width }); break;
                        case 'TR': $vert.css({ right: width }); break;
                        case 'BL': $vert.css({ left: width }); break;
                        case 'BR': $vert.css({ right: width }); break;
                        }
                        d.appendChild($vert[0]);
                    }
                }
            }
        }
    });
};

$.fn.uncorner = function() { 
    if (radius || moz || webkit)
        this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);
    $('div.jquery-corner', this).remove();
    return this;
};

// expose options
$.fn.corner.defaults = {
    useNative: true, // true if plugin should attempt to use native browser support for border radius rounding
    metaAttr:  'data-corner' // name of meta attribute to use for options
};
    
})(jQuery);

/*
 * jGD DropDown
 * Version 0.4 (18-SEP-2010)
 * @requires jQuery v1.3 or later
 *
 * Homepage: http://www.dev4press.com/jquery/jgd-dropdown/
 * Examples: http://www.dev4press.com/jgd/dropdown/
 *
 * Copyright (c) 2008-2010 Milan Petrovic, Dev4Press
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Thanks to Janko at Warp Speed for this great article:
 * http://www.jankoatwarpspeed.com/post/2009/07/28/reinventing-drop-down-with-css-jquery.aspx
 */

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($){$.7.r=5(f){3 g=$.15({},$.7.r.K,f);m 6.P(5(){3 c=$(6);3 d=$.7.r.N(c,g);$("#"+d+" p a").A(5(){$("#"+d+" 9 l").19();m D});$(1d).1h(\'A\',5(e){3 a=$(e.17);4(!a.1f().1l(g.v)){$("."+g.v+" 9 l").B()}});$("#"+d+" 9 l s a").A(5(){3 a=$(6);3 b=a.y("u.H").F();c.n(b);$("#"+d+" p a").F(a.F());$("#"+d+" 9 l").B();4(g.J){$("#"+d+" p").o("8",a.w().o("8"))}a.w().w().y("s").1b(g.z);a.w().1j(g.z);4(g.I){g.I(c,b)}m D})})};$.7.r.K={I:M,v:\'t-16\',L:\'\',V:D,10:\'\',z:\'q\',J:R,12:R,q:\'\'};$.7.r.N=5(e,f){3 g=f.L;3 h=\'\';4(f.q!==M&&f.q!==\'\'){e.n(f.q);4(!f.V){g=\'\'}}3 i=e.y("Y[q]");3 j=$("Y",e);3 k="1a"+O(e);e.1e(\'<X 11="\'+k+\'" 8="\'+f.v+\'"></X>\');4(g===\'\'){g=i.T();h=i.n()}$("#"+k).E(\'<p><a 13="#">\'+g+\'<u 8="H">\'+h+\'</u></a></p>\');$("#"+k).E(\'<9><l></l></9>\');j.P(5(a){3 b=$(6).o("8");3 c=$(6).o("Z");3 d=f.10+$(6).n();4(f.12){d+=" x-"+a;d+=" x-"+($.7.t.14(a)?"18":"1k");4(a===0){d+=" x-1p"}4(a==j.1s-1){d+=" x-S"}4(b&&b!==\'\'){d+=" "+1g}}4(f.J){$("#"+k+" p").o("8",d)}4($(6).n()==i.n()){d+=" "+f.z}$("#"+k+" 9 l").E(\'<s 8="\'+d+\'"><a 13="#">\'+$(6).T()+\'<u 8="H">\'+$(6).n()+\'</u></a></s>\');4(c){$("#"+k+" 9 l").y("s:S a").o("Z",c)}});e.B();m k};$.7.t=5(){};$.7.t.14=5(a){m(a%2===0)};5 O(a){3 b=a.o("11");4(b===""){b=W()}m b}5 W(){3 a=1n 1u().1c();3 b=Q.1m();3 c=Q.1q(b*1t);m"t"+a+c}5 1v(a){4(C.G&&C.G.U){C.G.U(\'1i: \'+a.1o())}}})(1r);',62,94,'|||var|if|function|this|fn|class|dd||||||||||||ul|return|val|attr|dt|selected|jgdDropdown|li|jgd|span|cls|parent|item|find|clsLISelected|click|hide|window|false|append|html|console|value|callback|clsCopySelect|defaults|initTitle|null|convert|get_id|each|Math|true|last|text|log|forceTitle|random_id|dl|option|style|clsLIPrefix|id|clsLIExpand|href|isEven|extend|dropdown|target|even|toggle|jgd_dd_|removeClass|getMilliseconds|document|after|parents|thisclass|bind|jgd_dropdown|addClass|odd|hasClass|random|new|size|first|round|jQuery|length|100000|Date|debug'.split('|'),0,{}));

$.fn.center = function () { this.css( "position", "absolute"); this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px"); this.css("left", ( $(window).width() ) / 2+$(window).scrollLeft() + "px"); return this; };

/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/
;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);

/***********************************************************/
/*                    tinyTips Plugin                      */
/*                      Version: 1.1                       */
/*                      Mike Merritt                       */
/*                 Updated: Mar 2nd, 2010                  */
/***********************************************************/

(function(a){a.fn.tinyTips=function(h,b){if(h==="null"){h="light"}var d=h+"Tip";var c='<div class="'+d+'"><div class="content"></div><div class="bottom">&nbsp;</div></div>';var e=300;var f;var g;a(this).hover(function(){a("body").append(c);var k="div."+d;f=a(k);f.hide();if(b==="title"){var i=a(this).attr("title")}else{if(b!=="title"){var i=b}}a(k+" .content").html(i);g=a(this).attr("title");a(this).attr("title","");var m=f.height()+2;var j=(f.width()/2)-(a(this).width()/2);var n=a(this).offset();var l=n;l.top=n.top-m;l.left=n.left-j;f.css("position","absolute").css("z-index","1000");f.css(l).fadeIn(e)},function(){a(this).attr("title",g);f.fadeOut(e,function(){a(this).remove()})})}})(jQuery);

/*
* @version $Id: jquery.glow.js 1122 2010-11-03 20:27:14Z kent $
* @package zesk
* @subpackage jquery
* @author Kent M. Davidson http://www.razzed.com/
* @copyright Copyright &copy; 2009, Market Acumen, Inc.
* Created on Thu Mar 19 15:27:08 EDT 2009 15:27:08
*/

(function($){$.fn.glow=function(){var clookup={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};function nameToColor(n){return clookup[(""+n).toLowerCase()]||null;}
function re_rgba()
{return new RegExp('rgba\\s*\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\,\\s*([0-9]{1,3})\\s*\\)');}
function re_rgb()
{return new RegExp('rgb\\s*\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)');}
function parseColor(c){var r;var e=new RegExp('#([A-F0-9]{2})([a-fA-F0-9]{2})([A-F0-9]{2})','i');if(r=e.exec(c)){return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];}
e=new RegExp('#([A-F0-9]{1})([A-F0-9]{1})([A-F0-9]{1})','i');if(r=e.exec(c)){return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];}
e=re_rgb();if(r=e.exec(c)){return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)];}
e=re_rgba();if(r=e.exec(c)){return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseInt(r[4],10)];}
if(r=nameToColor(c)){return parseColor('#'+r);}
if(window.console){console.log('can not parse color '+c);}else{}
return false;}
function colorMatters(c){if(c=="inherit"||c=="transparent"){return false;}
var e=re_rgba();var r=e.exec(c);if(r&&parseInt(r[4],10)==0){return false;}
return true;}
function printColor(r){return'#'+(0x1000000+parseInt(r[0],10)*0x10000+parseInt(r[1],10)*0x100+parseInt(r[2],10)).toString(16).slice(-6);}
function finalBackgroundColor(e){var bg;do{bg=e.css('background-color');if(colorMatters(bg)){return bg;}
bg=e[0].bgColor;if(bg){return bg;}
e=e.parent();}while(e.length>0&&e.get(0).tagName);return arguments[1]||'#FFF';}
function glowItem(duration,steps)
{function glowFunction(){if(step<steps){var c=[0,0,0];for(var i=0;i<3;i++){c[i]=parseInt(srcc[i])+(((parseInt(dstc[i])-parseInt(srcc[i]))/steps)*step);}
elem.css('background-color',printColor(c));step=step+1;setTimeout(glowFunction,timeoutstep);}else{elem.css('background-color',ocol);elem.attr('glowing',0);}}
var elem=$(this);if(elem.attr('glowing')==1){return;}
elem.attr('glowing',1);var ocol=$(elem).css('background-color');var dstc=parseColor(finalBackgroundColor(elem));if(!dstc){return;}
var step=0;var timeoutstep=parseInt(duration/steps,10);glowFunction.call(elem);}
var srcc=parseColor(arguments[0]||'#FFFF99');if(!srcc){return false;}
var duration=arguments[1]||1000;var steps=arguments[2]||50;if(duration<0||!duration){duration=1000;}
if(steps<0||!steps){steps=1;}
$(this).each(function(i,x){glowItem.call(x,duration,steps);});};})(jQuery);

/*
 * jQuery postMessage - v0.5 - 9/11/2009
 * http://benalman.com/projects/jquery-postmessage-plugin/
 * 
 * Copyright (c) 2009 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($){var g,d,j=1,a,b=this,f=!1,h="postMessage",e="addEventListener",c,i=b[h]&&!$.browser.opera;$[h]=function(k,l,m){if(!l){return}k=typeof k==="string"?k:$.param(k);m=m||parent;if(i){m[h](k,l.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))}else{if(l){m.location=l.replace(/#.*$/,"")+"#"+(+new Date)+(j++)+"&"+k}}};$.receiveMessage=c=function(l,m,k){if(i){if(l){a&&c();a=function(n){if((typeof m==="string"&&n.origin!==m)||($.isFunction(m)&&m(n.origin)===f)){return f}l(n)}}if(b[e]){b[l?e:"removeEventListener"]("message",a,f)}else{b[l?"attachEvent":"detachEvent"]("onmessage",a)}}else{g&&clearInterval(g);g=null;if(l){k=typeof m==="number"?m:typeof k==="number"?k:100;g=setInterval(function(){var o=document.location.hash,n=/^#?\d+&/;if(o!==d&&n.test(o)){d=o;l({data:o.replace(n,"")})}},k)}}}})(jQuery);


