Indexes = new Array();
BinaryCodeIDs = new Array();
TreeNodeIDs = new Array();
Helper=new Array();
oldx=0;
oldy=0;
var dialog = false;
var shipping = false;
var recommend = false;
var vormerken = false;
var eieruhr = false;
var IEBUG = false;

// Letze ADS-Zoom Werte merken
var Z_BID=0;
var Z_BCVID=0; 
var Z_ImageID=0;
var Z_Indes = 0;

imageURL = new Array();
imageName = new Array();
imageURLs = new Array();
imageNames = new Array();

var BrowserAgent=navigator.userAgent.toLowerCase();
if (BrowserAgent.indexOf("msie 6") >=0 || BrowserAgent.indexOf("msie 5") >= 0)
	IEBUG = true;

var	position=new Object();
var docEl = (
	typeof document.compatMode != "undefined" 
	&& 
	document.compatMode        != "BackCompat"
)? "documentElement" : "body";




function appendGuidedNavigationDetails()
{
	var TargetContentBox = jQuery("#GuidedNavigationDetailsContainer");
	if( !TargetContentBox ) {
		return false;
	}

	var content;
	jQuery(".GuidedNavigationDetailsContent").each( function() {
		content = '<div class="GuidedNavigationDetailsContentElement">' + jQuery(this).html() + '</div>';
		TargetContentBox.append(content);
		jQuery(this).remove();
	});
	if (typeof(content) != 'undefined')
	{
		jQuery("#GuidedNavigationDetails").show();
	}
}
function toggleGuidedNavigationDetails(boxID,divID,defaultHeight,step)
{
	if(typeof(divID) == 'undefined' || typeof(boxID) == 'undefined')
		return false;
	else
	{
		var box = document.getElementById(boxID);
		var div = document.getElementById(divID);		
		//in welche Richtung? hoch- oder runtersliden?
		if(box.offsetHeight < div.offsetHeight)
		{
			slideBrandDetailsTo(boxID,defaultHeight,div.offsetHeight,'DOWN',step);
			document.getElementById('GuidedNavigationDetailsFooter').className='LessInfo';
		}
		else
		{
			slideBrandDetailsTo(boxID,div.offsetHeight,defaultHeight,'UP',step);
			document.getElementById('GuidedNavigationDetailsFooter').className='MoreInfo';
		}
	}
}
function toggleHomeDetails(boxID,divID,defaultHeight,step)
{ 
	if(typeof(divID) == 'undefined' || typeof(boxID) == 'undefined') 
	{ 
		return false; 
	}        
	else 
	{ 
		var box = document.getElementById(boxID); 
		var div = document.getElementById(divID);
		//in welche Richtung? hoch- oder runtersliden?
		if(box.offsetHeight < div.offsetHeight)
		{
			slideBrandDetailsTo(boxID,defaultHeight,div.offsetHeight,'DOWN',step);
			document.getElementById('home_details_footer').className='footerUP_HOME';
		}
		else 
		{ 
			slideBrandDetailsTo(boxID,div.offsetHeight,defaultHeight,'UP',step); 
			document.getElementById('home_details_footer').className='footerDOWN_HOME'; 
		} 
	} 
} 
function toggleBrandDetails(boxID,divID,defaultHeight,step)
{
	if(typeof(divID) == 'undefined' || typeof(boxID) == 'undefined')
	{
		return false;
	}	
	else
	{
		var box = document.getElementById(boxID);
		var div = document.getElementById(divID);
		
		//in welche Richtung? hoch- oder runtersliden?
		if(box.offsetHeight < div.offsetHeight)
		{
			slideBrandDetailsTo(boxID,defaultHeight,div.offsetHeight,'DOWN',step);
			document.getElementById('brand_details_footer').className='footerUP';
		}
		else
		{
			slideBrandDetailsTo(boxID,div.offsetHeight,defaultHeight,'UP',step);
			document.getElementById('brand_details_footer').className='footerDOWN';
		}
	}
}
function toggleMoreInfoDetails(boxID,divID,defaultHeight,step)
{
	if(typeof(divID) == 'undefined' || typeof(boxID) == 'undefined')
		return false;
	else
	{
		var box = document.getElementById(boxID);
		var div = document.getElementById(divID);		
		//in welche Richtung? hoch- oder runtersliden?
		if(box.offsetHeight < div.offsetHeight)
		{
			slideBrandDetailsTo(boxID,defaultHeight,div.offsetHeight,'DOWN',step);
			document.getElementById('GuidedNavMoreInfoFooter').className='footerUP';
		}
		else
		{
			slideBrandDetailsTo(boxID,div.offsetHeight,defaultHeight,'UP',step);
			document.getElementById('GuidedNavMoreInfoFooter').className='footerDOWN';
		}
	}
}


function showNLLayer()
{
	var NaviTable = document.getElementById('NaviTable');
	if(NaviTable)
	{		
		TablePosition = getAbsoluteElementPosition(NaviTable);
		var NLOverlay = document.getElementById('NLOverlay');
		NLOverlay.style.left = TablePosition.x + 190 + "px";
		//NLOverlay.style.display="";	
		NLOverlay.style.visibility='visible';
	} // if(NaviTable)
	else
	{
		var NLOverlay = document.getElementById('NLOverlay');
		NLOverlay.style.visibility='visible';
	}
} // function moveNLLayer()

function ShowHinweis()
{
	var BestellsPassendSize = document.getElementById('BestellsPassendSize');
	if (BestellsPassendSize)
	{
		DivPosition = getAbsoluteElementPosition(BestellsPassendSize);
		var Hinweis = document.getElementById('Hinweis');
		
		Hinweis.style.left = DivPosition.x - 10 + "px";
		Hinweis.style.top = DivPosition.y - 55 + "px";
		Hinweis.style.display='';
	} // if (BestellsPassendSize)
} // function ShowHinweis()

function showNLSaleLayer()
{
	var NaviTable = document.getElementById('NaviTable');
	if(NaviTable)
	{		
		TablePosition = getAbsoluteElementPosition(NaviTable);
		var NLOverlay = document.getElementById('NLOverlay');
		NLOverlay.style.left = TablePosition.x + 150 + "px";
		NLOverlay.style.display="";
		NLOverlay.style.visibility='visible';
	} // if(NaviTable)
} // function moveNLLayer()

function openLevisClipPopup()
{
	var width=320;
	var height=240;
	var url='http://www.ffmtower.de/frontline/';
	var name='LevisClip';
	newwindow=window.open(url, name, 'width=' + width + ',height=' + height + ',location=no,menubar=no,resizable=yes,status=no,toolbar=no,top=100,left=100');
	newwindow.focus();
	
} // function openLevisClipPopup()

function openLevisClipPopup2()
{
	var width=320;
	var height=240;
	var url='http://www.ffmtower.de/secrets/';
	var name='LevisClip';
	newwindow=window.open(url, name, 'width=' + width + ',height=' + height + ',location=no,menubar=no,resizable=yes,status=no,toolbar=no,top=100,left=100');
	newwindow.focus();
	
} // function openLevisClipPopup2()

function trim (zeichenkette) 
{
	// Erst führende, dann Abschließende Whitespaces entfernen
	// und das Ergebnis dieser Operationen zurückliefern
	return zeichenkette.replace (/^\s+/, '').replace (/\s+$/, '');
} // function trim (zeichenkette)

function checkNewsLetterForm(msg)
{
	var mailEl = document.getElementById('RegisterNewsLetterEmail');
	
	if(
		document.getElementById('RegisterNewsLetterMen').checked != true 
		&& 
		document.getElementById('RegisterNewsLetterWomen').checked != true
		)
	{
		alert(msg);
		return false;
	}
	else if(! mailEl.value.match('^[-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*@[-a-zA-Z0-9]+(\.[-a-zA-Z0-9]+)*\.([a-zA-Z]{2,4})$'))
	{
		alert('Bitte gib eine gültige Email-Adresse ein!');
		return false;
	}
		
		return true;
} // function checkNewsLetterForm()

function checkEmailAddr(NLElement)
{
	if (NLElement)
		var mailEl = document.getElementById(NLElement);
	else
		var mailEl = document.getElementById('NewsletterEmail');
	
	if (NLElement)
	{
		if (NLElement == 'NewsletterEmail')
		{	
			var gender = document.NewsletterReg.gender;
			
			if(gender)
			{	
				if (gender.value != '0' && gender.value != '1')
				{	
					alert('Bitte wähle ein Geschlecht aus!');
					return false;
				} // if (gender.value != '0' && gender.value != '1')
			} // if(gender)
		} // if (NLElement == 'NewsletterEmail')
	} // if (NLElement)
	
	if(! mailEl.value.match('^[-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*@[-a-zA-Z0-9]+(\.[-a-zA-Z0-9]+)*\.([a-zA-Z]{2,4})$'))
	{
		alert('Bitte gib eine gueltige Email-Adresse ein!');
		return false;
	}
	else	
		return true;
} // function checkEmailAddr()


function valButton() 
{
}	
	
function checkNewsLetterOptout(msg)
{
	if (document.getElementById('r1').checked == true || document.getElementById('r2').checked == true || document.getElementById('r3').checked == true || document.getElementById('r4').checked == true)
    	return true;
    else
    {
    	alert(msg);
    	return false;
    }
} // function checkNewsLetterOptout()

function changeGiveAways(tnid, image)
{
	var AJAX_URL = base_url+'/index.php?screen=aj.request&task=getBinary&tnid='+tnid;
	
	jQuery.ajax(
	{
		type: "GET",
		url: AJAX_URL,
		success: function (msg)
		{
			var data = eval('('+msg+')'); 
				
			if(location.href.indexOf('https://') == 0)
			{
				var IMG_URL = 'https://www.frontlineshop.com/gateTools/scripts/binary.php?BinaryCodeID='+data.BINARYCODEID;
				var IMG_URL2 = 'https://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/nopic/uebersicht_gross.gif';
			}
			else
			{
				var IMG_URL = 'http://www.frontlineshop.com/gateTools/scripts/binary.php?BinaryCodeID='+data.BINARYCODEID;
				var IMG_URL2 = 'http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/nopic/uebersicht_gross.gif';
			}
			
			if (data.MESSAGE == "OK")
			{
				ImageElement = document.getElementById(image);
				ImageElement.src=IMG_URL;
			}
			else
			{
				ImageElement = document.getElementById(image);
				ImageElement.src=IMG_URL2;
			} // else [if ($data.MESSAGE == "OK")]
		} // onSuccess: function(transport)
	});
} // function changeGiveAways(tnid, image)

function changeGiveAwayView(ImageElement,GiveAwayIndex,GiveAwayItemIndex,prevOrNext)
{
	GiveAwayTreeNodeIDElements = jQuery('form[name="GiveAwayForm'+GiveAwayIndex+'"] :input[name^="GiveAwayTreeNodeID"]');
	TreeOrVariantTreeNodeID = GiveAwayTreeNodeIDElements[GiveAwayItemIndex].value;
	if(GiveAwayViewBinaryCodeIDs['view'+TreeOrVariantTreeNodeID].length == 1)
		GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID] = 0;
	else
	{
		if(prevOrNext == 'next')
			if(GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID] == GiveAwayViewBinaryCodeIDs['view'+TreeOrVariantTreeNodeID].length -1)
				GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID] = 0;
			else	
				GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID] = GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID]+1;
		else
			if(GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID] == 0)
				GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID] = GiveAwayViewBinaryCodeIDs['view'+TreeOrVariantTreeNodeID].length -1;
			else
				GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID] = GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID]-1;
	}
	NewBinaryCodeID = GiveAwayViewBinaryCodeIDs['view'+TreeOrVariantTreeNodeID][GiveAwayViewIndex['view'+TreeOrVariantTreeNodeID]];
	ImageElement = document.getElementById('Image'+ImageElement);
    ImageElement.src=base_url+'/gateTools/scripts/binary.php?BinaryCodeID='+NewBinaryCodeID;
}
function showGiveAwayButtons(PrevNextID,e) {
	jQuery("#"+PrevNextID+" .imageButtons").css("display","block");
}
function hideGiveAwayButtons(PrevNextID,e) {
	//weil mouseout mehrfach gefeuert wird, darf das ausblenden nur dann geschehen
	//wenn das relevante Element verlassen wird, wenn die ID in den Vorgänger des
	//Ziel-Elementes nicht auftaucht, dann wurde es auch tatsächlich verlassen
	var relTG = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	while(relTG.nodeName != 'BODY')
	{
		if(relTG.id && relTG.id == PrevNextID)
			return;
		relTG = relTG.parentNode;	
	}
	jQuery("#"+PrevNextID+" .imageButtons").css("display","none");
	return;
}


