function iD(id) {
  return document.getElementById(id);
}

function getRP(name){
   if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))
      return decodeURIComponent(name[1]);
}

function dUrl() {
  return location.protocol+'//'+location.host;
}

function dBase() {
  if(Drupal.settings.basePath==undefined){return '/'};
  return Drupal.settings.basePath;
}

(function ($) {
jQuery.fn.reverse = [].reverse;
})(jQuery);

var cookieName = "Drupal.visitor.aluBackgroundSoundState";

var isIntro = false;
function introo(){
	if(isIntro){
	fadeBut();
	
	(function ($) {
	$('#nIBack > span').animate({'fontSize': '1em'}, 2500, 'swing', function(){iD('nIBack').innerHTML='<img id="playV" class="trans" src="/themes/iAlu/images/playV.png" alt="Play Video"/>';});
	})(jQuery);
	
	iD('navi').style.height='285px';
	iD('headA').style.right='1300px';
	iD('headA').style.visibility='visible';
	(function ($) {
	$('#headA').animate({'right': '-=1300px'}, 1500, 'swing', function(){iStepTwo();});
	})(jQuery);
	}
}
function iStepTwo(){
	iD('headB').style.right='1300px';
	iD('headB').style.visibility='visible';
	(function ($) {
	$('#headB').animate({'right': '-=1300px'}, 1500, 'swing', function(){iStepThree();});
	})(jQuery);
}
function iStepThree(){
	iD('wheel').style.right='1300px';
	iD('wheel').style.visibility='visible';
	iD('wheel').src=dBase()+'themes/iAlu/images/rWheel_r_s.gif';
	(function ($) {
	$('#wheel').animate({'right': '-=1300px'}, 1500, 'swing', function(){iD('wheel').src=dBase()+'themes/iAlu/images/rWheel.png';});
	})(jQuery);
}
/*function iStepFour(){
	(function ($) {
	$('#nIBack').animate({'opacity': '0'}, 1, 'swing');
	iD('nIBack').style.background='url('+dBase()+'themes/iAlu/images/header_bild_startseite.jpg) 0 0 no-repeat';
	$('#nIBack').animate({'opacity': '1'}, 1500, 'swing', function(){iStepFive();});
	})(jQuery);
}
function iStepFive(){
	iD('playV').style.visibility='visible';
	iD('startpage').style.visibility='visible';
	//iD('startpageFBframe').style.visibility='visible';
	fadeBut();
}*/

function fadeBut(){	
	(function ($) {
	if($('#imgButtonStart').css('opacity') != '1'){
		$('#imgButtonStart').animate({'opacity': '1'}, 1500, 'swing', function(){fadeBut();});
	}else{
		$('#imgButtonStart').animate({'opacity': '0.1'}, 1500, 'swing', function(){fadeBut();});
	}
	})(jQuery);
}



