function openPopUp(url,target,attributes) {
		popup = window.open(url,target,attributes);
		popup.moveTo((window.screen.availWidth -  640) / 2, (window.screen.availHeight - 480) / 2); popup.focus();
}

var strDownloadInstruction = "<p>"+
							"<strong>Download Instructions</strong><br><br>"+
							"<img src='images/logoWindows.jpg' align='absmiddle'>&nbsp;&nbsp;<b>Windows Users:</b><br>"+
							"<span style='color:blue'>Right Mouse Click</span> on the image below.<br>From the mini pop-up menu, select <span style='color:blue'>&quot;Save Picture As...&quot;</span> or <span style='color:blue'>&quot;Save Image As...&quot;</span>.<br><br>"+
							
							
							"<img src='images/logoApple.jpg' align='absmiddle'>&nbsp;&nbsp;<b>Macintosh Users:</b><br>"+
							"<span style='color:blue'>Right Mouse Click</span>, or <span style='color:blue'>hold down the Control key & Click</span>, on the image below.<br>From the mini pop-up menu, select <span style='color:blue'>&quot;Save Image As...&quot;</span> or <span style='color:blue'>&quot;Save Image to the Desktop&quot;</span>."+
							"</p>";
							
var userAgentString=navigator.userAgent;
var strArray = userAgentString.split(" ");
var strBroswerVersion = strArray[strArray.length - 1];
var arrBroswerVersion = strBroswerVersion.split("/")
var browser = arrBroswerVersion[0];

var cssAdjust = "";
if(browser == "Safari"){
	cssAdjust = "margin-bottom:-8px;"
}else{
	cssAdjust = "";
}


function photoPopUpHigh(url,urlHigh,width,height,title,specs){
	photoWindow = window.open("","bigPhoto","width="+(width+30)+",height="+(height+100)+",scrollbars,resizable,status");
	photoWindow.document.write("<html>"+
								"<head>"+
								"<title>Rosen Shingle Creek</title>"+
								"</head>"+
								"<script type='text/javascript' src='js/script.js'></script>"+
								"<style type='text/css'>@import url(css/screen.css); </style>"+
								
								"<body style='background:#ffffff'>"+
								
								"<div align='center' style='background-color:#FFFFFF; width:100%; height:100%; margin-top:0px; padding-top:15px;padding-bottom:0px'>"+
								"<div id='contentBlockPopUp'>"+
							
								"<div style='background: url(images/contentBlockTop.png) top left no-repeat;width:568px;padding-top:0px; margin-bottom:-70px'><p style='color:#003333; padding:30px; font-size:14px; font-weight:bold; font-family:Arial,Verdana;'>"+ title +"</p></div>"+
								"<div style='margin-top:0px'>"+
								
								"<p><a onClick='toggleDownloadOptions(\"downloadOptions\"); return false;'><img src='http://www.rosenshinglecreek.com/images/downloads_theImageBelow.gif' alt='Download the image below' width='273' height='20' border='0' style='margin-bottom:10px;'></a></p>"+
								
								"<div id='downloadOptions' style='width:272px; display:none; margin-left:20px; margin-bottom:10px; background: url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;'>"+
									
									<!-- download tabs start here-->
									"<div id='imgDownloadTabs' style='"+ cssAdjust +"width:272px; background:url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;'>"+
									"<table width='272' height='24' border='0' cellspacing='0' cellpadding='0' style='line-height:15px; margin:0px; padding:0px; '>"+
									  "<tr>"+
									"<td id='tabHighRes' width='112'><a id='tabHighResLink' onClick='toggleDownloadTabs(\"tabHighResLink\",\"imgDownloadContent\");  return false;' href='#'>High Resolution</a></td>"+
									"<td id='tabLowRes'><a id='tabLowResLink' onClick='toggleDownloadTabs(\"tabLowResLink\",\"imgDownloadContent\"); return false;' href='#'>Low Resolution</a></td>"+
									 "</tr>"+
									"</table>"+
									"</div>"+
									<!-- download tabs ends here-->
									
									"<div id='imgDownloadTable' style='width:272px; background:url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;margin:0px;'>"+
									"<table width='272' border='0' cellspacing='0' cellpadding='0' style='margin-top:0px; line-height:15px; padding-right:0px'>"+
									  "<tr>"+
										"<td height='9' valign='bottom'>"+
										"<img src='images/downloads_frameTop.gif' width='272' height='9'></td>"+
									  "</tr>"+
									  "<tr>"+
										"<td style='background:url(images/downloads_back.gif) repeat-y;' valign='top'>"+
										
										<!-- High res info starts here-->
										"<div id='imgDownloadContentHigh' style='width:270px; background:url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;'>"+
										"<table width='270' border='0' cellspacing='0' cellpadding='0' style='line-height:15px;margin-top:0px; padding-right:0px'>"+
											  "<tr>"+
												"<td style='padding-left:18px;' width='150'>"+
												<!-- Download file specs -->
													specs +
												"</td>"+
												"<td width='3' align='center' valign='middle'><img src='http://www.rosenshinglecreek.com/images/downloads_divider.gif' width='1' height='60'></td>"+
												"<td style='padding-left:0px;' align='center' valign='middle' ><a href='Gallery/downloads/"+ urlHigh +"'><img src='http://www.rosenshinglecreek.com/images/downloads_button.gif' width='85' height='32' border='0' alt='Download'></a></td>"+
											  "</tr>"+
										"</table>"+
										"</div>"+
										<!-- High res info ends here-->
										
										<!-- Low res info starts here-->
										"<div id='imgDownloadContentLow' style='width:270px;display:none; background: url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;'>"+
										"<table width='270' border='0' cellspacing='0' cellpadding='0' style='line-height:15px;margin-top:0px; padding-right:0px'>"+
										  "<tr>"+
											"<td style='padding-left:18px;' width='270'>"+
													
													<!-- Download file specs -->
													strDownloadInstruction +
													
											"</td>"+
											"</tr>"+
										"</table>"+
										"</div>"+
										
										<!-- Low res info ends here-->
										
 									"</td>"+
								  "</tr>"+
								  "<tr>"+
								"<td height='9' valign='top'><img src='images/downloads_frameBottom.gif' width='272' height='9'></td>"+
								  "</tr>"+
								"</table>"+
								"</div>"+
								"</div>"+
								
  								"<a href='javascript:window.close()'><img class='galleryThumb' src='"+ url +"' width='90%' border='0'></a>"+
								"</div>"+
								"</div>"+
								"</div>"+
								"</body>"+
								"</html>");
	photoWindow.document.close();
	photoWindow.focus();
}

