// Services
// JavaScript Document
<!--

//CONFIG
 function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function changeImgSrc(obj,target) {
	if (document.getElementById){
		document.getElementById(obj).src = target;
		//alert(document.getElementById(obj).src);
	}
}

function SetItem(id) {
		alert("set item info");
}

function SetActiveThumbStyle(id){

	var currentcolumn	='';
	var newcolumn		='';
	
	
	if ((item_current+2)%2==0) {
		currentcolumn='L';
	}else{
		currentcolumn='R';
	}
	
	if ((id+2)%2==0) {
		newcolumn='L';
	}else{
		newcolumn='R';
	}
	
	
	if (document.getElementById){
		//reset current active thumb style
		document.getElementById('thumb'+item_current).className = 'thumb'+currentcolumn;
		//set new active thumb style
		document.getElementById('thumb'+id).className = 'thumb'+newcolumn+'active';
	}
}

function ShowInfo(id) {
		SetActiveThumbStyle(id);
		MM_setTextOfLayer('clipInfo','',items[id][1]);
		P7_VScroller('clipInfo','Up',0,235,'Warp');
		var scroller = document.getElementById('clipInfoScroll');
		if (items[id][3] > 15) {
			scroller.style.display = 'block';
		} else {
			scroller.style.display = 'none';
		}
		item_current=id;
}

function ClearInfo() {
	MM_setTextOfLayer('clipInfo','','');
}


function replaceLinks() {
	for (i=0;i<items_count;i++) {
		var obj = document.getElementById('thumblink'+i);
		if (obj) {
			obj.href = items[i][2];
			//alert(obj.href);
			var ShowInfoCode = 'ShowInfo('+i+');';
			var ClearInfoCode = 'ClearInfo();';
			obj.onmouseover = new Function (ShowInfoCode);
			//obj.onmouseout = new Function (ClearInfoCode);
		}
	}
}

// OVERRIDE GOOGLE AUTOFILL
  if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }
// -->