;
function GSI_Widget_Tooltip(){this._width=200;this._heigth=100;this._arrowWidth=10;this._arrowHeight=10;this._activateOnHover=true;this._position='t';this._aTooltip=null;this._sufix=null;this._instances=[]};GSI_Widget_Tooltip.prototype=new GSI_Widget();GSI_Widget_Tooltip.prototype.name='tooltip';GSI_Widget_Tooltip.prototype.loadOrder=1;GSI_Widget_Tooltip.prototype.overTooltip=false;GSI_Widget_Tooltip.prototype._active=true;GSI_Widget_Tooltip.prototype._loadSteps=1;GSI_Widget_Tooltip.prototype.getLoadSteps=function(){return this._loadSteps};GSI_Widget_Tooltip.prototype._load=function(){var tRes=true;try{if(typeof GSI=="undefined")return false;if(!GSI.functions.isset(GSI.SID)){GSI.setError('Widget: '+this.name+' -> GSI.SID missing','WARNING');tRes=false};if(typeof GSI_Element_Tooltip=="undefined"){GSI.setError('Element: GSI_Element_Tooltip -> missing','WARNING');tRes=false}}catch(e){return false};return tRes};GSI_Widget_Tooltip.prototype.show=function(DOM,title,content,URL,width,pos,floating,height){var params=this._parseQuery(URL);params.width=width;params.position=pos;params.floating=floating;params.height=height;params.arrowWidth=10;params.arrowHeight=10;params.activateOnHover=false;params.sufix=null;this._aTooltip.start(DOM,content,params);this._aTooltip.show()};GSI_Widget_Tooltip.prototype.hide=function(){if(this._aTooltip)this._aTooltip.hide()};GSI_Widget_Tooltip.prototype._parseQuery=function(query){var Params=new Object();if(!query)return Params;var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2)continue;var key=unescape(KeyVal[0]),val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val};return Params};GSI_Widget_Tooltip.prototype._createTooltip=function(){return new GSI_Element_Tooltip()};GSI_Widget_Tooltip.prototype.init=function(){var _mthis=this;if(!this._load()){GSI.updateProgressBar(this.name+" "+GSI.dict.getText('JSAPI','widget_initiation_error'));return false};this.loaded=true;GSI.updateProgressBar(this.name+" "+GSI.dict.getText('JSAPI','widget_initiated'));this._aTooltip=GSI.factories.getFactory('element').createTooltip();$('.GSI_Tooltip').live('mouseover mouseleave',function(event){if(this['tooltip_initiated'])return;var aTitle=$('.GSI_Tooltip_Content',this).attr('title'),params=_mthis._parseQuery(aTitle);if($(this).hasClass("tooltip-floating"))params.floating=1;var aTooltip=_mthis._createTooltip();aTooltip.start(this,$('.GSI_Tooltip_Content',this).html(),{activateOnHover:_mthis._activateOnHover,position:params.position?params.position:_mthis._position,floating:params.floating==1?true:false,width:params.width?params.width:_mthis._width,height:params.height?params.height:_mthis._heigth,arrowWidth:params.arrowWidth?parseInt(params.arrowWidth):_mthis._arrowWidth,arrowHeight:params.arrowHeight?parseInt(params.arrowHeight):_mthis._arrowHeight,sufix:params.sufix?parseInt(params.sufix):_mthis._sufix});this.tooltip_initiated=true;_mthis._instances.push(aTooltip);if(event.type=='mouseover'){aTooltip.show();return}else{aTooltip.hide();return}});return true};var tW=new GSI_Widget_Tooltip();GSI.widgets.loadWidget(tW);
function GSI_Element(){this._settings={}};GSI_Element.prototype.start=function(placeHolder,settings){};GSI_Element.prototype._settings=null;GSI_Element.prototype._mergeSettings=function(obj){return GSI.functions.array_merge(this._settings,obj,true)};
function GSI_Element_Tooltip(){this._placeHolder;this._settings=this._mergeSettings({activateOnHover:true,forceHeight:false,position:'l',floating:false,width:250,height:100,arrowWidth:null,arrowHeight:null,sufix:null});this._tooltipObj=null;this._content=null};GSI_Element_Tooltip.prototype={start:function(aPlaceHolder,content,xtraSettings){var _mthis=this;this._placeHolder=$(aPlaceHolder);if(this._placeHolder.length!=1){GSI.setError('ERROR, a Tooltip got badly initiated Placeholder length not one','ERROR');return};this._settings=GSI.functions.array_merge(this._settings,xtraSettings);if(!this._settings['title'])this._settings['title']="&nbsp;";this._settings['position']=this._settings['position'].toLowerCase();this._content=content;this._create(this._content);if(this._settings['activateOnHover'])this._placeHolder.hover(function(){_mthis.show()},function(){_mthis.hide()})},show:function(){this._tooltipObj.appendTo('body').css(this._calculatePos()).show()},hide:function(){if(this._tooltipObj){this._tooltipObj.remove()}else GSI.setError('Calling Hide on non existent _tooltipObj variable','WARNING')},resetContent:function(content){this._content=content;$('.GSI_Tooltip_Copy',this._tooltipObj).html('<span>'+this._content+'</span>')},resetPlaceHolder:function(content,placeHolder){this._content=content;this._placeHolder=$(placeHolder);$('.GSI_Tooltip_Copy',this._tooltipObj).html('<span>'+this._content+'</span>')},_create:function(content){var _sufixClass="";if(this._settings['sufix'])_sufixClass=" GSI_Tooltip_specificFor_"+this._settings['sufix'];this._tooltipObj=$("<div class='GSI_Tooltip_Container"+_sufixClass+"'><div class='GSI_Tooltip_Arrow'><span></span></div><div class='GSI_Tooltip_Title'><span>"+this._settings['title']+"</span></div><div class='GSI_Tooltip_Copy'><span>"+content+"</span></div></div>");this._tooltipObj.appendTo('body');this._tooltipObj.css({width:this._settings['width']+'px',height:this._settings['height']+'px'});this._tooltipObj.css(this._calculatePos());this._tooltipObj.hide().remove()},_calculatePos:function(){var DOM=this._placeHolder.get(0),pos=this._settings['position'],de=document.documentElement,winWidth=self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth,winHeight=self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight,hasArea=winWidth-this._getAbsoluteLeft(DOM),ttWidth=this._tooltipObj.width(),objWidth=this._getElementWidth(DOM),posTop=null,posBot=null,posLeft=null,arrowOffset=null,css=new Array();if(pos=="l"&&hasArea>(parseInt(this._settings['width'])+this._placeHolder.width()+30)){$('.GSI_Tooltip_Arrow',this._tooltipObj).addClass('GSI_Tooltip_Arrow_Left').removeClass('GSI_Tooltip_Arrow_Right');arrowOffset=this._getElementWidth(DOM)+this._settings['arrowWidth'];posLeft=this._getAbsoluteLeft(DOM)+arrowOffset;css.left=posLeft+"px";css.top=this._getAbsoluteTop(DOM)+"px"}else if(pos=="r"||pos=="l"){$('.GSI_Tooltip_Arrow',this._tooltipObj).addClass('GSI_Tooltip_Arrow_Right').removeClass('GSI_Tooltip_Arrow_Left');posLeft=this._getAbsoluteLeft(DOM)-this._settings['width']-this._settings['arrowWidth'];css.left=posLeft+"px";css.top=this._getAbsoluteTop(DOM)+"px"}else if(pos=="t"){$('.GSI_Tooltip_Arrow',this._tooltipObj).addClass('GSI_Tooltip_Arrow_Top').removeClass('GSI_Tooltip_Arrow_Bottom');posBot=winHeight-this._getAbsoluteTop(DOM)+this._settings['arrowHeight'];posLeft=this._getAbsoluteLeft(DOM);if(ttWidth>objWidth){var offSet=(ttWidth-objWidth)/2;posLeft-=offSet}else{var offSet=(objWidth-ttWidth)/2;posLeft+=offSet};css.left=posLeft+"px";css.bottom=posBot+"px"}else{$('.GSI_Tooltip_Arrow',this._tooltipObj).addClass('GSI_Tooltip_Arrow_Bottom').removeClass('GSI_Tooltip_Arrow_Top');posTop=this._getAbsoluteTop(DOM)+this._getElementHeight(DOM)+this._settings['arrowHeight'];posLeft=this._getAbsoluteLeft(DOM);if(ttWidth>objWidth){var offSet=(ttWidth-objWidth)/2;posLeft-=offSet}else{var offSet=(objWidth-ttWidth)/2;posLeft+=offSet};css.left=posLeft+"px";css.top=posTop+"px"};if(this._settings['floating']){css.position='fixed'}else css.position='absolute';return css},_getElementWidth:function(DOMobject){return DOMobject.offsetWidth},_getElementHeight:function(DOMobject){return DOMobject.offsetHeight},_getAbsoluteLeft:function(DOMobject){o=DOMobject;oLeft=o.offsetLeft;while(o.offsetParent!=null){oParent=o.offsetParent;oLeft+=oParent.offsetLeft;o=oParent};return oLeft},_getAbsoluteTop:function(DOMobject){o=DOMobject;oTop=o.offsetTop;while(o.offsetParent!=null){oParent=o.offsetParent;oTop+=oParent.offsetTop;o=oParent};return oTop}};var tE=GSI_Element_Tooltip.prototype;GSI_Element_Tooltip.prototype=new GSI_Element();$.extend(GSI_Element_Tooltip.prototype,tE);
function GSI_ICC_TIGER_Element_Tooltip_ItemBox(){this._settings=this._mergeSettings({position:'t',width:150,height:50,arrowWidth:10,arrowHeight:10})};GSI_ICC_TIGER_Element_Tooltip_ItemBox.prototype=new GSI_Element_Tooltip();
function GSI_ICC_TIGER_Factory_Element(){};GSI_ICC_TIGER_Factory_Element.prototype=new GSI_Factory_Element();GSI_ICC_TIGER_Factory_Element.prototype.type='element';GSI_ICC_TIGER_Factory_Element.prototype.createTooltip=function(type){try{if(type=='ItemBox')return new GSI_ICC_TIGER_Element_Tooltip_ItemBox();return new GSI_Element_Tooltip()}catch(e){return new GSI_Element_Tooltip();GSI.setError('Resource: GSI_Element_Tooltip of type'+type+' cannot be created','ERROR')}};var tF=new GSI_ICC_TIGER_Factory_Element();GSI.factories.addFactory(tF);