function showVid(){
  var vidmid = document.createElement('div');
  vidmid.setAttribute('id', 'vidmid');
  vidmid.innerHTML='<h3 class="backed"><a href="#" onclick="return hideVid();">schliessen</a></h3>';
//  vidmid.innerHTML=vidmid.innerHTML+'<div><object width="420" height="286" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="flashObj"><param value="http://c.brightcove.com/services/viewer/federated_f9/25685786001?isVid=1&amp;publisherID=687883056" name="movie"><param value="#FFFFFF" name="bgcolor"><param value="videoId=56083833001&amp;playerID=25685786001&amp;domain=embed&amp;" name="flashVars"><param value="http://admin.brightcove.com" name="base"><param value="false" name="seamlesstabbing"><param value="true" name="allowFullScreen"><param value="true" name="swLiveConnect"><param value="always" name="allowScriptAccess"><embed width="420" height="286" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" allowscriptaccess="always" swliveconnect="true" allowfullscreen="true" type="application/x-shockwave-flash" seamlesstabbing="false" name="flashObj" base="http://admin.brightcove.com" flashvars="videoId=56083833001&amp;playerID=25685786001&amp;domain=embed&amp;" bgcolor="#FFFFFF" src="http://c.brightcove.com/services/viewer/federated_f9/25685786001?isVid=1&amp;publisherID=687883056"></object></div>';

(function ($) {
if($.browser.msie){
  	vidmid.innerHTML=vidmid.innerHTML+'<div><embed width="840" height="572" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" allowscriptaccess="always" swliveconnect="true" allowfullscreen="true" type="application/x-shockwave-flash" seamlesstabbing="false" name="flashObj" base="http://admin.brightcove.com" flashvars="videoId=56083833001&amp;playerID=25685786001&amp;domain=embed&amp;" bgcolor="#FFFFFF" src="http://c.brightcove.com/services/viewer/federated_f9/25685786001?isVid=1&amp;publisherID=687883056"/></div>';
  } else {
	vidmid.innerHTML=vidmid.innerHTML+'<div><object width="840" height="572" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="flashObj"><param value="http://c.brightcove.com/services/viewer/federated_f9/25685786001?isVid=1&amp;publisherID=687883056" name="movie"><param value="#FFFFFF" name="bgcolor"><param value="videoId=56083833001&amp;playerID=25685786001&amp;domain=embed&amp;" name="flashVars"><param value="http://admin.brightcove.com" name="base"><param value="false" name="seamlesstabbing"><param value="true" name="allowFullScreen"><param value="true" name="swLiveConnect"><param value="always" name="allowScriptAccess"><embed width="840" height="572" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" allowscriptaccess="always" swliveconnect="true" allowfullscreen="true" type="application/x-shockwave-flash" seamlesstabbing="false" name="flashObj" base="http://admin.brightcove.com" flashvars="videoId=56083833001&amp;playerID=25685786001&amp;domain=embed&amp;" bgcolor="#FFFFFF" src="http://c.brightcove.com/services/viewer/federated_f9/25685786001?isVid=1&amp;publisherID=687883056"></object></div>';  
  }
})(jQuery);
  vidmid.innerHTML=vidmid.innerHTML+'<h3 class="backed"><a href="#" onclick="return hideVid();">schliessen</a></h3>';
  jQuery(vidmid).appendTo('body');
  return false;
}

function hideVid(){
  jQuery('#vidmid').remove();
  return false;
}

function IsAudioSupported(){
	/*try {
    	myAudioObj = new Audio(""); 
		audioObjSupport = !!(myAudioObj.canPlayType);
		basicAudioSupport = !!(!audioObjSupport ? myAudioObj.play : false);
	} catch (e) {
		audioObjSupport = false;
		basicAudioSupport = false;
	}
	return audioObjSupport;*/
	var myAudio = document.createElement('audio'); 
    
    return !!myAudio.canPlayType;
}

