// JavaScript Document
<!--
function openFullWindow(url) {
	// parameters:	url = URL of the popup window
	//alert(screen.width);
	var w = screen.width; //fixed width
	var h = screen.height; //fixed height
	//var url = url_full;
	//if(w <= 800) {
	//	url = url_800;
	//}
	leftPosition = 0;		// centering horizontal position to middle of screen
	topPosition = 0;	// centering vertical position to middle of screen
	if (h<800)
	{
		var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition +',toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no'; //set popup window properties
	} else
	{
		var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition +',toolbar=yes,location=yes,directories=no,status=no,scrollbars=no,menubar=no'; //set popup window properties
	}
	var popup = window.open(url,'remote',windowprops); // open popup window with properties
	popup.moveTo(0,0)
	popup.resizeTo(screen.width,screen.height);
	popup.focus(); // focus on window
}

function open3Dit()
{
 			openFullWindow("http://www.trjrecords.it/3d/index.html");
}

//---------------------------------------------------------------------------------------------------------------------//

function openFullWindowHTML(url) {
	// parameters:	url = URL of the popup window
	//alert(screen.width);
	var w = screen.width; //fixed width
	var h = screen.height; //fixed height
	//var url = url_full;
	//if(w <= 800) {
	//	url = url_800;
	//}
	leftPosition = 0;		// centering horizontal position to middle of screen
	topPosition = 0;	// centering vertical position to middle of screen
	
	var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition +',toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes'; //set popup
	
	var popup = window.open(url,'remote',windowprops); // open popup window with properties
	popup.moveTo(0,0)
	popup.resizeTo(screen.width,screen.height);
	popup.focus(); // focus on window
}

//---------------------------------------------------------------------------------------------------------------------//
function openHTML()
{
 			openFullWindowHTML("http://www.trjrecords.it/trjrecords.html");
}





//---------------------------------------------------------------------------------------------------------------------//

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//---------------------------------------------------------------------------------------------------------------------//
// RIFLESSO

	function addreflex(elem){
		//Reflection.add(document.getElementById('mcenter'), { height: 3/10, opacity: 3/10 });
		//window.setTimeout("Reflection.add(document.getElementById('test'), { height: 3/10, opacity: 3/10 })",300);
		
		//Reflection.remove(document.getElementById('b1'));
		Reflection.add(document.getElementById('logo'), { height: 2/3, opacity: 2/10 });
	}

//---------------------------------------------------------------------------------------------------------------------//
// CONTROLLO SU FORM

	function MM_validateForm() { //v4.0
		  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
		  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
			if (val) { nm=val.name; if ((val=val.value)!="") {
			  if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
				if (p<1 || p==(val.length-1)) errors+='- '+nm+' - indirizzo e-mail non valido.\n';
			  } else if (test!='R') { num = parseFloat(val);
				if (isNaN(val)) errors+='- '+nm+' - deve contenere un numero.\n';
				if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
				  min=test.substring(8,p); max=test.substring(p+1);
				  if (num<min || max<num) errors+='- '+nm+' - deve contenere un numero compreso tra  '+min+' e '+max+'.\n';
			} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' - campo obbligatorio.\n'; }
		  } if (errors) alert('ATTENZIONE!\n'+errors);
		  document.MM_returnValue = (errors == '');
	}

	function checkmail(myForm) { 
			 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email.value)){ 
				  return (true) 
			 } 
			 alert('ATTENZIONE!\n'+'indirizzo e-mail non valido!');
			 return (false) 
	} 
	
	
//---------------------------------------------------------------------------------------------------------------------//
// PLAYER

