$(function () {
	LoadImgBackground('/themes/yw2010/images/login-passwordm-text.gif', 'passwordm');
});

function LoadImgBackground(defaultimg, elementID) {     
	var inp = document.getElementById(elementID);
	inp.style.background = 'url(' + defaultimg + ') left center no-repeat #FFFFFF';
	inp.onfocus = function () {	
		this.style.background = '#fff'; // replace this with whatever background you wish,		
	}
	inp.onchange = function () {	
		this.style.background = '#fff'; // replace this with whatever background you wish,		
	}
	inp.onblur = function () {
		if (inp.value.length <= 0) {            
			this.style.background = 'url(' + defaultimg + ') left center no-repeat #FFFFFF';			
		}
	}
}

function marketing_initCallback(carousel){
	carousel.buttonNext.bind('click', function() {
	carousel.startAuto();
});
carousel.buttonPrev.bind('click', function() {
carousel.startAuto();
});
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};

jQuery(document).ready(function() {
	jQuery('#marketing').jcarousel({scroll: 1, auto: 4, wrap: 'last', initCallback: marketing_initCallback});
});

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