function addSound(s, e, auto){
	var sObj;
	var QtPlugin = false;
	var WMPPlugin = false;
	if(navigator.plugins != null && navigator.plugins.length > 0){
		for(var i in navigator.plugins) {
			var pObj = navigator.plugins[i];
			if(pObj.name != null && pObj.name != undefined){
				if(pObj.name.indexOf('Quick')!=-1){
					QtPlugin = true;
				}
				if(pObj.name.indexOf('Windows Media Player')!=-1){
					WMPPlugin = true;
				}
			}
		}
	}

	/*alert(QtPlugin);
	alert(WMPPlugin);*/
	
	(function ($) {
		if($.browser.msie /*&& parseInt($.browser.version)<9*/){
			/* due to some C++ error on my vaio .. */
			sObj = '<embed type="application/x-mplayer2" src="'+dBase()+'themes/iAlu/files/'+s+'" hidden="true" autostart="'+(auto==1)+'" loop="false"></embed>';
		}else{
			var altStr = 'alt : <a href="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".mp3")+'">'+s.replace(".wav", ".mp3")+'</a>';

			if(QtPlugin){
				sObj =  '<object type="audio/wav" data="'+dBase()+'themes/iAlu/files/'+s+'" width="0" height="0"><param name="src" value="'+dBase()+'themes/iAlu/files/'+s+'"/><param name="autoplay" value="'+(auto==1)+'"/><param name="autoStart" value="'+auto+'"/>'+altStr+'</object>';
				//sObj =  '<object type="audio/wav" data="'+dBase()+'themes/iAlu/files/'+s+'" width="0" height="0"><param name="src" value="'+dBase()+'themes/iAlu/files/'+s+'"/><param name="autoplay" value="'+(auto==1)+'"/><param name="autoStart" value="'+auto+'"/><object type="audio/mpeg" data="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".mp3")+'" width="0" height="0"><param name="src" value="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".mp3")+'"/><param name="autoplay" value="'+(auto==1)+'"/><param name="autoStart" value="'+auto+'"/>'+altStr+'</object></object>';
				//sObj =  '<object type="audio/mpeg" data="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".mp3")+'" width="0" height="0"><param name="src" value="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".mp3")+'"/><param name="autoplay" value="'+(auto==1)+'"/><param name="autoStart" value="'+auto+'"/><object type="audio/wav" data="'+dBase()+'themes/iAlu/files/'+s+'" width="0" height="0"><param name="src" value="'+dBase()+'themes/iAlu/files/'+s+'"/><param name="autoplay" value="'+(auto==1)+'"/><param name="autoStart" value="'+auto+'"/>'+altStr+'</object></object>';
			} else if(WMPPlugin){
				sObj = '<object type="application/x-mplayer2" width="0" height="0"><param name="fileName" value="'+dUrl()+dBase()+'themes/iAlu/files/'+s+'"/><param name="autoplay" value="'+(auto==1)+'"/><param name="autoStart" value="'+auto+'"/>'+altStr+'</object>';
			} else if(auto==1){
				sObj = '<object type="application/ogg" data="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".ogg")+'" width="0" height="0" autostart="'+auto+'" autoplay="'+(auto==1)+'"><param name="src" value="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".ogg")+'"/>'+altStr+'</object>';
			}
		}

		if($.browser.mozilla && IsAudioSupported()){
			var autoPlay = (auto==0 ? '' : ' autoplay')
			sObj = '<audio src="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".ogg")+'" preload="auto" autobuffer'+autoPlay+'><source src="'+dBase()+'themes/iAlu/files/'+s.replace(".wav", ".mp3")+'"/><source src="'+dBase()+'themes/iAlu/files/'+s+'"/>'+sObj+'</audio>';
		}
		//alert(sObj);
		$(e).append(sObj);
	})(jQuery);
	
	return sObj;
}

var eSounds=['tunnel.wav', 'mav.wav', 'bmw.wav', 'maverick.wav', 'geneve.wav'];

(function ($) {
$(document).ready(function() {
	/*$('#jq-tkr').ticker({
		speed: 0.10,
		debugMode: false,
		controls: false,
		titleText: '',
		pauseOnItems: 1500,
		fadeInSpeed: 500,
		fadeOutSpeed: 500
	});*/

if(isIntro){
	var cookieVal = $.cookie(cookieName);

       if((cookieVal!=null && cookieVal!='')){
       $('#buttonStart').attr('href', 'der-Schweiz-grösster-Felgenhandel');
       }
       
      $('#buttonStart').click(function(){
       
       
	//addSound('geneve.wav', $('#sound'), 1);
	//$('#sound').html(addSound('gS.wav', null, 1));
        //setTimeout('(function ($) {$(\'#full\').effect(\'shake\', {times:40}, 60 );})(jQuery);', 400);
	//$('#full').effect('shake', {times:20}, 60 );
	$(this).html('<img src="'+dBase()+'themes/iAlu/images/tacho.png" alt="Tacho"/>');	
	$('img', this).css('opacity', '0.1');
	$('img', this).supersleight({shim: dBase()+'themes/iAlu/images/x.gif'});
	$('img', this).animate({'opacity': '1'}, 1500, 'swing');
	setTimeout('window.location=\''+this.href+'\'', 200);
      });
      

   
    //addSound('gS.wav', $('#preloadSound'), 0);

    /*if($.browser.msie){
    window.setTimeout(switchLoading, 2000);
    }else{
      $(window).load(function() {
        switchLoading();
      });
    }*/
    switchLoading();

} else {
pageLoad();
}


   });
   
})(jQuery);