function changePic(identifier, forward, newLink)
{
	if (forward)
		if (Indexes[identifier] == (BinaryCodeIDs[identifier].length - 1))
			Indexes[identifier] = 0;
		else
			Indexes[identifier] = Indexes[identifier] + 1;
	else
		if (Indexes[identifier] == 0)
			Indexes[identifier] = (BinaryCodeIDs[identifier].length - 1);
		else
			Indexes[identifier] = Indexes[identifier] - 1;
	
	// Bild wechseln
	var el = document.all ? document.all[identifier] : document.getElementById(identifier);
	el.style.backgroundImage = 'url('+base_url+'/gateTools/scripts/binary.php?BinaryCodeID=' + BinaryCodeIDs[identifier][Indexes[identifier]] + ')';
	
	// Verlinkung wechseln
	var el = document.all ? document.all['link_' + identifier] : document.getElementById('link_' + identifier);
	el.href = newLink + '&VariantTreeNodeID=' + TreeNodeIDs[identifier][Indexes[identifier]];
	var el = document.all ? document.all['link2_' + identifier] : document.getElementById('link2_' + identifier);
	if( el ) {
		el.href = newLink + '&VariantTreeNodeID=' + TreeNodeIDs[identifier][Indexes[identifier]];
	}
} // function changePic

function changeAjaxPic(identifier, forward, newLink, page, pid)
{
	if (forward)
		if (Indexes[identifier] == (BinaryCodeIDs[identifier].length - 1))
			Indexes[identifier] = 0;
		else
			Indexes[identifier] = Indexes[identifier] + 1;
	else
		if (Indexes[identifier] == 0)
			Indexes[identifier] = (BinaryCodeIDs[identifier].length - 1);
		else
			Indexes[identifier] = Indexes[identifier] - 1;
	
	// Bild wechseln
	var el = document.all ? document.all[identifier] : document.getElementById(identifier);
	el.style.backgroundImage = 'url(http://www.frontlineshop.com/gateTools/scripts/binary.php?BinaryCodeID=' + BinaryCodeIDs[identifier][Indexes[identifier]] + ')';
	
	// Verlinkung wechseln
	var el = document.all ? document.all['link_' + identifier] : document.getElementById('link_' + identifier);
	el.href = newLink + ',' + '\''+ TreeNodeIDs[identifier][Indexes[identifier]]+'\',\''+page+'\',\''+pid+'\')';

	var el = document.all ? document.all['link2_' + identifier] : document.getElementById('link2_' + identifier);
	el.href = newLink + ',' + '\'' + TreeNodeIDs[identifier][Indexes[identifier]]+'\',\''+page+'\',\''+pid+'\')';
} // function changeAjaxPic

function OpenWindow(url, name, width, height)
{
	window.open(url, name, 'width=' + width + ',height=' + height + ',location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,top=100,left=100');
} // function OpenWindow

function OpenPopup(url, name, width, height, scrollbars)
{
	newwindow=window.open(url, name, 'width=' + width + ',height=' + height + ',location=no,menubar=no,resizable=yes,scrollbars=' + scrollbars +',status=no,toolbar=no,top=100,left=100');
	newwindow.focus();
} // function OpenWindow

function LoadOpener(url)
{
	window.opener.location.href=url;
}

function CloseWindow()
{
	window.close();
}

function OpenCatalogPopup(url, name, width, height, scrollbars)
{
	newwindow = window.open('', name, 'width=' + width + ',height=' + height + ',location=no,menubar=no,resizable=yes,scrollbars=' + scrollbars +',status=no,toolbar=no,top=100,left=100');
	
	if (newwindow.location.href == 'about:blank' || newwindow.location.href.indexOf('TreeNodeID') > 0 || newwindow.location.href.indexOf('oc.home') > 0 || newwindow.location.href.indexOf('tr.catalog') > 0)
	{
		newwindow=window.open(url, name, 'width=' + width + ',height=' + height + ',location=no,menubar=no,resizable=yes,scrollbars=' + scrollbars +',status=no,toolbar=no,top=100,left=100');
		newwindow.focus();
	}
	else
	{
		newwindow.focus();
	}
	
} // function OpenCatalogPopup

function changeDisplay(the_div)
{
	if(this.document.getElementById(the_div).style.display == 'none')
		this.document.getElementById(the_div).style.display = 'inline';
	else
		this.document.getElementById(the_div).style.display = 'none';
} // function changeDisplay

function changeVisibility(element_id)
{
	if (this.document.getElementById(element_id).style.visibility == 'hidden')
	{
		this.document.getElementById(element_id).style.visibility = 'visible';
	}
	else
	{
		this.document.getElementById(element_id).style.visibility = 'hidden';
	}
} // function changeVisibility

function SwitchImage(ImageElementName,BinaryCodeID,BCVID)
{
	if (document.getElementById(ImageElementName))
	{
		document.getElementById(ImageElementName).src=base_url+'/gateTools/scripts/binary.php?BCVID='+BCVID+'&BinaryCodeID='+BinaryCodeID;
	}
} // function SwitchImage(ImageElementName,BinaryCodeID,BCVID)

function ModifyTask()
{
	this.document.fd_PersonDataWinzone.task.value='NewCode';
	this.document.fd_PersonDataWinzone.submit();
} // function ModifyTask()=======

