window.addEvent('domready',function(){
	var handles_more = $$('#handles_more li');
	var nS = new noobSlide({
		box: $('box'),
		items: $$('#box h1'),
		size: 591,
		handles: $$('#handles li'),
		addButtons: {previous: $('prev'), play: $('play'), stop: $('stop'), playback: $('playback'), next: $('next') },
		onWalk: function(currentItem,currentHandle){
			//style for handles
			$$(this.handles,handles_more).removeClass('active');
			$$(currentHandle,handles_more[this.currentIndex]).addClass('active');
		},
		autoPlay: true
	});

	nS.addActionButtons('previous',$$('#box .prev'));
	nS.addActionButtons('next',$$('#box .next'));

	nS.addHandleButtons(handles_more);

	nS.walk(0,false,true);
	
	clearInputs();
	
	$$('#left dd:odd').setStyles({ 'background-color':'#E4F3FA'});
	$$('#right_dl dd:odd').setStyles({ 'background-color':'#E4F3FA'});
	$$('.prod_l dl dd:even').setStyles({ 'background-color':'#d8d8d8'});
	if($('cos_cump'))
	{
		$$('#cos_cump tr:odd').setStyles({ 'background-color':'#E4F3FA'});
	}

});

function clearInputs() {
 var inputs = $$('input');
 for(var i=0; i < inputs.length; i++) {
  if (inputs[i].type == 'text') {
   inputs[i].setAttribute('rel',inputs[i].defaultValue);
   inputs[i].onfocus = function() {
    if (this.value == this.getAttribute('rel')) {
     this.value = '';
    } else {
     return false;
    }
   }
   inputs[i].onblur = function() {
    if(this.value=='') { 
     this.value = this.getAttribute('rel');
    } else {
     return false;
    }
   }
   inputs[i].ondblclick = function() {
    this.value = this.getAttribute('rel')
   }
  }
 }
}