function switchLoading(){
	//document.body.style.background = '#fff';
	(function ($) {
      //$('#hideme').css('display', 'none');
      $('#full').css('opacity', '0.1');
      $('#full').css('display', '');
      $('#full').animate({'opacity': '1'}, 1500, 'swing');
      })(jQuery);
      pageLoad();
      introo();
      (function ($) {addSound('story.wav', $('#sound'), 1);})(jQuery);
}

function pageLoad(){
	(function ($){
	var uaLC = navigator.userAgent.toLowerCase();
	var pathName = location.pathname;

	var cookieVal = $.cookie(cookieName);
	
	if(!/googlebot/.test(uaLC) &&
	!/yahoo/.test(uaLC) &&
	!/facebook/.test(uaLC) &&
	!/msnbot/.test(uaLC) &&
	getRP('print') == undefined &&
	(cookieVal!=null && cookieVal!='')){
	if(!parent.main_frame){
		if(document.frames || window.frames){
			if(pathName != '/' && pathName != '' && pathName != '/node'){
				window.location.replace('http://'+window.location.host+dBase()+'der-Schweiz-grösster-Felgenhandel?t='+pathName);
			}
		}
	} else if(pathName == '/' || pathName == '' || pathName == '/node') {
		parent.location.replace('http://'+window.location.host+dBase());
	}
	}
	})(jQuery);


  tickCount = iD("CONTICKER").firstChild.childNodes.length;
TICKER_CONTENT = iD("CONTICKER").firstChild.childNodes[tickElem].innerHTML;
ticker_start();
/*if(iD('POpage') == undefined){
gapi.plusone.render("POwrap", {"annotation":"inline", "href": "http://alufelgenboerse.ch"});
}*/
(function ($) {
      
      
     /* var menuz = ['webshop', 'links', 'felgen', 'fragen', 'zubehoer', 'tech', 'reparaturen', 'dtc'];
      for ( var i=0, len=menuz.length; i<len; ++i ){
		var tName = '_'+menuz[i];
		
		      $("#aZoomWrp"+tName).anythingZoomer({
    	
      expansionSize: 0,      // How far outside the wrap edges the mouse can go
      speedMultiplier: 1,   // How much faster in the inside area moves than the mouse
      
      smallArea: "#aZoomS"+tName,    // Overrides small area ID
      largeArea: "#aZoomL"+tName,    // Overrides large area ID
      zoomPort: "#aZoomO"+tName,   // Overrides zoom overlay area ID
      mover: "#aZoomM"+tName         // Overrides mover ID
    	
		});
	}*/
	
	$('#block-system-main-menu > div > a').mouseenter(function(){
		var meIs = $('span', this).attr('class');
		$('span > .shakeME', this).animate({'width': '60px'}, 500, 'swing');
		if(meIs != undefined) { $('#linkButton'+meIs).attr('src', dBase()+'themes/iAlu/images/menu_'+meIs+'_m.png'); }
	}).mouseleave(function(){
		var meIs = $('span', this).attr('class');
		$('span > .shakeME', this).animate({'width': '50px'}, 500, 'swing');
		if(meIs != undefined) { $('#linkButton'+meIs).attr('src', dBase()+'themes/iAlu/images/menu_'+meIs+'_p.png'); }
	});
      
      if(!parent.main_frame){
      	$('#soundswitch > img').attr('src', dBase()+'themes/iAlu/images/snd-off.png');
      	$('#soundswitch > img').attr('alt', 'Musik einschalten');
      }
      
      $("#soundswitch").hover(function(){toggleSndSwitch(this);},function(){toggleSndSwitch(this);});
      $("#soundswitch").click(function(){$(this).stop(true, false); toggleSndSwitch();});
      
      $("#FBlikebox").hover(function(){
	  $("#FBlikebox").stop(true, false).animate({right:"0"},"medium");},function(){
					$("#FBlikebox").stop(true, false).animate({right:"-538"},"medium");
					},500);
					
	  /*$("#POlikebox").hover(function(){
	  $("#POlikebox").stop(true, false).animate({left:"0"},"medium");},function(){
					$("#POlikebox").stop(true, false).animate({left:"-450"},"medium");
					},500);*/
					
      /*$('.shakeME').effect('bounce', {times:10000}, 100);*/
      $('.logo').supersleight({shim: dBase()+'themes/iAlu/images/x.gif'});
      $('.shakeME').supersleight({shim: dBase()+'themes/iAlu/images/x.gif'});
      $('#pLogos').supersleight({shim: dBase()+'themes/iAlu/images/x.gif'});
      $('#imgButtonStart').supersleight({shim: dBase()+'themes/iAlu/images/x.gif'});
      $('.view-display-id-block_carousel_navi').supersleight({shim: dBase()+'themes/iAlu/images/x.gif'});
})(jQuery);

}

