            var xmlPathHeader = "images/stories/header/phheaderMain.xml";//erase me
			var timeTimer = 5000;var aniSpeed = 1000;
			var headersArray=new Array();var dotsArray=new Array();
			var indice=0;var zPos=1;var maxHeaders=1;var autoplay = true;
			function play(){
				zPos++;
				if (indice+1 <= maxHeaders){
					indice++;
					$('.numIndice').css('background-position','0px -67px');
					dotsArray[indice].css('background-position','0px -83px');
					headersArray[indice].hide();
					headersArray[indice].css('z-index',zPos);
					headersArray[indice].fadeIn(aniSpeed);
				}else{
					indice=1;
					$('.numIndice').css('background-position','0px -67px');
					dotsArray[indice].css('background-position','0px -83px');
					headersArray[indice].hide();
					headersArray[indice].css('z-index',zPos);
					headersArray[indice].fadeIn(aniSpeed);
				}
				if (zPos > 20) {
					zPos = 1;
					for (i = 1; i <= headersArray.length; i++) {
						if (typeof(headersArray[i]) != 'undefined') {
							if (headersArray[i] != headersArray[indice]) {
								headersArray[i].css('z-index', 0);
							}
						}
					}
					headersArray[indice].css('z-index', 1);
				}
				timer=setTimeout("play()",timeTimer);
			}
			function stop(){
				clearTimeout(timer);
			}
			//Google Api loader
			//google.load("jquery", "1.3.2");
			//google.load("swfobject", "2.2");
            //google.setOnLoadCallback(function(){
                $(document).ready(function(){
                    if (typeof(xmlPathHeader)=='undefined'){return;}
					$.get(xmlPathHeader, function(xml){
                        $('#headerIndex').append('<div class="leftIndice"></div>');
						$(xml).find('slide').each(function(){
                            indice++;
							var $slide = $(this);
                            var title = $slide.attr("title");
							var promo = $slide.attr("promo");
                            var description = $slide.find('description').text();
                            var imageurl = $slide.attr('imageurl');
							var html = '<div class="headerImg"></div>';
							var linkurl = $slide.attr('url');
							$('#headerImg').append($(html));
							//html = '<div class="inforWrapper"><div class="infoLeft"></div><div class="infoCenter"><h3><span class="red">'+promo+'</span> '+title+'</h3><p>'+description+'</p></div><div class="infoRight"></div></div>';
							//$('#headerImg div:last').css('background-image',"url("+imageurl+")").html(html);
							//html = '<div class="inforWrapper"><div class="infoLeft"></div><div class="infoCenter"><h3><span class="red">'+promo+'</span> '+title+'</h3><p>'+description+'</p></div><div class="infoRight"></div></div>';
							//$('#headerImg div:last').css('background-image',"url("+imageurl+")");//.html(html);
							$('#headerImg div:last').css('background-image',"url("+imageurl+")").html('<a href="'+linkurl+'">&nbsp;</a>');
							headersArray[indice]=$('.headerImg:last');
							$('#headerIndex').append('<div class="numIndice" title="'+indice+'"></div>');
							dotsArray[indice]=$('.numIndice:last');
                        });
						$('#headerIndex').append('<div class="rightIndice"></div>');
						$('#headerIndex').append('<div class="playpause"></div>');
						/*Font replacement*/
						//Cufon.set('fontFamily','Zurich Blk BT').replace('#headerImg h3');
						//Cufon.replace('#headerImg p');
						//Cufon.set('fontFamily','Rough Draft').replace('h5');
						//Cufon.set('fontFamily','Tiza').replace('h6');
						//Cufon.set('fontFamily','Skooper').replace('#texta p');
						/*Listeners*/
						maxHeaders = $('.headerImg').length;
						indice = 1;zPos++;
						dotsArray[indice].css('background-position','0px -83px');
						headersArray[indice].css('z-index',zPos);
						$('.numIndice').click(function(){
							if (indice == $(this).attr("title")) return;
							stop();
							$('.numIndice').css('background-position','0px -67px');
							$(this).css('background-position','0px -83px');
							zPos++;
							indice = parseInt($(this).attr("title"));
							headersArray[indice].hide();
							headersArray[indice].css('z-index',zPos);
							headersArray[indice].fadeIn(aniSpeed);
							if (autoplay == true) {timer = setTimeout("play()", timeTimer);}
						})
						$('.leftIndice').click(function (){
							if (autoplay==true){
								stop();
								timer=setTimeout("play()",timeTimer);
							}
							zPos++;
							if (indice-1 >= 1){
								indice--;
								$('.numIndice').css('background-position','0px -67px');
								dotsArray[indice].css('background-position','0px -83px');
								headersArray[indice].hide();
								headersArray[indice].css('z-index',zPos);
								headersArray[indice].fadeIn(aniSpeed);
							}else{
								indice=maxHeaders;
								$('.numIndice').css('background-position','0px -67px');
								dotsArray[indice].css('background-position','0px -83px');
								headersArray[indice].hide();
								headersArray[indice].css('z-index',zPos);
								headersArray[indice].fadeIn(aniSpeed);
							}
							
						});
						$('.rightIndice').click(function (){
							if (autoplay==true){
								stop();
								timer=setTimeout("play()",timeTimer);
							}
							zPos++;
							if (indice+1 <= maxHeaders){
								indice++;
								$('.numIndice').css('background-position','0px -67px');
								dotsArray[indice].css('background-position','0px -83px');
								headersArray[indice].hide();
								headersArray[indice].css('z-index',zPos);
								headersArray[indice].fadeIn(aniSpeed);
							}else{
								indice=1;
								$('.numIndice').css('background-position','0px -67px');
								dotsArray[indice].css('background-position','0px -83px');
								headersArray[indice].hide();
								headersArray[indice].css('z-index',zPos);
								headersArray[indice].fadeIn(aniSpeed);
							}
						});
						
						$('.playpause').toggle(
							function(){
								$(this).css('background-position','0px -115px');
								autoplay=false;
								stop();
							},
							function(){
								$(this).css('background-position','0px -99px');
								stop();
								play();
								autoplay=true;
							}
						);
						
						
						//autoplay
						timer=setTimeout("play()",timeTimer);
						//end autoplay
                    });
					var flashvars = {};
					var params = {};
					params.wmode="transparent";
					
					$('#headerImg').append('<div id="myflash"><a class="downloadchip" href="http://www.pokerhost.com/register">&nbsp;</a></div>');
					//swfobject.embedSWF("images/stories/swf/download.swf", "myflash", "195", "232", "9.0.0","expressInstall.swf",flashvars ,params);
                //});
                
            });