//Script para campos que a descrição dele (label) esta no proprio input
//<xfweb:attribute name="onclick" value="setFieldLabel(this)"/> essa é a tag que deverá ser utilizado no campo
var valueTmp = {};
function setFieldLabel(obj){
	var valueT = valueTmp[obj.name];
	if (!valueT){// primeiro click
		valueTmp[obj.name] = obj.value;
	}
	if (valueTmp[obj.name]==obj.value){
		obj.value = '';
	}
}

// EXIBE FLASH

function ExibeFlash(w,h,wmode,movie,flashVars) {
	var isFlashVars = arguments.length==5;
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">');
	document.write('<param name="wmode" value="'+wmode+'"/>');
	document.write('<param name="quality" value="high"/>');
	document.write('<param name="movie" value="'+movie+'"/>');
	if (isFlashVars){
		document.write('<param name="FlashVars" value="'+flashVars+'"/>');
	}
	document.write('<embed src="'+movie+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="'+wmode+'" width="'+w+'" height="'+h+'" ');
	if (isFlashVars){
		document.write(' FlashVars="'+flashVars+'"');
	}
	document.write('></embed>');
	document.write('</object>');
}


function MM_showHideLayers() { //v9.0
  //remover a barra de rolagem
  document.getElementById('texto_vscrollerbar').style.visibility  = 'hidden';
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(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_showHideLayersNoScrool() { //v9.0
  var i,p,v,obj,args=MM_showHideLayersNoScrool.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(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 writeRandom(html,array,limit){
	var out = "";
	// ordem aleatória
	array.sort(function(){return 0.5 - Math.random()})
	// exibe a lista
	for(var i=0;i<array.length;i++){
		if(limit == i){
			break;
		}
		var item = array[i];
		var htmlItem = html;
		for (var j=0;j<item.length;j++){
			htmlItem = htmlItem.replace(new RegExp("\\{"+j+"\}","g"),item[j]);
		}
		out+=htmlItem;
	}
	document.write(out);
}

function playMusic(){
	window.parent.frameSom.Play();
}
function stopMusic(){
	window.parent.frameSom.Stop();
}
