var scrolldelay =0
var test = 0
var stopAT = 0;

function showNow(str,txt,idNum,scrol){
	str  = 'sopraPics/' + str + '.jpg'
	var myID = 'imgView'+ idNum


	document.getElementById('sopraPlan' + idNum).src = str;
	document.getElementById('imgTXT' + idNum).innerHTML = txt;

var check = document.getElementById(myID).style.display;
	if(check=='none'){
		document.getElementById(myID).style.display='block';
	}else{
		document.getElementById(myID).style.display='none';
	}
	var test = 'show' + idNum
	stopAT = scrol
//	pageScroll()
}

function openNow(str){
   window.open('imgView.php?id='+str,'myWindow','width=690,height=580,screenX=250,screenY=150,,scrollbars=no,resizable=yes');
}

function openNowSotto(str){
   window.open('sottoView.php?id='+str,'myWindow','width=690,height=600,screenX=250,screenY=150,,scrollbars=no,resizable=yes');
}

function show(str,imgTXT,imgSr){

var check =	document.getElementById(str).style.display;
var idNum =4;
var imgSrc = 'sopraPics/' + imgSr;

	document.getElementById('sopraPlan4').src = imgSrc;
	document.getElementById('imgTXT' + idNum).innerHTML = imgTXT;
	
	if(check=='block'){
		document.getElementById(str).style.display='none';		
	}else{
		document.getElementById(str).style.display='block';
	}
}


function scrollME(str){
	document.location='#'+str;
}


function hideNow(str,okID){

	document.getElementById('sopraPlan').src = '';
	document.getElementById(str).style.display='none';
	window.location = 'sopraPlans.php?goTO='+okID


}


function pageScroll() {

	if(test<50){
    	window.scrollBy(0,stopAT); 
   		scrolldelay = setTimeout('pageScroll()',1);						
		test++
	}else{
		//alert('Done: ' + stopAT)
	}
	
}

function clearMe(){
//clearTimeout(scrolldelay)
}



function showSub(str,colr){

//alert('Str: ' + str + '\nColor: ' + colr)
for(i=1;i<=6;i++){
	document.getElementById('sub'+i).style.display="none";	
}

var chk = document.getElementById(str).style.display
if(chk=='none'){
	document.getElementById(str).style.display="block";
}else{
	document.getElementById(str).style.display="none";
}
activeLink(colr,colr);
}


function activeLink(lnk,lnk2){

	document.getElementById('sotto').style.color="#fff";
	document.getElementById('sopra').style.color="#fff";
	document.getElementById('lod').style.color="#fff";
	document.getElementById('services').style.color="#fff";
	document.getElementById('locInfo').style.color="#fff";
	document.getElementById('places').style.color="#fff";
	document.getElementById('chpVer').style.color="#fff";
	document.getElementById('contact').style.color="#fff";

 if(lnk){
	document.getElementById(lnk).style.color="#21B0C1";
	document.getElementById(lnk2).style.color="#21B0C1";
 }
}





function changeStatus(){

var check

check = document.slideshow.slide.value	

if(check=='stop'){

	SLIDES.pause();
	var str  = "<table border='0' cellpadding='0' cellspacing='0' width='100%' class='left' ><tr>";
		str += "<tr><td>&nbsp;</td></tr>";
		str += "<td align='right'><a href='#' onclick='javascript:SLIDES.previous();'><img src='images/arrowL.gif' border='0'/></a></td>";
		str += "<td width='50' align='center'><a href='#'style='font-size:14px;font-family:georgia;' onClick='changeStatus();'>PLAY</a></td>";
		str += "<td align='left'><a href='#' onclick='javascript:SLIDES.next();'><img src='images/arrowR.gif' border='0'/></a></td>";
		str += "</tr></table>";

	document.getElementById('slideState').innerHTML = str
	document.slideshow.slide.value = 'play'
			
}else{

	SLIDES.play();
	var str  = "<table border='0' cellpadding='0' cellspacing='0' width='100%' class='left' ><tr>";
		str += "<tr><td>&nbsp;</td></tr>";
		str += "<td align='right'><a href='#' onclick='javascript:SLIDES.previous();'><img src='images/arrowL.gif' border='0'/></a></td>";
		str += "<td width='50' align='center'><a href='#'style='font-size:14px;font-family:georgia;' onClick='changeStatus();'>STOP</a></td>";
		str += "<td align='left'><a href='#' onclick='javascript:SLIDES.next();'><img src='images/arrowR.gif' border='0'/></a></td>";
		str += "</tr></table>";
	document.getElementById('slideState').innerHTML = str
	document.slideshow.slide.value = 'stop'
 }
}


function openNew(num){
   window.open('rooms.php','myWindow','width=640,height=460,screenX=250,screenY=150,,scrollbars=no,resizable=yes');
}


function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}
