function stickImage(num, loc) 
{
	 newsrc = 'thum' + num;
		 wch = document.getElementById(newsrc);
		 newpho = document.getElementById('mainpho');
		hofim = wch.height;
		 wofim = wch.width;
		 
		if (hofim/wofim > 1) {

			newpho.style.height="250px";
			newpho.style.width="auto";
			newpho.src = loc;
			 
			}
		else if (wofim > 369) { 
			
			newpho.style.width="370px";
			newpho.style.height="auto";
			newpho.src = loc;
			}
			
		else  { //wofim/hofim > 1
			
			newpho.style.width="auto";
			newpho.style.height="auto";
			newpho.src = loc; 
			}
		
	}
function stickImage2(num) 
{
	 newsrc = 'thum' + num;
		 wch = document.getElementById(newsrc);
		hofim = wch.height;
		 wofim = wch.width;

		if (wofim < 369) {
			
			document.getElementById('mainpho').style.height="250px";
			document.getElementById('mainpho').style.width="auto";
			document.getElementById('mainpho').src = wch.src;
			 
			}
		else if (hofim < 60) { 
			
			document.getElementById('mainpho').style.width="370px";
			document.getElementById('mainpho').style.height="auto";
			document.getElementById('mainpho').src = wch.src;
			 
			}
			
		else  { //wofim/hofim > 1
			
			document.getElementById('mainpho').style.width="auto";
			document.getElementById('mainpho').style.height="auto";
			document.getElementById('mainpho').src = wch.src;
			 
			}
		
	}

function stickThumb(x) 
{
	 thumbsrc = 'thum' + x;
		 that = document.getElementById(thumbsrc);
		 hofth = that.height;
		 wofth = that.width;
		if ((hofth/wofth) > 1) {
			that.style.height="60px";
			that.style.width="auto";			 
			}
		else if (wofth > 89) { //wofim/hofim > 1
			that.style.width="90px";
			that.style.height="auto";
			}
			
		else  { //wofim/hofim > 1
			that.style.width="auto";
			that.style.height="auto";
			 
			}
		
	}
function mainphoto() {
		 wch = document.getElementById('mainpho');
		 hofim = wch.height;
		 wofim = wch.width;
		if (hofim/wofim > 1) {
			wch.style.height="250px";
			wch.style.width="auto";
 
			}
		else if (wofim > 369) { //wofim/hofim > 1
			wch.style.width="370px";
			wch.style.height="auto";

			}
			
		else  { //wofim/hofim > 1
			wch.style.width="auto";
			wch.style.height="auto";
			
			}
	}
function resphoto(num) {
		 var ressrc= 'result' + num;
		 var wch = document.getElementById(ressrc);
		 hofim = wch.height;
		 wofim = wch.width;
		if (hofim/wofim > 1) {
			wch.style.height="139px";
			wch.style.width="auto";
 
			}
		else if (wofim > 185) { //wofim/hofim > 1
			wch.style.width="186px";
			wch.style.height="auto";

			}
			
		else  { //wofim/hofim > 1
			wch.style.width="auto";
			wch.style.height="auto";
			
			}
	}	

function showvirt(num) {
	var result = 'multvirt' + num;
	if (document.getElementById(result).style.display != "block") {
	document.getElementById(result).style.display = "block";
	}
}
	
function hidevirt(num) {
	var result = 'multvirt' + num;
	if (document.getElementById(result).style.display != "none") {
	document.getElementById(result).style.display = "none";
	}
}

function stickResult() 
{
	 newsrc = 'thum' + num;
		 wch = document.getElementById(newsrc);
		 hofim = wch.height;
		 wofim = wch.width;
		if (hofim/wofim > 1) {
			document.getElementById('mainpho').style.height="250px";
			document.getElementById('mainpho').style.width="auto";
			 
			}
		else if (wofim > 370) { //wofim/hofim > 1
			document.getElementById('mainpho').style.width="370px";
			document.getElementById('mainpho').style.height="auto";
			 
			}
			
		else  { //wofim/hofim > 1
			document.getElementById('mainpho').style.width="auto";
			document.getElementById('mainpho').style.height="auto";
			 
			}
		
	}
	