function photoPopUp(url,urlHigh,width,height,title,specs){
	photoWindow = window.open("","bigPhoto","width="+(width+30)+",height="+(height+100)+",scrollbars,resizable,status");
	photoWindow.document.write("<html>"+
								"<head>"+
								"<title>Shingle Creek Resort</title>"+
								"</head>"+
								"<script type='text/javascript' src='js/script.js'></script>"+
								"<style type='text/css'>@import url(css/screen.css); </style>"+

								"<body style='background:#ffffff'>"+
								
								"<div align='center' style='background-color:#FFFFFF; width:100%; height:100%; margin-top:0px; padding-top:15px;padding-bottom:0px'>"+
								"<div id='contentBlockPopUp'>"+
							
								"<div style='background: url(images/contentBlockTop.png) top left no-repeat;width:568px;padding-top:0px; margin-bottom:-70px'><p style='color:#003333; padding:30px; font-size:14px; font-weight:bold; font-family:Arial,Verdana;'>"+ title +"</p></div>"+
								"<div style='margin-top:0px'>"+
								
								"<p><a onClick='toggleDownloadOptions(\"downloadOptions\"); return false;'><img src='http://www.rosenshinglecreek.com/images/downloads_theImageBelow.gif' alt='Download the image below' width='273' height='20' border='0' style='margin-bottom:10px;'></a></p>"+
								
								"<div id='downloadOptions' style='width:272px; display:none; margin-left:20px; margin-bottom:10px; background: url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;'>"+
									
									
									
									"<div id='imgDownloadTable' style='width:272px; background:url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;margin:0px;'>"+
									"<table width='272' border='0' cellspacing='0' cellpadding='0' style='margin-top:0px; line-height:15px; padding-right:0px'>"+
									  "<tr>"+
										"<td height='9' valign='bottom'><img src='images/downloads_frameTop.gif' width='272' height='9'></td>"+
									  "</tr>"+
									  "<tr>"+
										"<td style='background:url(images/downloads_back.gif) repeat-y;' valign='top'>"+
										
										
										
										<!-- Low res info starts here-->
										"<div id='imgDownloadContentLow' style='width:270px; background: url(images/spacer.gif) bottom left no-repeat;padding:0px 0px 0px 0px;'>"+
										"<table width='270' border='0' cellspacing='0' cellpadding='0' style='line-height:15px;margin-top:0px; padding-right:0px'>"+
										  "<tr>"+
											"<td style='padding-left:18px;' width='270'>"+
													<!-- Download file specs -->
													strDownloadInstruction +
											
											"</td>"+
											"</tr>"+
										"</table>"+
										"</div>"+
										
										<!-- Low res info ends here-->
										
 									"</td>"+
								  "</tr>"+
								  "<tr>"+
								"<td height='9' valign='top'><img src='images/downloads_frameBottom.gif' width='272' height='9'></td>"+
								  "</tr>"+
								"</table>"+
								"</div>"+
								"</div>"+
								
  								"<a href='javascript:window.close()'><img class='galleryThumb' src='"+ url +"' width='90%' border='0'></a>"+
								"</div>"+
								"</div>"+
								"</div>"+
								"</body>"+
								"</html>");
								photoWindow.document.close();
								photoWindow.focus();
	
}