function showShop(turl){
	if(!opener){
		 window.open(turl, 'main','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	} else{
		opener.location.href=turl;
		opener.focus();
	}
}

function focusShop(turl){
	if(!opener){
		window.open(turl, 'main','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
	} else{
		opener.focus();
	}
}

function scrolldown(the_div, divheight, LocaleString) 
{
	var tag;
	var ScrollLink = document.getElementById('ScrollLink');
	
	if (typeof(LocaleString) == 'undefined')
		var LocaleString = 'de_DE';
 
 	if(Helper[the_div]["Counter"] < divheight) 
  	{
  
		Helper[the_div]["working"] = 1;
		Helper[the_div]["Counter"]++;
		Helper[the_div]["Counter"]++;
		
		if (ScrollLink)
		{		
			Helper[the_div]["Counter"]++;
			Helper[the_div]["Counter"]++;
			Helper[the_div]["Counter"]++;
			Helper[the_div]["Counter"]++;
			Helper[the_div]["Counter"]++;
			Helper[the_div]["Counter"]++;
			Helper[the_div]["Counter"]++;
			Helper[the_div]["Counter"]++;
		} // if (ScrollLink)			
		
		document.getElementById(the_div).style.height = Helper[the_div]["Counter"]+'px'; 
		tag = "scrolldown('"+the_div+"','"+divheight+"','"+LocaleString+"')";
		aktiv = window.setTimeout(tag,1); 
  	}
  	else
  	{
		Helper[the_div]["working"] = 0;

		if (ScrollLink)
			ScrollLink.innerHTML = '<img src="http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/wenigerBrands.gif" onMouseOver="this.src=\'http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/wenigerBrands_rollover.gif\';" onMouseOut="this.src=\'http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/wenigerBrands.gif\';">';	
  	} // if(Helper[the_div]["Counter"] < divheight) 
} // function scrolldown(the_div, divheight) 

function scrollup(the_div, LocaleString) 
{ 
	var tag;
	var ScrollLink = document.getElementById('ScrollLink');
	
	if (typeof(LocaleString) == 'undefined')
		var LocaleString = 'de_DE';
		
 	if(Helper[the_div]["Counter"] > 1) 
  	{
		Helper[the_div]["working"] = 1;
		Helper[the_div]["Counter"] = (Helper[the_div]["Counter"]-2);
		
		if (ScrollLink && isMoz)
			Helper[the_div]["Counter"] = (Helper[the_div]["Counter"]-5000);
		else if (ScrollLink)
			Helper[the_div]["Counter"] = (Helper[the_div]["Counter"]-8);
		
		// Sicherstellen das die Höhe niemals geringer als 0 ist
		if (Helper[the_div]["Counter"] < 0)
			Helper[the_div]["Counter"] = 0;
		
		// Wenn noch nicht ganz eingeklappt, dann weiter einklappen
		if (Helper[the_div]["Counter"] > 0)
		{
			document.getElementById(the_div).style.height = Helper[the_div]["Counter"]+'px';
			tag = "scrollup('"+the_div+"','"+LocaleString+"')";
			aktiv = window.setTimeout(tag,1); 
		}
		else // Beenden des Einklappens weil die Höhe schon 0 ist
		{
			Helper[the_div]["working"] = 0;
			
			// Zur Sicherheit wieder zurück auf die Ursprungshöhe
			document.getElementById(the_div).style.height = '1px';
		
			// Nach dem Einklappen der Liste die Linkbezeichnung oder Grafik austauschen
			if (ScrollLink)
				ScrollLink.innerHTML = '<img src="http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/AlleBrands.gif" onMouseOver="this.src=\'http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/AlleBrands_rollover.gif\';" onMouseOut="this.src=\'http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/AlleBrands.gif\';">';	
		} // else [if (Helper[the_div]["Counter"] > 0)]
	}
  	else
  	{
		Helper[the_div]["working"] = 0;
		
		if (ScrollLink)
			ScrollLink.innerHTML = '<img src="http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/AlleBrands.gif" onMouseOver="this.src=\'http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/AlleBrands_rollover.gif\';" onMouseOut="this.src=\'http://www.frontlineshop.com/customGates/resources/binaries/'+LocaleString+'/special/reiter/AlleBrands.gif\';">';	
  	} // else [if(Helper[the_div]["Counter"] > 1) ]
} // function scrollup(the_div)  

function changeBrandScroll(the_div, length, LocaleString)
{
	var ScrollUpFlag = false;
	
	if (typeof(LocaleString) == 'undefined')
		var LocaleString = 'de_DE';

	// br.home übergibt keine length da statisch
	if (typeof(length) == 'undefined')
	{
		var length = 10;
		var divheight = 30;
	} // if (typeof(length) == 'undefined')
	else
	{
		// 17 Pixel Länge * Anzahl der verdeckten Brands (passt ungefähr)
		var divheight = length * 17.1;
		
		// Wenn nicht br.home (fixe Größe) dann auch wieder "zurückscrollen" zulassen
		ScrollUpFlag = true;
	} // else [if (typeof(length) == 'undefined')]

	if (!Helper[the_div])
	{
		Helper[the_div] = new Array();
		Helper[the_div]["Counter"] = 0;
		Helper[the_div]["working"] = 0;
	} // if (!Helper[the_div])

	if (Helper[the_div]["working"] == 0 && Helper[the_div]["Counter"] < divheight)
	{
		scrolldown(the_div, divheight, LocaleString);
	} // if (Helper[the_div]["working"] == 0 && Helper[the_div]["Counter"] < divheight)
	else if (Helper[the_div]["working"] == 0 && Helper[the_div]["Counter"] > length)
	{
		if (ScrollUpFlag == true)
			scrollup(the_div, LocaleString);
	} // else if (Helper[the_div]["working"] == 0 && Helper[the_div]["Counter"] > length)
	
} // function changeBrandScroll



function slideBrandDetailsTo(boxID, tmpHeight, targetHeight, direction, step)
{
	step = parseInt(step);
	tmpHeight = parseInt(tmpHeight);
	targetHeight = parseInt(targetHeight);
	if(direction == 'DOWN')
	{
		if(tmpHeight <= targetHeight)
		{
			var newHeight = tmpHeight + step;
			document.getElementById(boxID).style.height = newHeight+'px';
			aktiv = window.setTimeout("slideBrandDetailsTo('"+boxID+"','"+newHeight+"','"+targetHeight+"','"+direction+"','"+step+"')",1);
		}
	}
	else if(direction == 'UP')
	{
		if((tmpHeight-step) > targetHeight)
		{
			var newHeight = tmpHeight - step;
			document.getElementById(boxID).style.height = newHeight+'px';
			aktiv = window.setTimeout("slideBrandDetailsTo('"+boxID+"','"+newHeight+"','"+targetHeight+"','"+direction+"','"+step+"')",1);
		}
		else
			document.getElementById(boxID).style.height = targetHeight+'px';
	}
}



/**
*
* URL encode / decode
* http://www.webtoolkit.info/
*
**/

var Url = {

    // public method for url encoding
    encode : function (string) {
        return escape(this._utf8_encode(string));
    },

    // public method for url decoding
    decode : function (string) {
        return this._utf8_decode(unescape(string));
    },

    // private method for UTF-8 encoding
    _utf8_encode : function (string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    },

    // private method for UTF-8 decoding
    _utf8_decode : function (utftext) {
        var string = "";
        var i = 0;
        var c = c1 = c2 = 0;

        while ( i < utftext.length ) {

            c = utftext.charCodeAt(i);

            if (c < 128) {
                string += String.fromCharCode(c);
                i++;
            }
            else if((c > 191) && (c < 224)) {
                c2 = utftext.charCodeAt(i+1);
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                i += 2;
            }
            else {
                c2 = utftext.charCodeAt(i+1);
                c3 = utftext.charCodeAt(i+2);
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                i += 3;
            }

        }

        return string;
    }

};

function getAbsoluteElementPosition(element)
{
	var elem=element,tagname="",x=0,y=0;

	while (elem != null && (typeof(elem)=="object")&&(typeof(elem.tagName)!="undefined"))
	{
		y+=elem.offsetTop;     /* Offset des jeweiligen Elements addieren */
		x+=elem.offsetLeft;    /* Offset des jeweiligen Elements addieren */
		tagname=elem.tagName.toUpperCase(); /* tag-Name ermitteln, Grossbuchstaben */
		
		if ((tagname=="BODY") || (dialog.dialog("isOpen")))
			elem=0;

		if (typeof(elem)=="object")
			if (typeof(elem.offsetParent)=="object")
				elem=elem.offsetParent;
	}
	position=new Object();
	position.x=x;
	position.y=y;
	
	return position;
} // function getAbsoluteElementPosition(element)
		
function pageOffset(win)
{
    if(!win) win = window;
    var pos = {left:0,top:0};

    if(typeof win.pageXOffset != 'undefined')
    {
         // Mozilla/Netscape
         pos.left = win.pageXOffset;
         pos.top = win.pageYOffset;
    }
    else
    {
         var obj = (win.document.compatMode && win.document.compatMode == "CSS1Compat") ?
         win.document.documentElement : win.document.body || null;

         pos.left = obj.scrollLeft;
         pos.top = obj.scrollTop;
    }
    return pos;
}

function subscribeNewsletter()
{
	var Email = document.getElementById('emailNL').value;
	var Gender = getValueRadio('GenderNL');
	
	if (document.getElementById('PromoCode'))
		var PromoCode = document.getElementById('PromoCode').value;
	else
		var PromoCode = '';
	
	if (Gender == '' || Gender == null)
	{
		// evtl. nicht per Radio-Button, sondern per hidden-Field und onclick-value
		if (document.getElementById('GenderNL'))
			var Gender = document.getElementById('GenderNL').value;
		else
		{
			alert('Bitte Geschlecht auswählen!');
			return false;
		}
	}
	if (Email == '')
	{
		alert('Bitte Email-Adresse angeben!');
		return false;
	}

	var modus = 'EL';
	
	jQuery.ajax(
	{
		type: "GET",
		url: base_url+'/index.php?screen=nl.register&modus='+modus+'&gender='+Gender+'&email='+Email+'&task=register_first&Ajax=1&PromoCode='+PromoCode,
		success: function (msg)
		{
			var data = eval('('+msg+')'); 	
	
			if (data.MESSAGE == 'OK')
			{
				//document.getElementById('NLHeadline').innerHTML = unescape(data.CONTENT);
				//document.getElementById('NLText').style.display='none';
				//document.getElementById('NLWelcome').style.display='none';
				//Omniture
				s.hier1 += '/Ajax Newsletter';	//Hierachie ergänzen
				s.events = 'event9';	//Register Event
				s.prop4 += ' Ajax Newsletter Registration';	//Pagename ergänzen
				s.t();
				document.location.href=base_url+'/index.php?screen=nl.register&email='+Email+'&task=confirm';
			}
			else
			{
				document.getElementById('NLHeadline').innerHTML = unescape(data.HEADLINE);
				document.getElementById('NLText').innerHTML = unescape(data.CONTENT);
				document.getElementById('NLWelcome').style.display='none';
			}
		} // onSuccess: function(transport)
	});						
} // function subscribeNewsletter()

function subscribeItemNewsletter()
{
	// Funktion für NL-Registrierung auf der ProductPage
	var Email = document.getElementById('emailNL').value;

	var Gender = getValueRadio('GenderNL');
	
	if (document.getElementById('PromoCode'))
		var PromoCode = document.getElementById('PromoCode').value;
	else
		var PromoCode = '';

	var modus = 'EL';

	if (document.getElementById('gclid'))
	{
		var gclid = document.getElementById('gclid').value;
		if (gclid != '')
			PromoCode = 'Google SEM';
	}

	if (document.getElementById('OVRAW'))
	{
		var OVRAW = document.getElementById('OVRAW').value;
		if (OVRAW != '')
			PromoCode = 'Yahoo SEM';
	}
	
	if (Gender == '' || Gender == null)
	{
		alert('Bitte Geschlecht auswählen!');
		return false;
	}
	
	if (Email == '')
	{
		alert('Bitte Email-Adresse angeben!');
		return false;
	}

	jQuery.ajax(
	{
		type: "GET",
		url: base_url+'/index.php?screen=nl.register&modus='+modus+'&gender='+Gender+'&email='+Email+'&task=register_first&Ajax=1&PromoCode='+PromoCode,
		success: function (msg)
		{
			var data = eval('('+msg+')'); 	
			if (data.MESSAGE == 'OK')
			{
				//Omniture
				s.hier1 += '/Ajax Newsletter';	//Hierachie ergänzen
				s.events = 'event9';	//Register Event
				s.prop4 += ' Ajax Newsletter Registration';	//Pagename ergänzen
				s.t();
				document.location.href=base_url+'/index.php?screen=nl.register&email='+Email+'&task=confirm';
			}
			else
			{
				alert(unescape(data.ALERTBOX));
			}
		} // onSuccess: function(transport)
	});					
} // function subscribeNewsletter()


function subscribeNewsletterPayPal()
{
	var Email = document.getElementById('emailNL').value;
	var Gender = getValueRadio('GenderNL');
	
	var modus = 'EL';	
	
	if (Gender == '' || Gender == null)
	{
		// evtl. nicht per Radio-Button, sondern per hidden-Field und onclick-value
		if (document.getElementById('GenderNL'))
			var Gender = document.getElementById('GenderNL').value;
		else
		{
			alert('Bitte Geschlecht auswählen!');
			return false;
		}
	}
	
	if (Email == '')
	{
		alert('Bitte Email-Adresse angeben!');
		return false;
	}

	jQuery.ajax(
	{
		type: "GET",
		url: base_url+'/index.php?screen=nl.register&modus='+modus+'&gender='+Gender+'&email='+Email+'&task=register_first&Ajax=1&PayPal=1',
		success: function (msg)
		{
			var data = eval('('+msg+')'); 	
				
			if (data.MESSAGE == 'OK')
			{
				//Omniture
				s.hier1 += '/Ajax Newsletter Paypal';	//Hierachie ergänzen
				s.events = 'event9';	//Register Event
				s.prop4 += ' Ajax Newsletter Registration Paypal';	//Pagename ergänzen
				s.t();
				document.location.href=base_url+'/index.php?screen=nl.register&email='+Email+'&task=confirm';
			}
			else
			{
				document.getElementById('NLHeadline').innerHTML = unescape(data.HEADLINE);
				document.getElementById('NLText').innerHTML = unescape(data.CONTENT);
				document.getElementById('NLWelcome').style.display='none';
				document.getElementById('NLdabei').style.display='none';
				document.getElementById('NLInput').style.display='none';
				document.getElementById('NLabsenden').style.display='none';
				document.getElementById('NLLogo').style.display='none';
			}
		} // onSuccess: function(transport)
	});						
} // function subscribeNewsletter()

function ShowDetailsLayer(ScreenArea, TreeNodeID)
{
	jQuery.ajax(
	{
		type: "GET",
		url: base_url+'/index.php?screen='+ScreenArea+'.layerdetails&tnid='+TreeNodeID,
		success: function (msg)
		{
			var responseArray = msg.split("{");

			dialog.html(responseArray[0]);
			dialog.dialog({width:370});
			dialog.dialog('open');
			dialog.dialog("option", "position", "center");

			var JasonContent = '{'+responseArray[1];
			var data = eval('('+JasonContent+')'); 
			
			if (data.MESSAGE == 'OK')
			{	
				//Omniture
				var s=s_gi(s_account);
				s.linkTrackVars = 'products,hier1,events,eVar15';
				s.linkTrackEvents = 'prodView,event3,event15';
				s.events = 'prodView,event3,event15'; //Events für Produktansichtszoom
				s.hier1 = unescape(data.SHIER1);
				s.eVar15 = unescape(data.SEVAR15);
				s.tl(this, 'o'); //es sollen nur Teile getracked werden als Custom Link ('o')
			}
		} // onSuccess: function(transport)
	});
} // function ShowDetailsLayer(ScreenArea, TreeNodeID)

function getValueRadio(name) 
{ 
	// Liefert den Value eines Radio-Buttons zurueck
    var arrEl, i, el; 
    arrEl = document.getElementsByName(name); 
    for (i = 0; i < arrEl.length; i++) 
    { 
        el = arrEl[i]; 
        if (el.checked == true) return el.value; 
    }; 
    return null; 
} 

function init_mousemove() 
{
	if(document.layers)
	{
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove =	dpl_mouse_pos;
} // function init_mousemove()

function dpl_mouse_pos(e) 
{
    // position where mousemove fired
    //
    var xPos    =  e? e.pageX : window.event.x;
    var yPos    =  e? e.pageY : window.event.y;
    
	position.yy=yPos;
    
    // for ie add scroll position
    if (document.all && !document.captureEvents) 
    {
        xPos    += document[docEl].scrollLeft;
        yPos    += document[docEl].scrollTop;
    } // if (document.all && !document.captureEvents)
    else
	    position.yy = (yPos - window.pageYOffset);
	    
    // display position
    //
	position.x=xPos;
	position.y=yPos;

    if (document.layers)
    { 
    	routeEvent(e);
    }
} // function dpl_mouse_pos(e) 

function linkHandler(Gender)
{
	if (Gender == 'Men')
	{
		if (position.x > 63 && position.y > 360 && position.x < 226 && position.y < 490)
		{
			document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs2_men.jpg';
			if ((oldx < 63 && oldy < 360) || (oldx > 226 && oldy > 490))
			{
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';
				document.body.style.cursor="pointer";
				
				oldx = position.x;
				oldy = position.y;
			}			
		}
		else if (position.x > 300 && position.y > 365 && position.x < 368 && position.y < 440)
		{
			document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts2_men.jpg';
			if ((oldx < 300 && oldy < 365) || (oldx > 368 && oldy > 440))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';
				document.body.style.cursor="pointer";
	
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 448 && position.y > 332 && position.x < 675 && position.y < 507)
		{
			document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen2_men.jpg';
			if ((oldx < 448 && oldy < 332) || (oldx > 675 && oldy > 507))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';			
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 297 && position.y > 470 && position.x < 364 && position.y < 565)
		{
			document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones2_men.jpg';
			if ((oldx < 297 && oldy < 470) || (oldx > 364 && oldy > 565))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 54 && position.y > 575 && position.x < 167 && position.y < 705)
		{
			document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies2_men.jpg';
			if ((oldx < 54 && oldy < 575) || (oldx > 167 && oldy > 705))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 209 && position.y > 575 && position.x < 263 && position.y < 705)
		{
			document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren2_men.jpg';
			if ((oldx < 209 && oldy < 575) || (oldx > 263 && oldy > 705))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 307 && position.y > 590 && position.x < 427 && position.y < 700)
		{
			document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves2_men.jpg';
			if ((oldx < 307 && oldy < 590) || (oldx > 427 && oldy > 700))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';			
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 457 && position.y > 520 && position.x < 746 && position.y < 705)
		{
			document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear2_men.jpg';			
			if ((oldx < 457 && oldy < 520) || (oldx > 746 && oldy > 705))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else
		{
			if (oldx > 0 && oldy > 0)
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_men.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_men.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_men.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_men.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_men.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_men.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_men.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/underwear1_men.jpg';			
				document.body.style.cursor="";
				oldx=0;
				oldy=0;
			} // if (oldx > 0 && oldy > 0)
		} // else
	} // if (Gender == 'Men')

	if (Gender == 'Women')
	{
		if (position.x > 53 && position.y > 323 && position.x < 293 && position.y < 484)
		{
			// Taschen
			document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen2_women.jpg';
			if ((oldx < 53 && oldy < 323) || (oldx > 293 && oldy > 484))
			{
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="pointer";
				
				oldx = position.x;
				oldy = position.y;
			}			
		}
		else if (position.x > 436 && position.y > 321 && position.x < 546 && position.y < 517)
		{
			// Schals
			document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs2_women.jpg';
			if ((oldx < 436 && oldy < 321) || (oldx > 546 && oldy > 517))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="pointer";
	
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 620 && position.y > 350 && position.x < 741 && position.y < 442)
		{
			// Muetzen
			document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies2_women.jpg';
			if ((oldx < 620 && oldy < 350) || (oldx > 741 && oldy > 442))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 127 && position.y > 528 && position.x < 270 && position.y < 567)
		{
			// Uhren
			document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren2_women.jpg';
			if ((oldx < 127 && oldy < 528) || (oldx > 270 && oldy > 567))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 611 && position.y > 465 && position.x < 747 && position.y < 524)
		{
			// Gürtel
			document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts2_women.jpg';
			if ((oldx < 611 && oldy < 465) || (oldx > 747 && oldy > 524))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 115 && position.y > 581 && position.x < 269 && position.y < 672)
		{
			// Headphones
			document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones2_women.jpg';
			if ((oldx < 115 && oldy < 581) || (oldx > 269 && oldy > 672))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 361 && position.y > 585 && position.x < 472 && position.y < 680)
		{
			//Schmuck
			document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck2_women.jpg';
			if ((oldx < 361 && oldy < 585) || (oldx > 472 && oldy > 680))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else if (position.x > 541 && position.y > 560 && position.x < 733 && position.y < 701)
		{
			// Gloves
			document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves2_women.jpg';
			if ((oldx < 541 && oldy < 560) || (oldx > 733 && oldy > 701))
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.body.style.cursor="pointer";
				oldx = position.x;
				oldy = position.y;
			}
		}
		else
		{
			if (oldx > 0 && oldy > 0)
			{
				document.getElementById('Img1').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/taschen1_women.jpg';
				document.getElementById('Img2').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/scarfs1_women.jpg';
				document.getElementById('Img3').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/beanies1_women.jpg';
				document.getElementById('Img4').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/uhren1_women.jpg';
				document.getElementById('Img5').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/belts1_women.jpg';
				document.getElementById('Img6').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/headphones1_women.jpg';
				document.getElementById('Img7').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/schmuck1_women.jpg';
				document.getElementById('Img8').src='http://www.frontlineshop.com/customGates/resources/binaries/de_DE/special/xmas09/gloves1_women.jpg';
				document.body.style.cursor="";
				oldx=0;
				oldy=0;
			} // if (oldx > 0 && oldy > 0)
		} // else
	} // if (Gender == 'Women')


} // function linkHandler(Gender)

function linkClicked(Gender)
{
	if (Gender == 'Men')
	{

		if (position.x > 63 && position.y > 365 && position.x < 226 && position.y < 495)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=m0200&filter_id[]=146&filter_value[]=Scarfs&SortCriteria=top";
		else if (position.x > 300 && position.y > 369 && position.x < 368 && position.y < 445)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=m0200&filter_id[]=146&filter_value[]=Belt&SortCriteria=top";
		else if (position.x > 448 && position.y > 337 && position.x < 675 && position.y < 512)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=m0300&SortCriteria=top";
		else if (position.x > 297 && position.y > 473 && position.x < 453 && position.y < 570)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=m0270&SortCriteria=top&SortCriteria=top";
		else if (position.x > 54 && position.y > 577 && position.x < 167 && position.y < 708)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=m0200&filter_id[]=146&filter_value[]=Beanie&SortCriteria=top";
		else if (position.x > 209 && position.y > 577 && position.x < 263 && position.y < 710)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&SortCriteria=top&PageSize=128&filter_id[]=179&filter_value[]=m0240&action=insert&ClassName=Filter&SortCriteria=top";
		else if (position.x > 307 && position.y > 593 && position.x < 427 && position.y < 703)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=m0200&filter_id[]=146&filter_value[]=Gloves&SortCriteria=top";
		else if (position.x > 457 && position.y > 522 && position.x < 746 && position.y < 708)
			document.location.href="http://www.frontlineshop.com/index.php?screen=me.category&PageSize=128&filter_id[]=179&filter_value[]=m0500&action=insert&ClassName=Filter&SortCriteria=top";

	} // if (Gender == 'Men')

	if (Gender == 'Women')
	{
		if (position.x > 53 && position.y > 323 && position.x < 293 && position.y < 484)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0300&SortCriteria=top";
		else if (position.x > 436 && position.y > 321 && position.x < 546 && position.y < 517)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0200&filter_id[]=146&filter_value[]=Scarfs&SortCriteria=top";
		else if (position.x > 620 && position.y > 350 && position.x < 741 && position.y < 442)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0200&filter_id[]=146&filter_value[]=Beanie&SortCriteria=top";
		else if (position.x > 127 && position.y > 528 && position.x < 270 && position.y < 567)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0240&SortCriteria=top";
		else if (position.x > 611 && position.y > 465 && position.x < 747 && position.y < 524)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0200&filter_id[]=146&filter_value[]=Belt&SortCriteria=top";
		else if (position.x > 115 && position.y > 581 && position.x < 269 && position.y < 672)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0270&SortCriteria=top";
		else if (position.x > 361 && position.y > 585 && position.x < 472 && position.y < 680)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0230&SortCriteria=top";
		else if (position.x > 541 && position.y > 560 && position.x < 733 && position.y < 701)
			document.location.href="http://www.frontlineshop.com/index.php?screen=wo.category&PageSize=128&ClassName=Filter&action=insert&ClassName=Filter&filter_id[]=179&filter_value[]=w0200&filter_id[]=146&filter_value[]=Gloves&SortCriteria=top";

	} // if (Gender == 'Women')

} // function linkClicked(Gender)

function CheckNumber(keyvalue)
{
	var field_length = keyvalue.value.length-1;
	var last_key = keyvalue.value.substr(field_length,1);
	
	if (last_key != '0' && last_key != '1' && last_key != '2' && last_key != '3' && last_key != '4' && last_key != '5' && last_key != '6' && last_key != '7' && last_key != '8' && last_key != '9')
		keyvalue.value = keyvalue.value.substr(0,field_length);
} // function CheckNumber(keyvalue)

function ShowVideoLayer(Breite, Hoehe, Top, Left, Url)
{
	var VideoCode = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+Breite+"\" height=\""+Hoehe+"\" id=\"videoplayer\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"movie\" value=\"http://www.frontlineshop.com/customGates/resources/binaries/universal/flash/ftlvideo.swf?showZoomButton=0&amp;repeat=1&amp;InstantStart=1&amp;BufferTime=10&amp;VideoUrl="+Url+"\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#000000\"><param name=\"wmode\" value=\"transparent\"><embed src=\"http://www.frontlineshop.com/customGates/resources/binaries/universal/flash/ftlvideo.swf?showZoomButton=0&amp;repeat=1&amp;InstantStart=1&amp;BufferTime=10&amp;VideoUrl="+Url+"\" quality=\"high\" bgcolor=\"#000000\" width=\""+Breite+"\" height=\""+Hoehe+"\" name=\"videoplayer\" align=\"middle\" allowScriptAccess=\"always\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></object>";
	
		var NaviTable = document.getElementById('NaviTable');
		
		if(NaviTable)
		{		
			TablePosition = getAbsoluteElementPosition(NaviTable);

			var Video = document.getElementById('Video');

			Video.innerHTML = VideoCode;
			Video.style.top = Top+'px';
			Video.style.left = TablePosition.x + Left + "px";
			Video.style.width = Breite+'px';
			Video.style.height = Hoehe+'px';
			Video.style.display = '';
			
			var CButt = document.getElementById('CButt');
			CButt.style.top = (Top+2)+'px';
			CButt.style.left = (TablePosition.x + Left) + (Breite-32)+'px';
			CButt.style.display = '';
		} // if(NaviTable)
}

function checkSearchQuery()
{
	var qpm = document.search_word_inc.query.value;
	if (qpm != '' && qpm != 'Suchbegriff eingeben...') {
		document.search_word_inc.submit();
	}
}

function checkSearchQuery2()
{
	var qpm = document.search_word_inc2.query.value;
	if (qpm != '' && qpm != 'Neue Suche starten?') {
		document.search_word_inc2.submit();
	}
}

function OmnitureOnClickTracking(event,clickType,buttonName)
{
	if(typeof(event) != "undefined" && event != "")
	{
		//unique events nur einmalig pro session tracken, aktuell sind das folgende
		//(event behält seinen Wert oder wird leer sein)
		if(	event == "event26"
			|| event == "event27"
			|| event == "event28"
			|| event == "event29"
			|| event == "event30"
			|| event == "event31"
			|| event == "event34")
			event = s.getValOnce(event, 'sc_'+event, 0);
		//wenn event weiterhin nicht leer ist, dann tracking zulassen
		if(event != "")
		{
			s.linkTrackVars = 'events';
			s.linkTrackEvents = event;
			s.events = event;			
			if(typeof(clickType) == "undefined" 
				|| (clickType != "o" && clickType != "e" && clickType != "d"))
				clickType = "o"; //als default verwenden wir einen "customlink"/Click ("o")
			if(typeof(buttonName) != "undefined" && buttonName != "")
			{
				try
				{
					s.tl(this,clickType,buttonName);
				}catch(e){}
			}	
			else
			{	
				try
				{
					s.tl(this,clickType);
				}catch(e){}
			}
		}
	}
}

function OmnitureAjaxTracking(Values)
{
	//ACHTUNG: Values.trackingType bestimmt auf welche Art getracked wird
	// Wert="micro" s.tl() => z.b bei ButtonClick, i.A. bei Microdaten
	// Wert="macro" s.t()  => z.b bei größen Ajax-Nachlade-Aktion, i.A. bei Veränderungen der Webseite die als neue Page gelten könnten
	//ACHTUNG: atm. wird nur "macro" erlaubt
	
	/****************************************
	 * Keine Werte für
	 * server,state, prop6,prop10,prop11
	 * eVar1,eVar2,eVar7,eVar10,eVar11,eVar17,eVar20,eVar21,eVar30
	 */
	/**************************************************************************
	 * Überschreiben wenn ein Wert vorliegt, sonst den bestehenden übernehmen */
	if(Values.pagename)
		s.pageName = unescape(Values.pagename);
	if(Values.channel)
		s.channel = unescape(Values.channel);
	if(Values.pagetype)
		s.pagetype = unescape(Values.pagetype);
	if(Values.hier1)
		s.hier1 = unescape(Values.hier1);
	if(Values.campaign)
		s.campaign = unescape(Values.campaign);
	if(Values.zip)
		s.zip = unescape(Values.zip);
	if(Values.purchaseID)
		s.purchaseID = unescape(Values.purchaseID);	
	
	/************************************************************************
	 * Überschreiben wenn ein Wert vorliegt, sonst mit "LEER" überschreiben */
	
	//Traffic-Properties
	if(Values.prop1) s.prop1 = unescape(Values.prop1); else s.prop1 = "";
	if(Values.prop2) s.prop2 = unescape(Values.prop2); else s.prop2 = "";
	if(Values.prop3) s.prop3 = unescape(Values.prop3); else s.prop3 = "";	
	if(Values.prop4) s.prop4 = unescape(Values.prop4); else s.prop4 = "";
	if(Values.prop5) s.prop5 = unescape(Values.prop5); else s.prop5 = "";
	if(Values.prop7) s.prop7 = unescape(Values.prop7); else s.prop7 = "";
	//prop8 und prop9 haben immer die gleichen Werte, und dürften i.d.R. bei Mirco-Tracking irrelevant sein
	if(Values.prop8 || Values.prop9)
	{
		s.prop8 = unescape(Values.prop8+Values.prop9);
		s.prop9 = unescape(Values.prop8+Values.prop9);
	}
	else
	{
		s.prop8 = "";
		s.prop9 = "";
	}
	if(Values.prop12) s.prop12 = unescape(Values.prop12); else s.prop12 = "";
	if(Values.prop13) s.prop13 = unescape(Values.prop13); else s.prop13 = "";
	if(Values.prop14) s.prop14 = unescape(Values.prop14); else s.prop14 = "";
	if(Values.prop15) s.prop15 = unescape(Values.prop15); else s.prop15 = "";
	if(Values.prop16) s.prop16 = unescape(Values.prop16); else s.prop16 = "";
	if(Values.prop17) s.prop17 = unescape(Values.prop17); else s.prop17 = "";
	
	//Conversion-Properties
	if(Values.eVar3) s.eVar3 = unescape(Values.eVar3); else s.eVar3 = "";
	if(Values.eVar4) s.eVar4 = unescape(Values.eVar4); else s.eVar4 = "";
	if(Values.eVar5) s.eVar5 = unescape(Values.eVar5); else s.eVar5 = "";
	if(Values.eVar6) s.eVar6 = unescape(Values.eVar6); else s.eVar6 = "";
	if(Values.eVar15) s.eVar15 = unescape(Values.eVar15); else s.eVar15 = "";
	if(Values.eVar16) s.eVar16 = unescape(Values.eVar16); else s.eVar16 = "";
	if(Values.eVar18) s.eVar18 = unescape(Values.eVar18); else s.eVar18 = "";
	if(Values.eVar19) s.eVar19 = unescape(Values.eVar19); else s.eVar19 = "";
	if(Values.eVar22) s.eVar22 = unescape(Values.eVar22); else s.eVar22 = "";
	if(Values.eVar23) s.eVar23 = unescape(Values.eVar23); else s.eVar23 = "";
	if(Values.eVar24) s.eVar24 = unescape(Values.eVar24); else s.eVar24 = "";
	if(Values.eVar25) s.eVar25 = unescape(Values.eVar25); else s.eVar25 = "";
	if(Values.eVar26) s.eVar26 = unescape(Values.eVar26); else s.eVar26 = "";
	if(Values.eVar27) s.eVar27 = unescape(Values.eVar27); else s.eVar27 = "";
	if(Values.eVar28) s.eVar28 = unescape(Values.eVar28); else s.eVar28 = "";
	if(Values.eVar29) s.eVar29 = unescape(Values.eVar29); else s.eVar29 = "";
	if(Values.eVar31) s.eVar31 = unescape(Values.eVar31); else s.eVar31 = "";
	if(Values.eVar32) s.eVar32 = unescape(Values.eVar32); else s.eVar32 = "";
	if(Values.eVar33) s.eVar33 = unescape(Values.eVar33); else s.eVar33 = "";
	if(Values.eVar34) s.eVar34 = unescape(Values.eVar34); else s.eVar34 = "";
	if(Values.eVar35) s.eVar35 = unescape(Values.eVar35); else s.eVar35 = "";
	if(Values.eVar36) s.eVar36 = unescape(Values.eVar36); else s.eVar36 = "";
	if(Values.eVar37) s.eVar37 = unescape(Values.eVar37); else s.eVar37 = "";
	if(Values.eVar38) s.eVar38 = unescape(Values.eVar38); else s.eVar38 = "";
	if(Values.eVar39) s.eVar39 = unescape(Values.eVar39); else s.eVar39 = "";
	if(Values.eVar40) s.eVar40 = unescape(Values.eVar40); else s.eVar40 = "";
	
	//ACHTUNG notwendige trafficvariabel-abhängige Conversion-Spiegelungen 
	if(Values.prop7) s.eVar8 = unescape(Values.prop7); else s.eVar8 = "";
	if(Values.prop8 || Values.prop9)
		s.eVar9 = unescape(Values.prop8+Values.prop9);
	else
		s.eVar9 = "";
	if(Values.prop12) s.eVar12 = unescape(Values.prop12); else s.eVar12 = "";
	if(Values.prop13) s.eVar13 = unescape(Values.prop13); else s.eVar13 = "";
	if(Values.prop14) s.eVar14 = unescape(Values.prop14); else s.eVar14 = "";

	if(Values.events) s.events = unescape(Values.events); else s.events = "";
	if(Values.products) s.products = unescape(Values.products); else s.products = "";	

	
	//do Tracking-Call
	/*
	if(Values.trackingType == 'micro')
	{
		if(Values.linkTrackVars)
			s.linkTrackVars = unescape(Values.linkTrackVars);
		if(Values.events)
			s.linkTrackEvents = unescape(Values.events);
		if(Values.pagename)
			s.tl(this,'o',s.pageName);
		else
			s.tl(this,'o');
	}
	else	
	*/	
		s.t(); 	
}

function ADSVIEW(BinaryCodeID, BinaryCharacteristicValueID, ImageID, index)
{
	$('#ProductImageToolsZoom').unbind('click');
	$('#ProductImageToolsZoom').click(function(e){
		e.preventDefault();
		OpenFullScreenDialog(index);
	});
	
	Z_BID = BinaryCodeID;
	Z_BCVID = BinaryCharacteristicValueID; 
	Z_ImageID = ImageID;
	Z_Indes = index;
	$('.jqZoomWindow').remove();	
	jQuery('a.innerborderhover').removeClass('innerborderhover').addClass('innerborder');
	jQuery('#'+BinaryCodeID+' > a').removeClass('innerborder').addClass('innerborderhover');

	var folder='';	
	switch (BinaryCharacteristicValueID) 
	{
		case 432694:
			folder='zoomimages';
		break;
		case 451707:
			folder='zoomimages_vorder';
		break;
		case 432695:
			folder='zoomimages_seiten';	
		break;
		case 452119:
			folder='zoomimages_ruecken';	
		break;
		case 455759:
			folder='zoomimages_detail1';	
		break;
		case 455760:
			folder='zoomimages_detail2';	
		break;
		case 455761:
			folder='zoomimages_detail3';	
		break;	
		case 2373734:
			folder='zoomimages_leger';
	} // switch	
	
	if (folder != '' && ImageID > 0)
	{
		var ProductVideo = document.getElementById('ProductVideo');
		if (ProductVideo)
		{	
			$('#ProductVideo').hide();
			$('#ProductImage').show();
		}
		var ZoomAnchorURL = 'http://www.frontlineshop.com/customGates/scripts/image.php?folder='+folder+'&filename='+ImageID+'.jpg';
		var ZoomImageSRC = base_url+'/gateTools/scripts/binary.php?BinaryCodeID='+BinaryCodeID+'&convert[-resize]=258x369&convert[-unsharp]=0.5+0.9+0';
		var imgTitle = jQuery('#ProductImage a[class="jqzoom"] img').attr('alt');
		jQuery("#ProductImage").children('a').replaceWith('<a href="'+ZoomAnchorURL+'" class="jqzoom" title="'+imgTitle+'"><img id="ProductBinary" src="'+ZoomImageSRC+'" title="'+imgTitle+'" alt="'+imgTitle+'"></a>');
		
		var options =
		{
			zoomWidth: 284,
			zoomHeight: 388,
			title: false,
			xOffset:4,
			yOffset:-1,
			index: index
		};
		
		jQuery(".jqzoom").jqzoom(options);	
	} // if (folder != '' && ImageID > 0)
}

function displayPortofrei()
{
	return true;
	/*
	var Portofrei = document.getElementById('Portofrei');
	
	if(Portofrei.style.display=='block')
	{	
		PortoFreiPosition = getAbsoluteElementPosition(Portofrei);
		var PortoFreiImg = document.getElementById('PortoFreiImg');
		PortoFreiImg.style.left = PortoFreiPosition.x - 9 + "px";
		PortoFreiImg.style.top = PortoFreiPosition.y + 5+ "px";
	    PortoFreiImg.style.display='';
	} // if(Portofrei)
	*/
}

function displayBrandInformation(Brand, ImageURL, ImageWidth, ImageHeight)
{
	jQuery.ajax(
	{
		type: "GET",
		url: base_url+'/index.php?screen=aj.request&task=getADSBrandData&Brand='+escape(Brand)+'&ImageURL='+escape(ImageURL)+'&ImageWidth='+ImageWidth+'&ImageHeight='+ImageHeight,
		success: function (msg)
		{
			var data = eval('('+msg+')'); 	

			if (data.MESSAGE == "OK")
			{
				var MarkenContent = document.getElementById('MarkenContent');
				if (MarkenContent)
				{
					MarkenContent.innerHTML = unescape(data.CONTENT);
				}
			}
		} // onSuccess: function(transport)
	});
} // function displayBrandInformation(Brand, ImageURL, ImageWidth, ImageHeight)

function SelectColor(Color)
{
	var Size = jQuery('#Size').val();
	var ColorLink = '';
	var divId = '';
	Color = escape(Color);
	
	if (Size != '')
	{
		HTMLSize = Size.replace(/\"/g,"");
		HTMLSize = HTMLSize.replace(/\'/g,"");
		HTMLSize = HTMLSize.replace(/\=/g,"-");
		HTMLSize = HTMLSize.replace(/\//g,"-");
		HTMLSize = HTMLSize.replace(/\*/g,"-");
		HTMLSize = HTMLSize.replace(/ /g,"-");
		HTMLSize = HTMLSize.replace(/\,/g,"-");
		HTMLSize = HTMLSize.replace(/\./g,"-");
		HTMLSize = HTMLSize.replace(/\(/g,"-");
		HTMLSize = HTMLSize.replace(/\)/g,"-");
		HTMLSize = HTMLSize.replace(/\+/g,"-");
		HTMLSize = HTMLSize.replace(/--/g,"-");
		HTMLSize = HTMLSize.replace(/--/g,"-");
		
		ColorLink = jQuery('#'+Color+'_'+escape(HTMLSize)+' > a').attr('href');
	}
	
	if (Size == '' || ColorLink == '' || ColorLink == null)
	{
		ColorLink = '';
		jQuery('.ColorLink').each(
			function()
			{
				divId = this.id;
				Color = escape(Color);
				if (divId.indexOf(Color+'_') == 0 && ColorLink=='')
					ColorLink = jQuery('#'+this.id+' > a').attr('href');
			} // function()
		); // each
	} // if (Size == '' || VariantTreeNodeID == '' || VariantTreeNodeID == null)

	if (Size != '')
		ColorLink = ColorLink + '?size='+escape(Size);
	
	// Wenn der Dialog geöffnet ist, befindet sich der User im Overlay, das nun neu geladen werden muss.
	if (dialog.dialog("isOpen"))
	{
		// Die Parameter aus dem ColorLink isolieren ...
		var parameters = ColorLink.substr(ColorLink.indexOf("&"), ColorLink.length);
		// z. B.: parameters = &TreeNodeID=245065&VariantTreeNodeID=279610&ItemName=ADIDAS-Superstar-II-white-black
		
		// ... nun die TreeNodeID ermitteln ...
		var TNIDStart = parameters.substr(parameters.indexOf("&TreeNodeID=")+12, parameters.length);
		// z. B.: TNIDStart = 245065&VariantTreeNodeID=279610&ItemName=ADIDAS-Superstar-II-white-black
		
		var TNID =  TNIDStart.substr(0, TNIDStart.indexOf("&"));
		// z. B.: TNID = 245065
		
		// ... und analog die VariantTreeNodeID
		var VTNIDStart = parameters.substr(parameters.indexOf("&VariantTreeNodeID=")+19, parameters.length);
		var VTNID =  VTNIDStart.substr(0, VTNIDStart.indexOf("&"));
		
		// dann Dialog neu laden
		ShowADSProduct(TNID, VTNID);
	}
	else
		location.href=ColorLink;
	
}

function SelectSize(VariantTreeNodeID, FormularName, Size, Quantity)
{
	jQuery('[name=VariantTreeNodeID]').val(VariantTreeNodeID);
	jQuery('[name=size]').val(Size);
	jQuery('.innerborderhoverSize').removeClass('innerborderhoverSize').addClass('innerborderSize');
	jQuery('#'+VariantTreeNodeID).addClass('innerborderhoverSize');
	jQuery('#Hinweis').hide();
	jQuery('.Lieferbar').html('Lieferbar');
	jQuery('#Liefertermin #LShow').show();
	jQuery('#HotlineVersandkostenfrei').show();
    
	var QuantitySelectBox = '<div id="AnzahlDesc">Anzahl:</div><div id="AnzahlNo">';
	
	if (Quantity > 0)
	{
		QuantitySelectBox = QuantitySelectBox + '<select name="Quantity" id="Quantity">';
		
		for (var i = 1; i < (Quantity+1); i++) 
		{
			QuantitySelectBox = QuantitySelectBox + '<option value="'+i+'">'+i+'</option>';
		}
		QuantitySelectBox = QuantitySelectBox + '</select>';
	}
	else
	{
		QuantitySelectBox = QuantitySelectBox + '---';
	}
		
	QuantitySelectBox = QuantitySelectBox + '</div><div class="clearer"></div>';
	
	jQuery('#Anzahl').html(QuantitySelectBox);
	
} // function SelectSize(VariantTreeNodeID, FormularName, Size, Quantity)

function ShowVormerken(TreeNodeID, GenderTreeNodeID)
{
	jQuery.ajax(
	{
		type: "GET",
		url: base_url+'/index.php?screen=aj.vormerken&task=show&TreeNodeID='+TreeNodeID+'&GenderTreeNodeID='+GenderTreeNodeID,
		success: function (msg)
		{
			var data = eval('('+msg+')'); 	

			if (data.MESSAGE == "OK")
			{
				vormerken.html(unescape(data.CONTENT));
				vormerken.dialog({width:471});
				vormerken.dialog('open');
				vormerken.dialog("option", "position", "center");
			}
		} // onSuccess: function(transport)
	});
} // function ShowVormerken(TreeNodeID, GenderTreeNodeID)

function SendVormerken(SizeAvailable)
{
	var FormBug = false;
	
	if (SizeAvailable == 'yes')
	{
		jQuery('#ColorBug').html('');
		jQuery('#SizeBug').html('');
		jQuery('#EmailBug').html('');
	
		if (jQuery('[name=VormerkenColor]').val() == 'EmptyColor')
		{
			FormBug = true;
			jQuery('#ColorBug').html('Bitte w&auml;hle eine Farbe aus.');
			jQuery('#SizeBug').html('Bitte w&auml;hle eine Gr&ouml;&szlig;e aus.');
			
		} // if (jQuery('[name=VormerkenColor]').val() == 'EmptyColor')
		else if (jQuery('[name=vtnid]').val() == 'EmptySize')
		{
			FormBug = true;
			jQuery('#ColorBug').html('');
			jQuery('#SizeBug').html('Bitte w&auml;hle eine Gr&ouml;&szlig;e aus.');
		} // else if (jQuery('[name=vtnid]').val() == 'EmptySize')
	} // if (SizeAvailable == 'yes')
	else 
	{
		jQuery('#ColorBug').html('');
		jQuery('#EmailBug').html('');
	
		if (jQuery('[name=vtnid]').val() == 'EmptyColor')
		{
			FormBug = true;
			jQuery('#ColorBug').html('Bitte w&auml;hle eine Farbe aus.');
		} // if (jQuery('[name=vtnid]').val() == 'EmptyColor')
	} // else [if (SizeAvailable == 'yes')]

	if (jQuery('[name=VormerkenEmail]').val() == '')
	{
		FormBug = true;
		jQuery('#EmailBug').html('Bitte gib eine g&uuml;ltige E-Mail-Adresse an.');
	}
	else if(!jQuery('[name=VormerkenEmail]').val().match('^[-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*@[-a-zA-Z0-9]+(\.[-a-zA-Z0-9]+)*\.([a-zA-Z]{2,4})$'))
	{
		FormBug = true;
		jQuery('#EmailBug').html('Bitte gib eine g&uuml;ltige E-Mail-Adresse an.');
	}
	
	if (jQuery('[name=VormerkenEmail]').val().indexOf('.') == -1)
	{
		FormBug = true;
		jQuery('#EmailBug').html('Bitte gib eine g&uuml;ltige E-Mail-Adresse an.');
	}
	
	if (FormBug == true)
		return true;

	if (jQuery('[name=nlreg]').attr('checked') == true)
		var NLSuffix = '&abo=yes';
	else
		var NLSuffix = '&abo=no';
	
	jQuery.ajax(
	{
		type: "GET",
		url: base_url+'/index.php?screen=aj.vormerken&task=vormerken&email='+jQuery('[name=VormerkenEmail]').val()+'&TreeNodeID='+jQuery('[name=vtnid]').val()+'&Gender='+jQuery('[name=Gender]').val()+NLSuffix,
		success: function (msg)
		{
			var data = eval('('+msg+')'); 		

			if (data.MESSAGE == "OK")
			{
				jQuery('#VormerkenInhalt').html(unescape(data.CONTENT));
				
				s.pageName="aj.vormerken";
				s.events="event22";
				s.products=";"+data.TREENODEID+";;;;evar17="+data.PREISART;
				s.t();
			}
		} // onSuccess: function(transport)
	});
} // function SendVormerken(SizeAvailable)

function showADSSurveyLayer(){
	var gsl = document.getElementById('ads_survey_layer');
	if (gsl)
	{
		var NaviTable = document.getElementById('NaviTable');
		TablePosition = getAbsoluteElementPosition(NaviTable);
		gsl.style.left = TablePosition.x + 184 + "px";
		gsl.style.top = TablePosition.y + 50 + "px";
		gsl.style.display='';
	} // if (gsl)
}

function showgs()
{
	var gsl = document.getElementById('gslayer');
	if (gsl)
	{
		var NaviTable = document.getElementById('NaviTable');
		TablePosition = getAbsoluteElementPosition(NaviTable);
		gsl.style.left = TablePosition.x + 184 + "px";
		gsl.style.top = TablePosition.y + 50 + "px";
		gsl.style.display='';
	} // if (gsl)
} // function showgs()

function GSGutschein()
{
	var gsurl = location.href;
	if (gsurl.indexOf("?") > 0)
		gsurl += "&BonusCode=gshome10eur";
	else
		gsurl += "?BonusCode=gshome10eur";
	
	this.location.href=gsurl;
} // function GSGutschein()

function CloseLayer(DivID)
{
	var Element = document.getElementById(DivID);
	if (Element)
	{
		Element.style.display='none';
	}
	return false;
}

function DialogClose()
{
	dialog.dialog('close');
	try
	{
		eieruhr.dialog('close');
	}
	catch (e)
	{
		// do nothing
	}
}

function ShippingDialogClose()
{
	shipping.dialog('close');
}

function VormerkenDialogClose()
{
	vormerken.dialog('close');
}

function ShowMindestBestellwert()
{
	dialog.html($('#ModalContentContainer2'));
	dialog.dialog({width:530});
	dialog.dialog('open');
	dialog.dialog("option", "position", "center");
}

function changePASCDataByCountryId(Value)
{
	var AjaxUrl = base_url+'/index.php?screen=aj.sapcl&country_id='+Value;
		
	jQuery.ajax({
		type: "GET",
		url: AjaxUrl,
		success: function(ObjectLiteral)
		{
			var data = eval('('+ObjectLiteral+')'); 
			
			jQuery('#tabs-2 .Change').html(unescape(data.html));				
		},
		error: function(){
			jQuery('#tabs-2 .Change').html('<div class="Spacer"></div>');	  
		},
		beforeSend: function()
		{
			jQuery('#SAPCL .Loading').css('display','block');
		},
		complete: function()
		{
			jQuery('#SAPCL .Loading').css('display','none');
		}
	});
} // function changePASCDataByCountryId(Value)

function showShippingAndPostageCostsLayer(Popup)
{
	var AjaxUrl = base_url+'/index.php?screen=aj.sapcl';
	var SAPCLHtml = null; // sapcl = Shipping-And-Postage-Costs-Layer 
	
	shipping.dialog({width:670});
	shipping.dialog('option', 'position', 'center');
	

	jQuery.ajax(
	{
		type: 'GET',
		url: AjaxUrl,
		success: function(ObjectLiteral)
		{
			var data = eval('('+ObjectLiteral+')'); 
			SAPCLHtml = unescape(data.html);
				
			shipping.html(SAPCLHtml);
			shipping.dialog('open');
			jQuery('#SAPCLTabContainer').tabs();
			jQuery('#SAPCLTabContainer').tabs('option', 'selected', 0);
			
			if(Popup)
			{
				jQuery('#SAPCL .Titlebar .Close').remove();
			}
		} 
	});
	
} // function showShippingAndPostageCostsLayer()

function showShippingAndPostageCostsPopup()
{
	url = base_url+'/index.php?screen=mi.shippingandpostage';
	width = '690px';
	height = '530px';
	name='ShippingAndPostage';
	
	newwindow=window.open(url, name, 'width=' + width + ',height=' + height + ',location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,top=100,left=100');
	newwindow.focus();
} // function showShippingAndPostageCostsLayer()

function dbap_checkAll(objSelectAllCheckbox1, objSelectAllCheckbox2, objForm)
{
	var check = objSelectAllCheckbox1.checked;
	objSelectAllCheckbox2.checked = check;
	for (var i = 0; i < objForm.elements.length; i++)
		if ((objForm.elements[i].name != objSelectAllCheckbox1.name) && (objForm.elements[i].name != objSelectAllCheckbox2.name))
			objForm.elements[i].checked = check;
} // function dbap_checkAll()

function dbap_confirmRedirect(RedirectUrl, Message)
{
	decision = confirm(Message);
	if (decision)
		document.location.href = RedirectUrl;
} // function dbap_confirmRedirect()


function OpenFullScreenDialog(index)
{
	DialogInnerHTML =
		'<div class="divKeepDistance">'
		+ '<div id="divHeadBar">'
		+ '<div id="divCloseButton"></div>'
		+ '</div>'
		+ '<div id="FullScreenPictures">';
		
		for(i =  0; i < imageURL.length; i++)
		{
			DialogInnerHTML += '<div class="FullScreenPicture" id="FullScreenImage_'+i+'">';
			DialogInnerHTML += '</div>';
		}
		DialogInnerHTML += "</div>";

	DialogInnerHTML +=	'<input type="image" id="ButtonBack" class="hidden" src="'+base_url+'/customGates/resources/binaries/universal/buttons/btn_page_back.png">'
	+ '<input type="image" id="ButtonAhead" class="hidden" src="'+base_url+'/customGates/resources/binaries/universal/buttons/btn_page_ahead.png">'
	+ '<div id="DivCountPictures"></div>';
	
	DialogInnerHTML +=	"</div>";
	
	dialog.html(DialogInnerHTML);
	dialog.dialog({width:730});
	dialog.dialog('open');
	
	$("#divCloseButton").click(CloseFullScreenDialog);
	
	if(imageURL.length == 1)
		loadFullScreenSlideImage(0);
	else
	{
		fullScreenImageScroller.startingSlide = index; 
		$('#FullScreenPictures').cycle(fullScreenImageScroller);
	}
	
	dialog.dialog("option", "position", "center");
	var ST = $(document).scrollTop();
	$('.ui-dialog').css('top', ST+85);
	
	//$('#uidiag').css('top', ST+85);
} // function OpenFullScreenDialog(index)

fullScreenImageScroller = {
    speed:  'fast',
    timeout: 0,
    prev: '#ButtonBack',
    next: '#ButtonAhead, #FullScreenPictures',
    after: function(currSlideElement, nextSlideElement, options, forwardFlag)
    {
    	if(options.slideCount > 1)
    	{
    		$('#ButtonBack').removeClass('hidden');
    		$('#ButtonAhead').removeClass('hidden');
    		
	    	currPage = options.currSlide+1;
	    	$('#DivCountPictures').html('<span class="current">'
	    			+currPage+'/</span><span class="total">'+options.slideCount+'</span>');
    	}
    	
    	// Bilder müssen evtl. nachgeladen werden
    	if($('#FullScreenImage_'+options.currSlide).children().length == 0 || $('#FullScreenImage_'+options.currSlide+' .image').hasClass('hidden'))
    	{
    		loadFullScreenSlideImage(options.currSlide);
    	}
    	
    	//Omniture 
    	s.linkTrackVars = 'products,hier1,events,eVar15'; 
    	s.linkTrackEvents = 'prodView,event3,event15'; 
    	s.events = 'prodView,event3,event15'; //Events für Produktansichtszoom 
    	s.eVar15 = imageName[options.currSlide];
    	s.hier1 = zoomHierachie+'/Vollbild Ansicht';
    	s.tl(this,'o','Vollbild Ansicht'); //es sollen nur Teile getracked werden als Custom Link ('o')
    }
};

function loadFullScreenSlideImage(index)
{
	$("#ButtonAhead").css("cursor","wait");
	$("#ButtonBack").css("cursor","wait");
	$("#FullScreenPictures").css("cursor","wait");
	
	$('#FullScreenImage_'+index).html(
			'<img class="please_wait" src="'+base_url+'/customGates/resources/binaries/universal/quickview/pleasewait.gif" title="" border="0">'    				
			+'<img class="image hidden" src="'+imageURL[index]+'" title="" border="0">');
	
	$('#FullScreenImage_'+index+' .image').load(function()
	{
		$('#FullScreenImage_'+index+' .please_wait').addClass('hidden');
		$('#FullScreenImage_'+index+' .image').removeClass('hidden');
		$("#ButtonAhead").css("cursor","pointer");
		$("#ButtonBack").css("cursor","pointer");
		$("#FullScreenPictures").css("cursor","pointer");
	});
}

function CloseFullScreenDialog()
{
	dialog.dialog('close');
}

/* Neukundenbanner */
function ShowNewCustomer()
{
	var windowWidth = $(window).width(); 
	if(windowWidth >= 1153) 
	{ 
		if($("#NeuKundeBanner"))
			$("#NeuKundeBanner").css("display", "block");
		
		$("#neuKundeBanner_animation").css("display", "block");
		
		$("#neuKundeBanner_animation .top_img").fadeIn(100, function()
		{
			$("#neuKundeBanner_animation .top_img").animate({"marginLeft":"0"}, 1000, "swing", function()
			{
				$("#neuKundeBanner_animation .bottom_img").fadeIn(100);
				$("#neuKundeBanner_animation .bottom_img").animate({"marginLeft":"0"}, 1000, "swing", function()
				{
					$("#neuKundeBanner_animation .left_img").fadeIn("slow");
				});
			});	
		});
	}
	else 
	{
		// ausblenden
		$("#neuKundeBanner_animation").css("display", "none");
		$("#NeuKundeBanner").css("display", "none");
	} // $(window).width() >= 1153
}

/* EPOQ */
function getRecommendations(ElementID,TennantID,SessionID,CustomerID,Rules,Screen)
{
	if( $('#'+ElementID).length > 0)
	{	
		epoq.go({
			tenantId: TennantID,
			sessionId: SessionID,
			customerId: CustomerID,
			rules: Rules,
			success: function (data)
			{
				var recommendations = data['recommendations'];
				var recommendationId = '';
				var recommendationRule = '';
				var AJAX_URL = '';
				
				//falls nur eine Domain vorliegt (z.B. bei Abfrage mit genau einer Rule)
				if(typeof(recommendations['domain']) != "undefined" && typeof(recommendations['domain'].length) == 'undefined') {
					if(recommendations['domain']['items']['item'].length > 0 && typeof(recommendations['domain']['recommendationId']['$']) != "undefined")
					{
						AJAX_URL = base_url+'/index.php?screen=aj.epoq&recommendationId='+recommendations['domain']['recommendationId']['$'];
						if(typeof(recommendations['domain']['@rules']) != "undefined")
						{
							//Internal-Campaign-Params mappen und anhängen
							recommendationRule = recommendations['domain']['@rules'].split(",");
							if(recommendationRule[0] == 'frontlineStyles')
								AJAX_URL +='&intCampScreen='+Screen+'&intCampArea=D1&intCampName=FavoriteStyles&Element=MostWanted';
							else if(recommendationRule[0] == 'frontlineFreshReduced')
								AJAX_URL +='&intCampScreen='+Screen+'&intCampArea=E1&intCampName=TopSaleStyles&Element=FrischReduziert';
							else if(recommendationRule[0] == 'frontlineNewItems')
								AJAX_URL +='&intCampScreen='+Screen+'&intCampArea=F1&intCampName=NewArrivals&Element=Brandneu';
							AJAX_URL +='&Rule='+recommendationRule[0];
							if(typeof(recommendationRule[1]) != 'undefined')
								AJAX_URL +='|'+recommendationRule[1];
							
							if(Screen == 'or.trolley')
								AJAX_URL +='&Anzahl=4';
							else
								AJAX_URL +='&Anzahl=5';
							
							//die zu holenden Items anhängen
							for(var j=0; j < recommendations['domain']['items']['item'].length; j++)
								AJAX_URL+='&pid[]='+recommendations['domain']['items']['item'][j]['@id'];
							
							//Call auslösen
							jQuery.ajax(
							{
								type: "GET",
								url: AJAX_URL,
								cache: false,
								success: function(msg) 
								{
									
									var data = eval('('+msg+')');
									if(data.MESSAGE == "OK")
									{	
										$('#'+ElementID+' div[class="'+unescape(data.ELEMENT)+'"]').append(unescape(data.CONTENT));
										
										var propEPOQ = '';
										// erfolgreich, fehlgeschlagen oder unvollständig
										
										// Anzahl der geforderten und gelieferten Recommendations prüfen
										if(unescape(data.REQ_ANZAHL) <= unescape(data.RES_ANZAHL))
											propEPOQ += 'erfolgreich';
										else if(unescape(data.RES_ANZAHL) > 0)
											propEPOQ += 'unvollstaendig';
										else
											propEPOQ += 'empty';
										
										// Funktion / Methode ergänzen
										propEPOQ += '|getRecommendations';
										
										// Rule ergänzen
										if(unescape(data.EPOQ_RULE))
											propEPOQ += '|'+unescape(data.EPOQ_RULE);
																	
										//Omniture
										s.linkTrackVars = 'prop20'; 
									 	s.linkTrackEvents = 'None';
									 	s.prop20 = propEPOQ;
									 	try { 
									 		s.tl(true,'o','EPOQGetRecommendations');
									 	} catch(e) {}
									}
								},
								reccommands: {}
							});
						}	
					}		
				} 
				//für jede Domain... aber ACHTUNG bei nur einer einzelnen Domain ist evtl. die JSON-Struktur anders (s.o)
				else if(typeof(recommendations['domain']) != "undefined" && recommendations['domain'].length > 0)
				{
					for(var i=0; i < recommendations['domain'].length; i++)
					{
						if(typeof(recommendations['domain'][i]) != "undefined" && typeof(recommendations['domain'][i]['items']) != "undefined")
						{
							if(recommendations['domain'][i]['items']['item'].length > 0 && typeof(recommendations['domain'][i]['recommendationId']['$']) != "undefined")
							{
								AJAX_URL = base_url+'/index.php?screen=aj.epoq&recommendationId='+recommendations['domain'][i]['recommendationId']['$'];
								if(typeof(recommendations['domain'][i]['@rules']) != "undefined")
								{
									//Internal-Campaign-Params mappen und anhängen
									recommendationRule = recommendations['domain'][i]['@rules'].split(",");
									if(recommendationRule[0] == 'frontlineStyles')
										AJAX_URL +='&intCampScreen='+Screen+'&intCampArea=D1&intCampName=FavoriteStyles&Element=MostWanted';
									else if(recommendationRule[0] == 'frontlineFreshReduced')
										AJAX_URL +='&intCampScreen='+Screen+'&intCampArea=E1&intCampName=TopSaleStyles&Element=FrischReduziert';
									else if(recommendationRule[0] == 'frontlineNewItems')
										AJAX_URL +='&intCampScreen='+Screen+'&intCampArea=F1&intCampName=NewArrivals&Element=Brandneu';
									AJAX_URL +='&Rule='+recommendationRule[0]+'|'+recommendationRule[1];
									
									if(Screen == 'or.trolley')
										AJAX_URL +='&Anzahl=4';
									else
										AJAX_URL +='&Anzahl=5';
									
									//die zu holenden Items anhängen
									for(var j=0; j < recommendations['domain'][i]['items']['item'].length; j++)
										AJAX_URL+='&pid[]='+recommendations['domain'][i]['items']['item'][j]['@id'];
									
									//Call auslösen
									jQuery.ajax(
									{
										type: "GET",
										url: AJAX_URL,
										cache: false,
										success: function(msg) 
										{
											
											var data = eval('('+msg+')');
											if(data.MESSAGE == "OK")
											{	
												$('#'+ElementID+' div[class="'+unescape(data.ELEMENT)+'"]').append(unescape(data.CONTENT));
												
												var propEPOQ = '';
												// erfolgreich, fehlgeschlagen oder unvollständig
												
												// Anzahl der geforderten und gelieferten Recommendations prüfen
												if(unescape(data.REQ_ANZAHL) <= unescape(data.RES_ANZAHL))
													propEPOQ += 'erfolgreich';
												else if(unescape(data.RES_ANZAHL) > 0)
													propEPOQ += 'unvollstaendig';
												else
													propEPOQ += 'empty';
												
												// Funktion / Methode ergänzen
												propEPOQ += '|getRecommendations';
												
												// Rule ergänzen
												if(unescape(data.EPOQ_RULE))
													propEPOQ += '|'+unescape(data.EPOQ_RULE);
																			
												//Omniture
												s.linkTrackVars = 'prop20'; 
											 	s.linkTrackEvents = 'None';
											 	s.prop20 = propEPOQ;
											 	try { 
											 		s.tl(true,'o','EPOQGetRecommendations');
											 	} catch(e) {}
											}
										},
										reccommands: {}
									});
									
								}	
							}
						}
					}
				}
			}
		});
	}	
}

//Scroller fuer Brands-Logos auf Landingpages 
function initSimpleScroll(ElementID)
{
	if( $('#'+ElementID).length > 0)
	{
		var brandlogoLoadedCounter = 0;
		// once per img when complete/load triggered
		$('#'+ElementID+' img').one("load",function()
		{
			brandlogoLoadedCounter++;
			
			// preloading, könnte aktiviert werden, wenn es ruckelt
			// var Bild = new Image();
			// Bild.src = $(this).attr('src').replace($(this).attr('hover-id-out'),$(this).attr('hover-id-on'));
			
			// dem floating-Element eine Breite verpassen
			$(this).parent().parent().css('width',$(this).width());
	
			// wenn alle Elemente ihre Breite bekommen haben 
			if(brandlogoLoadedCounter == $('#'+ElementID+' div[class="brandlogo"]').length)
			{
				// benötigte Gesamtbreite berechnen
				var sum = 0;
				$('#'+ElementID+' div[class="brandlogo"]').each(function() {
					sum = sum + $(this).width();
				});
				
				var clip_width = $('#'+ElementID).parent().width();
				if(clip_width > sum)
					$('#'+ElementID+' li').css('width',clip_width);	
				else
					$('#'+ElementID+' li').css('width',sum);
				
				// init Scroller
				$('#'+ElementID).simplyScroll();
				
				// allen, auch den gespiegelten Elementen ein Hover zu ordnen
				var count = 0;
				$('#'+ElementID+' div[class="brandlogo"]').each(function() {
					var imgElement = $('img',this);
					$(this).hover(
						function() { // Hover-On
							imgElement.attr('src',imgElement.attr('src').replace(imgElement.attr('hover-id-out'),imgElement.attr('hover-id-on')));
						},
						function() { // Hover-Out
							imgElement.attr('src',imgElement.attr('src').replace(imgElement.attr('hover-id-on'),imgElement.attr('hover-id-out')));
						}
					);
				});			
			}
		}).each(function() {
			// trigger load-event
			if(this.complete) {
				$(this).trigger("load");
			}  
		});
	}
}

//Statt Button-Click (enter gedrückt) ac.login_register => login
function account_login(e)
{
	if (e.which == 13)
		document.fd_PersonDataLogin.submit();
	
	return false;
} // function orderprocess_login(e)

//Statt Button-Click (enter gedrückt) ac.login_register => register
function account_register(e)
{
	if (e.which == 13)
		document.fd_PersonDataRegister.submit();
	
	return false;	
}

// Weiterempfehlen Modalfenster
function filterInputData(field_value) 
{
	for(var nIndex=0; nIndex<field_value.value.length; nIndex++) {
		if (!field_value.value.charAt(nIndex).match(/[a-zA-ZäÄöÖüÜß\-\s\'\.]/i)) 
		{
			field_value.value=field_value.value.replace(field_value.value.charAt(nIndex), '');
		}
	} 
}

function validateEmail(email) 
{
	if(email.lenght < 6)
		return false;
	
	if(!email.match('^[-_a-zA-Z0-9]+(\.[-_a-zA-Z0-9]+)*@[-a-zA-Z0-9]+(\.[-a-zA-Z0-9]+)*\.([a-zA-Z]{2,4})$'))
		return false;
	
	return true;
}

function setDefaultWeiterEmpfehlenBox()
{
	$(".error").html("");
	$(".reqf, #wt_textarea_nachricht").val("");
	$(".reqf, #wt_textarea_nachricht").css("border-color", "#a7a7a7");
	$("#WeiterEmpfehlenBoxSuccess, #WeiterEmpfehlenBoxFailed").css("display", "none");
	$(".weiterempfehlen_form_content").css("display", "block");
	setZeichenCounter(".ZeichenCounter", 500);
}

function WEAnzahlCheckClose () 
{
	if($("#WEAnzahl"))
	{
		if($("#WEAnzahl").val() >= 5) 
		{
			$("#TellAFriend").hide();
		}
	}
}

function zeichenCounter(field, maxlimit, counter) 
{
	if(field.value.length >maxlimit) 
		field.value = field.value.substr(0, maxlimit);
	
	$(counter).html(maxlimit - field.value.length);
	return false;
}

function setZeichenCounter(counter, value){
	$(counter).html(value);
}

function WEBoxController(flag) {
	$(document).bind('dialogbeforeclose', function() 
	{
		$("#WeiterEmpfehlenBox").fadeOut();
		WEAnzahlCheckClose();
	});	

	if(flag == 0) 
	{
		setDefaultWeiterEmpfehlenBox();
		recommend.dialog('open', $("#WeiterEmpfehlenBox").fadeIn());
	}
	else 
	{
		recommend.dialog('close', $("#WeiterEmpfehlenBox").fadeOut());
		WEAnzahlCheckClose();
	}
}

function AjaxWeiterEmpfehlen() 
{
	var bOK = 1;
	var TreeNodeID		  = $("input:hidden[name='TreeNodeID']").val();
	var VariantTreeNodeID = $("input:hidden[name='VariantTreeNodeID']").val();
	
	if(VariantTreeNodeID == "") 
		VariantTreeNodeID = $("input:hidden[name='DefaultVariantTreeNodeID']").val();
	
	/* Pflichtfelder sind als reqf via classname markiert, sollen ausgefuellt werden */
	$(".reqf").each(function() 
	{
		if($(this).val() == "" || $(this).val().length < 2) 
		{
			bOK = 0;
			$(this).css("border-color", "#7e0700");
			$(this).parent().find(".error").html("Bitte f&uuml;lle dieses Feld aus");
		}
		else
		{
			$(this).css("border-color", "#a7a7a7");
			$(this).parent().find(".error").html("");
		}
		
		if($(this).attr("id") == "wt_input_memail" || $(this).attr("id") == "wt_input_femail")
		{
			if(!validateEmail($(this).val())) 
			{
				bOK = 0;
				$(this).css("border-color", "#7e0700");
				$(this).parent().find(".error").html("Email ist nicht korrekt");
			}
			else
			{
				$(this).css("border-color", "#a7a7a7");
				$(this).parent().find(".error").html("");
			}	
		}
	});
	
	/* Pruefen ob TNID, VariantTNID definiert sind */
	if(!TreeNodeID || !VariantTreeNodeID) 
	{
		bOK =0;
		alert("TNID oder VariantTNID ist nicht definiert");
	} 
	
	/* Wenn alles ok ist, starten Ajax request */
	if(bOK == 1) 
	{
		var AbsenderName  = $("#wt_input_mname").val();
		var AbsenderEmail = $("#wt_input_memail").val();
		var FreundName	  = $("#wt_input_fname").val();
		var FreundEmail	  = $("#wt_input_femail").val();
		var Nachricht	  = "";
		
		$("#wt_textarea_nachricht").val().length > 500 ? Nachricht = $("#wt_textarea_nachricht").val().substr(0, 500) : Nachricht = $("#wt_textarea_nachricht").val();
		
		$.ajax(
		{
			type: "POST",
			url: base_url+"/index.php?screen=mi.emailtofriend_layer",
			data: {
					TreeNodeID:TreeNodeID, 
					VariantTreeNodeID:VariantTreeNodeID,
					AbsenderName:AbsenderName,
					AbsenderEmail:AbsenderEmail,
					FreundName:FreundName,
					FreundEmail:FreundEmail,
					Nachricht:Nachricht
				  },
			dataType: "json",
			success: function (data)
			{	
				//alert(data.ATTEMP_COUNT);
				if(data.RESULT == 1) {
					if (data.MESSAGE != '')
					{
						//$("#WeiterEmpfehlenBox").fadeOut();
						//$("#WeiterEmpfehlenBoxSuccess").css("display", "block");
						//$("#WeiterEmpfehlenBoxSuccess .box_message").html(unescape(data.MESSAGE.msg))
						//setTimeout("$('#WeiterEmpfehlenBoxSuccess').fadeOut()", 2000);
						$(".weiterempfehlen_form_content").css("display", "none");
						$("#WeiterEmpfehlenBoxSuccess").css("display", "block");
						$("#WeiterEmpfehlenBoxSuccess .box_message").html(unescape(data.MESSAGE));
					}
					//Omniture 
					s.linkTrackVars = 'products,events,eVar16';
					s.linkTrackEvents = 'event16';
					s.events = 'event16';
					s.eVar16 = 'Artikel weiterempfehlen';
					s.tl(true,'o','Artikel weiterempfehlen'); //es sollen nur Teile getracked werden als Custom Link ('o')
				}else{
					//$("#WeiterEmpfehlenBox").fadeOut();
					//$("#WeiterEmpfehlenBoxFailed").css("display", "block");
					//$("#WeiterEmpfehlenBoxFailed .box_message").html(unescape(data.MESSAGE.msg))
					//setTimeout("$('#WeiterEmpfehlenBoxFailed').fadeOut()", 2000);
					$(".weiterempfehlen_form_content").css("display", "none");
					$("#WeiterEmpfehlenBoxFailed").css("display", "block");
					$("#WeiterEmpfehlenBoxFailed .box_message").html(unescape(data.MESSAGE));
					
				}// data.RESULT == 1
				
				if(data.ATTEMP_COUNT >= 5) 
					$("#WeiterEmfehlenBoxSuccessLink").html("");
				$("#WEAnzahl").val(data.ATTEMP_COUNT);
			} // success: function (data)
		}); // jQuery.ajax(		
	} // if(bOK == 1)
} // function AjaxWeiterEmpfehlen() 

function ShowADSProduct(TreeNodeID, VariantTreeNodeID, RecommendationID)
{
	if(location.href.indexOf('https://') == 0)
		var AJAX_URL = 'https://www.frontlineshop.com/index.php?screen=aj.ads&TreeNodeID='+TreeNodeID+'&VariantTreeNodeID='+VariantTreeNodeID;
	else
		var AJAX_URL = 'http://www.frontlineshop.com/index.php?screen=aj.ads&TreeNodeID='+TreeNodeID+'&VariantTreeNodeID='+VariantTreeNodeID;
	
	//alert(AJAX_URL);
	
	jQuery.ajax(
	{
		type: "GET",
		url: AJAX_URL,
		dataType: 'json',
		success: function (data)
		{	
			dialogInnerHTML = '<div class="ModalContentContainer ADS" id="ModalContentContainer">'
				+ '<div class="ModalContentSpacer">'
				+ '<div style="padding: 10px 0px 6px 0px;">'
				+ '<div class="fright Close"><a href="#" onclick="DialogClose();" title="Schließen"></a></div>'
				+ '<div class="clearer"></div>'
				+ '</div>'
				+ '<div style="padding: 0px 6px;">'
				+ '<div style="padding: 8px 5px; display: none;">'
				+ '<div id="ModalContentHeadline">&nbsp;</div>'
				+ '<div id="ModalContentSubject">&nbsp;</div>'
				+ '</div>' 
				+ '<div class="ModalContentFrameContainer">'
				+ '<div class="ModalContentFrameTextContainer">'
				+ '<div id="ModalContentFrameText" style="height:auto; overflow:hidden;">'+ unescape(data.CONTENT) +'</div>'
				+ '</div></div></div></div></div>';

			if (!dialog.dialog('isOpen'))
			{
				dialog.html(dialogInnerHTML);			
				dialog.dialog({width:740});
				dialog.dialog('open');	
				dialog.dialog("option", "position", "center");
				displayPortofrei();
			}
			else
				dialog.html(dialogInnerHTML);
				
			// OnMouseOverZoom initialisieren
			if (Z_BID > 0 && Z_BCVID > 0 && Z_ImageID && dialog.dialog("isOpen"))
				ADSVIEW(Z_BID, Z_BCVID, Z_ImageID, 0);
			
			/*
			//Omniture Tracking
			if(data.TRACKING) 
				OmnitureAjaxTracking(data.TRACKING);
			*/
		} // onSuccess: function(transport)
	}); // jQuery.ajax(
} // function ShowADSProduct(TreeNodeID, VariantTreeNodeID, RecommendationID)

function ShowXmasService()
{
	var XSDIV='';
	XSDIV += '<div style="float:left;background-image:url('+base_url+'/customGates/resources/binaries/universal/backgrounds/xmas_versprechen.png?v=2);width:413px;height:384px;">';
	XSDIV += '	<div style="padding-left: 393px;padding-top:7px;">';
	XSDIV += '		<div class="Close">';
	XSDIV += '			<a href="#" onclick="DialogClose();return false;" title="Schließen"></a>';
	XSDIV += '		</div>';
	XSDIV += '		<div class="clearer"></div>';
	XSDIV += '	</div>';
	XSDIV += '	<div style="padding-top:75px;padding-left:0px;color:#2f3037;">';
	XSDIV += '	<ul style="font-size:14px;color:#2f3037">';
	XSDIV += '		<li style="padding-bottom:15px;"><b>Liefergarantie:</b> Bis zum 19.12 um 23:59 Uhr<br>bestellen, garantiert bis zum 24.12.2011<br>geliefert - ohne Aufschlag!</li>';
	XSDIV += '		<li style="padding-bottom:15px;"><b>Expresslieferung:</b> Bis zum 23.12 um 17 Uhr per<br>Expressversand bestellen, garantiert p&uuml;nktliche<br>Lieferung am 24.12. (gegen Aufschlag)</li>';
	XSDIV += '		<li style="padding-bottom:15px;"><b>Versandkostenfreie Lieferung</b> ab einem<br>Bestellwert von 80&euro;</li>';
	XSDIV += '		<li style="padding-bottom:15px;"><b>Zahlung auf Rechnung</b> (Bonit&auml;t vorausgesetzt,<br>gegen Aufschlag)</li>';
	XSDIV += '		<li style="padding-bottom:15px;"><b>100 Tage R&uuml;ckgaberecht</li>';
	XSDIV += '	</ul>';
	XSDIV += '	</div>';
	XSDIV += '</div>';
	
	dialog.html(XSDIV);
	dialog.dialog({width:413});
	dialog.dialog('open');
	dialog.dialog("option", "position", "center");	
}

function ShowZoom(zpos, zindex)
{
	imageURL = new Array();
	imageName = new Array();
	
	for(i=0; i < imageURLs[zpos].length; i++)
	{
		imageURL[i] = imageURLs[zpos][i];
		imageName[i] = imageNames[zpos][i];
	} // for(i=0; i < imageURLs[zpos].length; i++)
	OpenFullScreenDialog(zindex);
} // function ShowZoom(zpos, zindex)

function initIntCampNavigationTracking(campaingScreen,campaingAreaPrefix,campaignPrefix) {
	//HauptNavigations-Punkte
	jQuery('#NaviTable div[class="NaviElement"] a').click(function(){
		var title = jQuery(this).attr('title');
		var int_camp = '';
		if(title == 'Shop')
			int_camp = campaingScreen+'_'+campaingAreaPrefix+'1_'+campaignPrefix+title+'_K_000000_20123101_C';
		else if(title == 'Brandneu')
			int_camp = campaingScreen+'_'+campaingAreaPrefix+'2_'+campaignPrefix+title+'_K_000000_20123101_C';
		else if(title == 'Marken' || title == 'Brands')
			int_camp = campaingScreen+'_'+campaingAreaPrefix+'3_'+campaignPrefix+'Brands_K_000000_20123101_B';
		else if(title == 'Sale')
			int_camp = campaingScreen+'_'+campaingAreaPrefix+'4_'+campaignPrefix+'Sale_K_000000_20123101_S';
		else if(title == 'Blog')
			int_camp = campaingScreen+'_'+campaingAreaPrefix+'5_'+campaignPrefix+title+'_N_000000_20123101_T';
		if(int_camp != '') {
			//Omniture 
		    s.linkTrackVars = 'eVar2'; 
		    s.linkTrackEvents = 'None';
		    s.eVar2 = int_camp;
			s.tl(true,'o','MainNaviClick');
		}
	});	
	//Untermenü-Punkte
	jQuery('div[class="SubNavi"]').each(function(){
		var title = jQuery(this).parent().attr('id').replace(/ImageSub/g,'');
		var int_camp_prefix = '';
		var int_camp_suffix = '';
		if(title == 'Shop') {
			int_camp_prefix = campaingScreen+'_'+campaingAreaPrefix+'1_'+campaignPrefix+title;
			int_camp_suffix ='K_000000_20123101_C';
		} else if(title == 'Brandneu') {
			int_camp_prefix = campaingScreen+'_'+campaingAreaPrefix+'2_'+campaignPrefix+title;
			int_camp_suffix = 'K_000000_20123101_C';
		} else if(title == 'Marken' || title == 'Brands') {
			int_camp_prefix = campaingScreen+'_'+campaingAreaPrefix+'3_'+campaignPrefix+'Brands';
			int_camp_suffix = 'K_000000_20123101_B';
		} else if(title == 'Sale') {
			int_camp_prefix = campaingScreen+'_'+campaingAreaPrefix+'4_'+campaignPrefix+'Sale';
			int_camp_suffix = 'K_000000_20123101_S';
		} else if(title == 'Blog') {
			int_camp_prefix = campaingScreen+'_'+campaingAreaPrefix+'5_'+campaignPrefix+title;
			int_camp_suffix = 'N_000000_20123101_T';
		}	
		if(int_camp_prefix != '' && int_camp_suffix != '') {
			jQuery('a',this).each(function(index,link){
				if(jQuery(link).attr('href').search(/intCamp/g) == -1) { //nur wenn noch kein IntCamp um href
					jQuery(link).click(function(){
						var link_content_title = '';
						link_content_title = jQuery(link).text().replace(/ä/i,'ae').replace(/ö/i,'oe').replace(/ü/i,'ue').replace(/ß/i,'ss').replace(/\W/gi,''); //das Target in bereinigter Form dem Campaign-Name hinzufügen
						var int_camp = int_camp_prefix+link_content_title+'_'+int_camp_suffix;
						if(int_camp != '') {
							//Omniture 
						    s.linkTrackVars = 'eVar2'; 
						    s.linkTrackEvents = 'None';
						    s.eVar2 = int_camp;
							s.tl(true,'o','SubNaviClick');
						}
					});
				}
			})
		}
	});
}

function trackIntCampSearchButtonClick(screen,searchFormName) {
	if(typeof(searchFormName) != 'undefined' && searchFormName == 'search_word_inc') {
		var qpm = document.search_word_inc.query.value;
		if(qpm == '' || qpm == 'Suchbegriff eingeben...' || qpm.search(/\^/g) != -1) {
			return true;
		}
	} else if(typeof(searchFormName) != 'undefined' && searchFormName == 'search_word_inc2') {
		var qpm = document.search_word_inc2.query.value;
		if(qpm == '' || qpm == 'Neue Suche starten?' || qpm.search(/\^/g) != -1) {
			return true;
		}
	} else {
		return true; //auch aussteigen wenn das searchFormName abweicht
	}	
	var int_camp = '';
	if(typeof(screen) != 'undefined' && screen != '') {
		//ACHTUNG auf wunsch aktuell nur auf me.home und wo.home
		if(screen == 'me.home') {
			int_camp += 'HM_';
		} else if(screen == 'wo.home') {
			int_camp += 'HW_';
		} else  {
			return true;
		}
		int_camp += 'A0_'; //ist so vorgegeben
		if(typeof(s.eVar45) != 'undefined') {
			int_camp += s.eVar45.replace(/ä/i,'ae').replace(/ö/i,'oe').replace(/ü/i,'ue').replace(/ß/i,'ss').replace(/\W/gi,'')+'_';
		} else if(typeof(s.hier1) != 'undefined') {
			int_camp += s.hier1.replace(/ä/i,'ae').replace(/ö/i,'oe').replace(/ü/i,'ue').replace(/ß/i,'ss').replace(/\W/gi,'')+'_';
		} else {
			return true; //nichts tracken aber zurück zur aufrufenden function
		}
		int_camp += 'S_000000_20123101_C';
		if(int_camp != '') {
			//Omniture 
		    s.linkTrackVars = 'eVar2'; 
		    s.linkTrackEvents = 'None';
		    s.eVar2 = int_camp;
			s.tl(true,'o','SearchClick');
		}
	}
}

