// JavaScript Document// JavaScript Document


<!--
function popVideo(videoName,redirect)
{
   var url = "videoAlone_big.html?MovieName=" + videoName;
  // alert("popVideo ==" + videoName);
	newwindow=window.open(url,'name','height=680,width=900');
	if (window.focus) {newwindow.focus()}
}


function popPhoto(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=340,height=640,scrollbars=no');
return false;
}

function popPhotoSize(mylink, windowname, xwidth, yheight)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=xwidth,height=yheight,scrollbars=no');
return false;
}




function testScript() {
	
	alert("testing js successful");
}



var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
   browserType= "gecko"
}

function hideRightDiv() {
//alert("hideRightDiv called")
  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById("top_10_right")');
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById("top_10_right")');
  else
     document.poppedLayer =   
        eval('document.layers["realtooltip"]');
  document.poppedLayer.style.visibility = "hidden";
  //	alert("document.poppedLayer.style.visibility  == " + document.poppedLayer.style.visibility );
}

function showRightDiv() {
//alert("showRightDiv called")
  if (browserType == "gecko" )
     document.poppedLayer = 
         eval('document.getElementById("top_10_right")');
  else if (browserType == "ie")
     document.poppedLayer = 
        eval('document.getElementById("top_10_right")');
  else
     document.poppedLayer = 
         eval('document.layers["top_10_right"]');
  document.poppedLayer.style.visibility = "visible";
}





function writeFlashMenu() {
	
		if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {

AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '861',
			'height', '38',
			'src', 'submenu',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'submenu',
			'name', 'submenu',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'submenu',
			'salign', ''
			); //end AC code
	}
	
	
	
}

//amazon widget install
src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822/US/utahstories0e-20/8005/a54caf63-1ef2-42f9-83ec-d9bd49827608"> 



function writeVideoPlayer() {
	document.write('<div style = "position: absolute; left: -5px; top: 259px; height: 820px; width: 670px; padding: 1em;">');
			if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {

AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '780',
			'height', '820',
			'src', 'm_dtown_nl',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'm_dtown_nl',
			'name', 'm_dtown_nl',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'm_dtown_nl',
			'salign', ''
			); //end AC code
	}
document.write('</div>');
	
	
}




function writeSearchOnly() {

document.write('<div class id="googleSearch">');
<!-- SiteSearch Google -->
document.write('<form method="get" action="http://www.google.com/custom" target="_top">');
document.write('<table border="0" >');
document.write('<tr><td nowrap="nowrap" valign="top" align="left" height="32">');

document.write('</td>');
document.write('<td nowrap="nowrap">');
document.write('<input type="hidden" name="domains" value="Utah Stories"></input>');
document.write('<label for="sbi" style="display: none">Enter your search terms</label>');
document.write('<input type="text" name="q" size="20" maxlength="255" value="" id="sbi"></input>');
document.write('<label for="sbb" style="display: none">Submit search form</label>');
document.write('<input type="submit" name="sa" value="Search" id="sbb"></input>');
document.write('</td></tr>');
document.write('<tr>');
document.write('<td>&nbsp;</td>');
document.write('<td nowrap="nowrap">');
document.write('<table>');
document.write('<tr>');
document.write('<td>');

document.write('<input type="radio" checked="checked" name="sitesearch" value="www.utahstories.com" id="ss1"></input>');
document.write('<label for="ss1" title="Search www.utahstories.com"><font size="-1" color="#384F6F">www.utahstories.com</font></label></td>');
document.write('</tr>');
document.write('</table>');
document.write('<input type="hidden" name="client" value="pub-9338862493235788"></input>');
document.write('<input type="hidden" name="forid" value="1"></input>');
document.write('<input type="hidden" name="channel" value="3642242593"></input>');
document.write('<input type="hidden" name="ie" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="oe" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="safe" value="active"></input>');
document.write('<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:220;L:http://www.utahstories.com/graphics/adSense_logo_utah_stories.png;S:http://;FORID:1"></input>');
document.write('<input type="hidden" name="hl" value="en"></input>');
document.write('</td></tr></table>');
document.write('</form>');
<!-- SiteSearch Google -->

}