function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}
function detailarray() {

	listofimages = new Array();
    listofimages[0] = new Image(370,247)
    listofimages[0].src = "images/hphoto.jpg"
    listofimages[1] = new Image(370,247)
    listofimages[1].src = "images/phototest1.jpg"
    listofimages[2] = new Image()
    listofimages[2].src = "images/phototest2.jpg"
	listofimages[3] = new Image(370,247)
    listofimages[3].src = "images/phototest3.jpg"
	listofimages[4] = new Image(370,247)
    listofimages[4].src = "images/phototest4.jpg"
	listofimages[5] = new Image(370,247)
    listofimages[5].src = "images/phototest5.jpg"
	listofimages[6] = new Image(165,247)
    listofimages[6].src = "images/phototest6.jpg"
	listofimages[7] = new Image(165,247)
    listofimages[7].src = "images/phototest7.jpg"
	listofimages[8] = new Image(165,247)
    listofimages[8].src = "images/phototest8.jpg"
	listofimages[9] = new Image()
    listofimages[9].src = "images/phototest9.jpg"
	listofimages[10] = new Image(165,247)
    listofimages[10].src = "images/phototest10.jpg"
	listofimages[11] = new Image(90,60)
    listofimages[11].src = "images/detailint3.jpg"
	listofimages[12] = new Image()
    listofimages[12].src = "images/phototest11.jpg"

	}
	/*
function thumbnails(thm) {
	
		 thmb = 'thum' + thm;
		 wch = document.getElementById(thmb);
		 hofim = wch.height;
		 wofim = wch.width;
		if (hofim/wofim > 1) {
			wch.style.marginLeft="35px"; 
			}
		else if (hofim/wofim <= 0.66) {
			wch.style.marginLeft="10px"; 
			wch.style.width="90px";
			}
		else if (0.66 < hofim/wofim && hofim/wofim < 1) {
			wch.style.marginLeft="10px"; 
			}
	}*/

	
	
	
function showphoto() {
	if (document.getElementById('mainphoto').style.display!="block") {
	document.getElementById('mapdet').style.display="none";
	document.getElementById('mapdirect').style.display="none";
	document.getElementById('videodet').style.display="none";
	document.getElementById('vidlist').style.display="none";
	document.getElementById('mainphoto').style.display="block";
	document.getElementById('photos').style.display="block";
	}
}
function showmap() {
	if (document.getElementById('mapdet').style.display!="block") {
	document.getElementById('mainphoto').style.display="none";
	document.getElementById('photos').style.display="none";
	document.getElementById('videodet').style.display="none";
	document.getElementById('vidlist').style.display="none";
	document.getElementById('mapdet').style.display="block";
	document.getElementById('mapdirect').style.display="block";
	}
}
function showvideo() {
	if (document.getElementById('videodet').style.display!="block") 
	{document.getElementById('mapdet').style.display="none";
	document.getElementById('mapdirect').style.display="none";
	document.getElementById('mainphoto').style.display="none";
	document.getElementById('photos').style.display="none";
	document.getElementById('videodet').style.display="block";
	document.getElementById('vidlist').style.display="block";

	
	}
}
function showlink(loc) {
	if (document.getElementById('linkpopup').style.display!="block") {
			document.getElementById('linkpopup').style.display="block";
			document.getElementById('linkpopup').innerHTML="<div id='popheader'>Direct Link to this Listing</div><input type='text' value='" + loc + "' id='linkresult' /><div class='closemebox' onclick='document.getElementById(\"linkpopup\").style.display=\"none\";' title='close'>X</div>";
			document.getElementById('linkresult').select();
	}
	else {
		document.getElementById('linkpopup').style.display="none";
	}
}

function togg_info() {
	var text=document.getElementById('editmyinfo');
	var text2=document.getElementById('myacctinfo')
	if(text.style.display != 'block') {
			text.style.display='block';
			text2.style.display='none';
			}
	else{text.style.display = 'none';
		text2.style.display='block';
}
}

function togg(num) {
	var fullpath='sub' + num;
	var text=document.getElementById(fullpath);
	if(text.style.display != 'block') {
			text.style.display='block';
			}
	else{text.style.display = 'none';
}
}