function toggleDownloadOptions(thisDiv){
		if(document.getElementById(thisDiv).style.display == "" || document.getElementById(thisDiv).style.display == "none"){
			document.getElementById(thisDiv).style.display="block";
			document.getElementById("printerFriendly").style.marginTop=5;
		}else{
			document.getElementById(thisDiv).style.display="none";
			document.getElementById("printerFriendly").style.marginTop=-10;
		}
}

function toggleDownloadTabs( thisTab, contentDiv ){
	restDownloadTabs(thisTab);
	var textLink=  thisTab;
	document.getElementById(thisTab).style.backgroundImage="url(images/downloads_tabOn.gif)";
	document.getElementById(thisTab).style.color="#5F8F3F";
	
	
	if(thisTab == "tabHighResLink"){
		document.getElementById( contentDiv+"High").style.display="block";
	}
	if(thisTab == "tabLowResLink"){
		document.getElementById( contentDiv+"Low").style.display="block";
	}
	
	if(thisTab == "tabHighResLink2"){
		document.getElementById( contentDiv+"High").style.display="block";
	}
	if(thisTab == "tabLowResLink2"){
		document.getElementById( contentDiv+"Low").style.display="block";
	}
	
	if(thisTab == "tabHighResLink3"){
		document.getElementById( contentDiv+"High").style.display="block";
	}
	if(thisTab == "tabLowResLink3"){
		document.getElementById( contentDiv+"Low").style.display="block";
	}
	
	if(thisTab == "tabHighResLink4"){
		document.getElementById( contentDiv+"High").style.display="block";
	}
	if(thisTab == "tabLowResLink4"){
		document.getElementById( contentDiv+"Low").style.display="block";
	}
}

function restDownloadTabs( thisTab ){
	var tabHigh = "tabHighResLink";
	var tabLow = "tabLowResLink";
	
	if(thisTab == "tabHighResLink" || thisTab == "tabLowResLink"){
		document.getElementById(tabHigh).style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabLow).style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabHigh).style.color="#575757";
		document.getElementById(tabLow).style.color="#575757";
		
		document.getElementById("imgDownloadContentHigh").style.display="none";
		document.getElementById("imgDownloadContentLow").style.display="none";
	}
	if(thisTab == "tabHighResLink2" || thisTab == "tabLowResLink2"){
		document.getElementById(tabHigh+"2").style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabLow+"2").style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabHigh+"2").style.color="#575757";
		document.getElementById(tabLow+"2").style.color="#575757";
		
		document.getElementById("imgDownloadContent2High").style.display="none";
		document.getElementById("imgDownloadContent2Low").style.display="none";
	}
	
	if(thisTab == "tabHighResLink3" || thisTab == "tabLowResLink3"){
		document.getElementById(tabHigh+"3").style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabLow+"3").style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabHigh+"3").style.color="#575757";
		document.getElementById(tabLow+"3").style.color="#575757";
		
		document.getElementById("imgDownloadContent3High").style.display="none";
		document.getElementById("imgDownloadContent3Low").style.display="none";
	}
	
	if(thisTab == "tabHighResLink4" || thisTab == "tabLowResLink4"){
		document.getElementById(tabHigh+"4").style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabLow+"4").style.backgroundImage="url(images/downloads_tabOff.jpg)";
		document.getElementById(tabHigh+"4").style.color="#575757";
		document.getElementById(tabLow+"4").style.color="#575757";
		
		document.getElementById("imgDownloadContent4High").style.display="none";
		document.getElementById("imgDownloadContent4Low").style.display="none";
	}
	
	
}


function writeFlash_galleryPhotos(thisXML, divID){
	var embedFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="40" height="10" id="formatGallery" align="middle">'+
	'<param name="allowScriptAccess" value="sameDomain" />'+
	'<param name="movie" value="galleryXML/formatGallery.swf?xmlFile='+ thisXML +'&divID='+ divID +'" />'+
	'<param name="quality" value="high" />'+
	'<param name="wmode" value="transparent" />'+
	'<param name="bgcolor" value="#ffffff" />'+
	'<embed src="galleryXML/formatGallery.swf?xmlFile='+ thisXML +'&divID='+ divID +'" quality="high" wmode="transparent" bgcolor="#ffffff" width="40" height="10" name="formatGallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
	'</object>';
	
	document.write(embedFlash);
	
}

function writeGalleryHTML(htmlFormat, divID){
	//alert(htmlFormat)
	writeIt(htmlFormat,divID)
}


function writeIt(text,id){
	
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
	else if (document.layers)
	{
		x = document.layers[id];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}