function ConvertiInEntita(testo){
	
alert(testo)

//var espressione = /^([a-z])+\.([a-z])/;
//var stringa = "lukeonweb.net";

//var pattern = /\'/;
var pattern = /\\'\\/;
var subs = /\\\'\\/;

/*if (pattern.test(testo))
{
    //document.write("La stringa non è valida!");
		alert("La stringa non è valida!");
}
*/
var temp = testo.replace(pattern, "'");
//alert(temp)
return temp;

}


	function roller2(mp3, title) { 
  	//clearInterval(timerID); 
    //setTimeout("timerID=setInterval('roller()',15000)",100); 
		//document.embeds['musicID'].Stop();
		
		//var entity = ConvertiInEntita(title);
		
		var stringa = "";
		var codice="";
		var content='<span style="color:#ff0000;font-size:12px;">Stai ascoltando: </span>'; //document.getElementById('artist').innerText + " - " + document.getElementById('album').innerText;
		
		if(document.all)	{
			//content = document.all('artist').innerText + " - " + document.all('album').innerText;
			content += document.all('artist').innerText;
		}else if(document.getElementById){ // SAFARI
			//content = document.getElementById('artist').innerText + " - " + document.getElementById('album').innerText; 
			content += document.getElementById('artist').innerText;
		}else {
			alert("il tuo browser non supporta questo metodo")
		}
	
		codice='<embed src ="http://www.trjrecords.it/3d/rep/sbk/'+mp3+'.mp3'+'"EnableJavaScript="true" name="musicID" width="0" height="0" hidden="true" volume="50">';
		stringa = title;
		if(document.all)	{
			document.all('spot').innerHTML=codice;
			document.all('trackinfo').innerHTML = content + " - " + stringa; 
		}else if(document.getElementById){
			document.getElementById("spot").innerHTML = codice; 
			document.getElementById("trackinfo").innerHTML = content + " - " + stringa; 
		}else {
			alert("il tuo browser non supporta questo metodo")
		}
	}
	
	function ferma(){
		/*
		document.embeds['musicID'].stop();
		document.embeds['musicID'].rewind();
		*/
		if(document.all){
			document.musicID.Stop();
			document.musicID.Rewind();
		}else if(document.getElementById){
			document.embeds['musicID'].Stop();
			document.embeds['musicID'].Rewind();
		}else {
			alert("non supportato")
		}
		
		//clearInterval(timerID);
		clear();
		//vedi();
	}
	function riprendi(){
		/*
		document.embeds['musicID'].rewind();
		document.embeds['musicID'].play();
		*/
		if(document.all)	{
			document.musicID.rewind();
			document.musicID.play();
		}else if(document.getElementById){
			document.embeds['musicID'].Rewind();
			document.embeds['musicID'].Play();
		}else {
			
		}
		
		//timerID=setInterval('roller()', 15000);
	}
	
	function clear(){
		if(document.all)	{
			document.all('trackinfo').innerHTML = ""; 
		}else if(document.getElementById){
			document.getElementById("trackinfo").innerHTML = ""; 
		}else {
			alert("il tuo browser non supporta questo metodo")
		}
	}	
	
// secondo player
	
// JavaScript Document
// Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
var UniqueID = 314 // Make each link open in a new window.
var newWinOffset = 0 // Position of first pop-up
function PlayerOpen(soundfiledesc,soundfilepath) {

PlayWin = window.open('',UniqueID,'width=320,height=190,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus(); 
var winContent = "<html><head><title>" + soundfiledesc + "</title></head><body bgcolor='#FF9900'>";
winContent += "<b style='font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</b>";

winContent += "<object width='300' height='42'>";
winContent += "<param name='src' value='" +  soundfilepath + "'>";
winContent += "<param name='autoplay' value='true'>";
winContent += "<param name='controller' value='true'>";
winContent += "<param name='bgcolor' value='#FF9900'>";
winContent += "<embed src='" + soundfilepath + "' autostart='true' loop='false' width='300' jeight='42' controller='true' bgcolor='#FF9900'></embed>";
winContent += "</object>";

winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='"+soundfilepath+"'>Download this file</a> <span style='font-size:10px'>(right-click or Option-click)</span></p>";

winContent += "<form><div align='center'><INPUT type='button' value='Close this window' onClick='javascript:window.close();'></div></form>";
winContent += "</body></html>";
PlayWin.document.write(winContent);
PlayWin.document.close(); // "Finalizes" new window
UniqueID = UniqueID + 1
// newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
}
	
/*	html:
<div id="header">
	<embed src="data/music/Snake_Sedrick_Border.mp3" align="bottom" autostart="false" loop="false" width="300" height="15" controller="true" bgcolor="#FF9900"></embed></tr>  
</div>
*/
	
	
//-->