window.buttons = {}
function toggleButton(meis){

	var e = iD('linkButton'+meis);

  if(buttons[e]){
  	e.src = dBase()+'themes/iAlu/images/menu_'+meis+'_p.png';
  	buttons[e] = false;
  } else {
  	e.src = dBase()+'themes/iAlu/images/menu_'+meis+'_m.png';
  	buttons[e] = true;
  }
  return false;
}

window.boxes = {}
function toggleBox(e){

  if(boxes[e]){
  	e.style.borderTopColor = '#CCCCCC';
  	e.style.borderRightColor = '#939495';
  	e.style.borderBottomColor = '#939495';
  	e.style.borderLeftColor = '#CCCCCC';
  	boxes[e] = false;
  } else {
  	e.style.borderTopColor = '#EB6169';
  	e.style.borderRightColor = '#D10000';
  	e.style.borderBottomColor = '#D10000';
  	e.style.borderLeftColor = '#EB6169';
  	boxes[e] = true;
  }
  return false;
}

function toggleSndSwitch(e){
	(function ($) {
	if(e == null || e == undefined){
		var cookieVal = $.cookie(cookieName);
		var pathName = location.pathname;
		if(!parent.main_frame){
			//turn sound on
			$.cookie(cookieName, 'yes', { path: '/' });
			window.location.replace('http://'+window.location.host+dBase()+'der-Schweiz-grösster-Felgenhandel?t='+pathName);
		} else {
			//turn sound off
			$.cookie(cookieName, null, { path: '/' });
			parent.location.replace('http://'+window.location.host/*+dBase()*/+pathName);
		}	
	} else {
		e = $('img', e);
		var bSize = $(e).css('width');
		if(bSize.indexOf('40px') > -1){bSize = '128px';}
		else {bSize = '40px';}
		if($(e).attr('src').indexOf('on') > -1){
			$(e).attr('src', dBase()+'themes/iAlu/images/snd-off.png');
			$(e).animate({'width': bSize}, 500, 'swing');
		} else {
			$(e).attr('src',dBase()+'themes/iAlu/images/snd-on.png');
			$(e).animate({'width': bSize}, 500, 'swing');
		}
	}
	})(jQuery);
}


var bImgs=['header_bild_02.png', 'header_bild_03.png', 'header_bild_04.png', 'header_bild_05.png', 'header_bild_06.png', 'header_bild_07.png', 'header_bild_08.png', 'header_bild_09.png', 'header_bild_01.png'];
var iImg = 0;
window.preloadBimgs = {};

if(!isIntro){
	preloadBimgs[iImg] = new Image();
	preloadBimgs[iImg].src =  'http://'+window.location.host+dBase()+'themes/iAlu/images/'+bImgs[iImg];
	imgRot = function(){ return setInterval(function() { rotImg(); }, 8000); };
	new imgRot;
}

function rotImg(){
	(function ($) {
	$('#nBack').animate({'opacity': '0.1'}, 1500, 'swing', function(){showImg();});
	})(jQuery);
}

function showImg(){
	(function ($) {
	$('#nBack').css('opacity', '0');
	$('#nBack').css('background','url('+dBase()+'themes/iAlu/images/'+bImgs[iImg]+')');
	})(jQuery);
	if(iImg==bImgs.length-1) {
	   iImg=0;
 	}
 	iImg++;
	if(!preloadBimgs[iImg]){
		preloadBimgs[iImg] = new Image();
		preloadBimgs[iImg].src =  'http://'+window.location.host+dBase()+'themes/iAlu/images/'+bImgs[iImg];
	}
 	
	(function ($) {
	$('#nBack').animate({'opacity': '1'}, 1500, 'swing', function(){showImg;});
	})(jQuery);
}