/**
* $Id: Omniture.js 33621 2010-04-08 11:06:22Z iargent $
*@author: eherrera 
*@constructor
*/
function GSI_Tracker_Omniture(){
	
	function F(){};
	F.prototype = new GSI_Tracker;
	
	F.prototype.type = null;
	F.prototype.execute = function(request){
		var _mthis =this;
		
		_mthis.request = request;
		
		_mthis._run(); 
	};
	
	F.prototype._run = function(){
		var _mthis = this;
		_mthis._doExecute('');
	};
	
	F.prototype._doExecute = function(omnitureFileContent){
		var _mthis = this;
		
		var obj = _mthis._evalTrackingLines(_mthis._getTrackingLines());
		if (GSI.functions.count(obj) == 0) return;
		_mthis._clearValues(GSI_Omniture);
		GSI_Omniture = GSI.functions.array_merge(GSI_Omniture, obj);
		void(GSI_Omniture.t());		
	};
	
	F.prototype._evalTrackingLines = function(arrayTags){
		var s={};
		for(var aTag in arrayTags){
			if (aTag == 'indexOf') continue;
			eval(arrayTags[aTag]);
		}
		return s;
	};
	
	F.prototype._getTrackingLines = function(){
		//this method will be overwritten
	};
	
	F.prototype._clearValues = function(obj){
		for (var key in obj){
			var keyVal = key.substr(0,4);
			if (keyVal == 'prop' 
				|| keyVal == 'eVar'
				|| keyVal == 'g_eV'
				|| keyVal == 'g_pr') obj[key] = "";			
		}
		obj.pageName = "";
		obj.g_pageName = "";
		obj.channel = "";
		obj.g_channel = "";
		obj.events = "";
		obj.g_events = "";
		obj.products = "";		
		obj.g_products = "";
		obj._purchaseID = "";
	};
	
	return new F;
};