function writeSubscribeAndSearch() {

document.write('<div class id="googleSearch">');
<!-- SiteSearch Google -->
document.write('<form method="get" action="http://www.google.com/custom" target="_top">');
document.write('<table border="0" >');
document.write('<tr><td nowrap="nowrap" valign="top" align="left" height="32">');

document.write('</td>');
document.write('<td nowrap="nowrap">');
document.write('<input type="hidden" name="domains" value="www.utahstories.com"></input>');
document.write('<label for="sbi" style="display: none">Enter your search terms</label>');
document.write('<input type="text" name="q" size="20" maxlength="255" value="" id="sbi"></input>');
document.write('<label for="sbb" style="display: none">Submit search form</label>');
document.write('<input type="submit" name="sa" value="Search" id="sbb"></input>');
document.write('</td></tr>');
document.write('<tr>');
document.write('<td>&nbsp;</td>');
document.write('<td nowrap="nowrap">');
document.write('<table>');
document.write('<tr>');
document.write('<td>');
document.write('<input type="radio" name="sitesearch" value="" checked id="ss0"></input>');
document.write('<label for="ss0" title="Search the Web"><font size="-1" color="#384F6F">Web</font></label></td>');
document.write('<td>');
document.write('<input type="radio" name="sitesearch" value="www.utahstories.com" id="ss1"></input>');
document.write('<label for="ss1" title="Search www.utahstories.com"><font size="-1" color="#384F6F">www.utahstories.com</font></label></td>');
document.write('</tr>');
document.write('</table>');
document.write('<input type="hidden" name="client" value="pub-9338862493235788"></input>');
document.write('<input type="hidden" name="forid" value="1"></input>');
document.write('<input type="hidden" name="channel" value="3642242593"></input>');
document.write('<input type="hidden" name="ie" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="oe" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="safe" value="active"></input>');
document.write('<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:220;L:http://www.utahstories.com/graphics/adSense_logo_utah_stories.png;S:http://;FORID:1"></input>');
document.write('<input type="hidden" name="hl" value="en"></input>');
document.write('</td></tr></table>');
document.write('</form>');
<!-- SiteSearch Google -->
document.write('</div>');

document.write('<div class id="feedBurner">');

document.write('<form style="border:none; text-align:left;" action="http://www.feedburner.com/fb/a/emailverify" method="post" target="popupwindow" onsubmit="window.open("http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1043473", "popupwindow", "scrollbars=yes,width=550,height=520");return true"><br><span class="smallText">Subscribe to Utah Stories (enter e-mail address):</span><br><input type="text" style="width:140px" name="email"/><input type="hidden" value="http://feeds.feedburner.com/~e?ffid=1043473" name="url"/><input type="hidden" value="Utah Stories" name="title"/><input type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe"/><p></a></p></form>');
document.write('</div>');

}


function placeSearch() {

document.write('<div class id="googleSearch">');
<!-- SiteSearch Google -->
document.write('<form method="get" action="http://www.google.com/custom" target="_top">');
document.write('<table border="0" >');
document.write('<tr><td nowrap="nowrap" valign="top" align="left" height="32">');

document.write('</td>');
document.write('<td nowrap="nowrap">');
document.write('<input type="hidden" name="domains" value="www.utahstories.com"> </input>');
document.write('<label for="sbi" style="display: none">Enter your search terms</label>');
document.write('<input type="text" name="q" size="20" maxlength="255" value="" checked id="sbi"></input>');
document.write('<label for="sbb" style="display: none">Submit search form</label>');
document.write('<input type="submit" name="sa" value="Search" id="sbb"></input>');
document.write('</td></tr>');
document.write('<tr>');
document.write('<td>&nbsp;</td>');
document.write('<td nowrap="nowrap">');
document.write('<table>');
document.write('<tr>');

document.write('<input type="radio" name="sitesearch" value="www.utahstories.com" checked="checked" id="ss1"></input>');
document.write('<label for="ss1" title="Search www.utahstories.com"><font size="-1" color="#384F6F">www.utahstories.com</font></label></td>');
document.write('</tr>');
document.write('</table>');
document.write('<input type="hidden" name="client" value="pub-9338862493235788"></input>');
document.write('<input type="hidden" name="forid" value="1"></input>');
document.write('<input type="hidden" name="channel" value="3642242593"></input>');
document.write('<input type="hidden" name="ie" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="oe" value="ISO-8859-1"></input>');
document.write('<input type="hidden" name="safe" value="active"></input>');
document.write('<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:50;LW:220;L:http://www.utahstories.com/graphics/adSense_logo_utah_stories.png;S:http://;FORID:1"></input>');
document.write('<input type="hidden" name="hl" value="en"></input>');
document.write('</td></tr></table>');
document.write('</form>');
<!-- SiteSearch Google -->
document.write('</div>');



}