if(!isIntro){
	logoRot = function(){ return setInterval(function() { startRot(); }, 7000); };
	new logoRot;
}
function startRot(){
	iD('wheel').src=dBase()+'themes/iAlu/images/rWheel_r_s.gif';
	setTimeout("(function ($) {$('#wheel').animate({'right': '-=1300px'}, 1500, 'swing', function() {rollBack();});})(jQuery);",1000);
}
function rollBack(){
	iD('wheel').style.right='1300px';
	(function ($) {
	$('#wheel').animate({'right': '-=1300px'}, 1500, 'swing', function(){iD('wheel').src=dBase()+'themes/iAlu/images/rWheel.png';});
	})(jQuery);
};

// WebTicker by Mioplanet
// www.mioplanet.com

var tickCount = 0;
var tickElem = 0;
 
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "";
TICKER_PAUSED = false;


function ticker_start() {
	var tickerSupported = false;
	TICKER_WIDTH = iD("TICKER").style.width;
	var img = "<img src='"+dBase()+"themes/iAlu/images/e.gif' width="+TICKER_WIDTH+" height=0>";
	// Firefox
	//if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
		iD("TICKER").innerHTML = "<TABLE border=0 cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
		tickerSupported = true;
	//}
	// IE
	/*if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
		document.getElementById("TICKER").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
		tickerSupported = true;
	}*/
	
	//if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; else {
	if(tickerSupported) {
		iD("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - iD("TICKER").offsetWidth : 0;
		iD("TICKER_BODY").innerHTML = TICKER_CONTENT;
		iD("TICKER").style.display="block";
		TICKER_tick();
	}
}

function TICKER_tick() {
	if(!TICKER_PAUSED) iD("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if(TICKER_RIGHTTOLEFT && iD("TICKER").scrollLeft <= 0){
		tickElem++;
		if(tickElem==tickCount){tickElem = 0;}
		iD("TICKER_BODY").innerHTML = iD("CONTICKER").firstChild.childNodes[tickElem].innerHTML;
		iD("TICKER").scrollLeft = iD("TICKER").scrollWidth - iD("TICKER").offsetWidth;
	}
	if(!TICKER_RIGHTTOLEFT && iD("TICKER").scrollLeft >= iD("TICKER").scrollWidth - iD("TICKER").offsetWidth){
		tickElem++;
		if(tickElem==tickCount){tickElem = 0;}
		iD("TICKER_BODY").innerHTML = iD("CONTICKER").firstChild.childNodes[tickElem].innerHTML;
		iD("TICKER").scrollLeft = 0;
	}
  window.setTimeout("TICKER_tick()", 30);
}
;
/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};;
jQuery.fn.supersleight = function(settings) {
	settings = jQuery.extend({
		imgs: true,
		backgrounds: true,
		shim: 'x.gif',
		apply_positioning: true
	}, settings);
	
	return this.each(function(){
		if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) {
			jQuery(this).find('*').andSelf().each(function(i,obj) {
				var self = jQuery(obj);
				// background pngs
				if (settings.backgrounds && self.css('background-image').match(/\.png/i) !== null) {
					var bg = self.css('background-image');
					var src = bg.substring(5,bg.length-2);
					var mode = (self.css('background-repeat') == 'no-repeat' ? 'crop' : 'scale');
					var styles = {
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')",
						'background-image': 'url('+settings.shim+')'
					};
					self.css(styles);
				};
				// image elements
				if (settings.imgs && self.is('img[src$=png]')){
					var styles = {
						'width': self.width() + 'px',
						'height': self.height() + 'px',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + self.attr('src') + "', sizingMethod='scale')"
					};
					self.css(styles).attr('src', settings.shim);
				};
				// apply position to 'active' elements
				if (settings.apply_positioning && self.is('a, input') && (self.css('position') === '' || self.css('position') == 'static')){
					self.css('position', 'relative');
				};
			});
		};
	});
};;