function writeFooter() {
	
	var myFooter;
	document.write('<div id="footer" >');
	document.write('<ul id = "nav_footer">');
    document.write('<li><a href ="index.html">Story Index</a></li>');
	document.write('<li><a href ="downtown.html" >Video Page</a></li>');
	document.write('<li><a href ="sugarhouse.html">Sugar House</a></li>');
	document.write('<li><a href ="downTownSLC.htm">Salt Lake City</a></li> ');
	document.write('<li><a href ="smart_growth.html">Smart Growth</a></li> ');
	document.write('<li><a href ="wal-mart research1.html">Wal-Mart</a></li>');
	document.write('<li><a href ="utah_vouchers.htm">Vouchers</a></li>');
	document.write('<li><a href ="utah_stories.htm">Utah Documentaries</a></li>');
	document.write('<li><a href ="guns.html">Guns on Campus</a></li> <br>');


	document.write('<li><a href ="capitol_report.html">Capitol Report</a></li>');
	document.write('<li><a href ="utah_hall_of_fame.htm">Utah Hall of Fame</a></li>');
	document.write('<li><a href ="utes.htm">Ute Indians</a></li>');
	document.write('<li><a href ="about_utah_stories.htm">About Utah Stories</a></li>');
	document.write('<li><a href ="about_markosian_media.htm">Markosian Media</a></li>');
	document.write('<li><a href ="mailto:richard@utahstories.com">Contact Us</a></li>');
    document.write('</ul>');
    document.write('<p>Copyright 2008 Markosian Media All Rights Reserved</p>');
    document.write('</div>');
	document.write('</ul>');
	document.write('</div>');
	

//add last line of add this if bring back
<!-- subscribe & add this END -->
}


//This is the old function that doesn't set the position of the related links must keep for old pages
 function setFooterPosition(footerPostion)
 {
  var myElem = document.getElementById('footer')
	var myStyle = myElem.style;
	myStyle.top = footerPostion + "px";
	adthisPostion = footerPostion - 35;
	setAdThisPosition(adthisPostion);

 }

//This is the new function that sets wufoo form next and back links, related story links and adThis positions

 function setFooterLinksPositionStory(footerPosition,linksHeight)
 {
  var myElem = document.getElementById('footer');
	var myStyle = myElem.style;
	var newTop = footerPosition;
	myStyle.top = newTop + "px";
	adthisPosition = footerPosition - 35;
	setAdThisPositionNew(adthisPosition);
	setLinksPosition(adthisPosition,linksHeight);
	setStoryLinksPosition(adthisPosition);
	setWufooFormPostion(adthisPosition);
	setSubscribePostion(adthisPosition);
 }

//This is the new function that sets add this position, footer position and related links position
 function setFooterLinksPosition(footerPosition,linksHeight)
 {
  var myElem = document.getElementById('footer');
	var myStyle = myElem.style;
	var newTop = footerPosition;
	myStyle.top = newTop + "px";
	adthisPosition = footerPosition - 35;
	setAdThisPosition(adthisPosition);
	setLinksPosition(adthisPosition,linksHeight);
 }


function setSubscribePostion(position) {
	var myElem = document.getElementById('subscribeFeedburner');
	var myStyle = myElem.style;
	var newTop = position-130;
	myStyle.top = newTop + "px";
	
}



function setWufooFormPostion(position) {
	var myElem = document.getElementById('wufoo_form');
	var myStyle = myElem.style;
	var newTop = position-405;
	myStyle.top = newTop + "px";
	
}

//Had to make a new function for the new layout and keep the old to accomodate the older stories

function setAdThisPositionNew(position) {
	var myElem = document.getElementById('adThis');
	var myStyle = myElem.style;
	var newTop = position -430;
	myStyle.top = newTop + "px";
	
}


function setAdThisPosition(position) {
	var myElem = document.getElementById('adThis');
	var myStyle = myElem.style;
	var newTop = position;
	myStyle.top = newTop + "px";
	
}

function setStoryLinksPosition(position) {

	var myNextElem = document.getElementById('nextStoryBottom');
	var myPrevElem = document.getElementById('prevStoryBottom');
	var myNextStyle = myNextElem.style;
	var myPrevStyle = myPrevElem.style;
	var newTop = position-20;
	myNextStyle.top = newTop + "px";
	myPrevStyle.top = newTop + "px";
	
}

function setLinksPosition(position,height) {

	var myElem = document.getElementById('relatedLinks');
	var myStyle = myElem.style;
	var newTop = position-50-height;
	myStyle.top = newTop + "px";
	
}


//-->

