var start=1;
var end=5;
function setBlocks(start,end, parent_id){
for(var s=start; s<=end; s++){
if(document.getElementById(parent_id+s)){
document.getElementById(parent_id+s).style.display="block";
}
}
}
function pageFlip(set,start,parent_id,no_count){//set is how many items are in each set
var id="";
var disp="";//what current id's display is
var b=0;
var shown="";
for(var i=1; document.getElementById(parent_id+i); i++ ){
id=parent_id+i;
y=document.getElementById(id);
disp=y.style.display;
y.style.display="none"
if(disp=="block"){b=i;b++;}
}
if(start==1){
b=Math.round(Math.random()*i);
}
var end=b+(set);
if(b == i){
end=set;
setBlocks(1,end, parent_id);
b=1;
}else if(b == 0){
end=set;
setBlocks(1,end, parent_id);
b=1;
}else{
end--;
setBlocks(b,end, parent_id);
}
i--;
if(end>i){end=i;}
if(b==end){shown=b;}else{shown=b + '-' + end;}
if(no_count){
document.getElementById(parent_id + '_counter').childNodes[0].nodeValue ='next';
}else{
document.getElementById(parent_id + '_counter').childNodes[0].nodeValue = shown + ' of ' + i;
}
}
function changeTab (id,tabname) {
var x=0;
for(var i=1; document.getElementById(id+'_tab_t'+i); i++ ){
//set all content areas to none
document.getElementById(id+'_tab_t'+i).style.display = 'none';
var tab='t'+i;
//see if this iteration is the selected tab
if(tabname==tab){
changeClass(id+'_'+tab,'current');
x=i-1;
var prev='t'+x;
}else{
changeClass(id+'_'+tab,'none');
}
}
if(x>0){changeClass(id+'_'+prev,'neighbor')}
if(tabname!=tab){
changeClass(id+'_'+tab,'last');
}
document.getElementById(id+'_tab_'+tabname).style.display = 'block';
}
function changeClass(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}
function deleteCookie(cookie){
exp = new Date();
exp.setTime(exp.getTime() - 1800000);
setCookie(cookie, '', exp, false, false, false);
//document.location.reload();
}
function setCookie(name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}
function getCookies(name){
//in cookie when name is the empty string.
if(name == '')
return('');
name_index = document.cookie.indexOf(name + '=');
if(name_index == -1)
return('');
cookie_value = document.cookie.substr(name_index + name.length + 1,
document.cookie.length);
//All cookie name-value pairs end with a semi-colon, except the last one.
end_of_cookie = cookie_value.indexOf(';');
if(end_of_cookie != -1)
cookie_value = cookie_value.substr(0, end_of_cookie);
//Restores all the blank spaces.
space = cookie_value.indexOf('+');
while(space != -1)
{
cookie_value = cookie_value.substr(0, space) + ' ' +
cookie_value.substr(space + 1, cookie_value.length);
space = cookie_value.indexOf('+');
}
return(cookie_value);
}
function setMySize(size){
var exp = new Date();
exp.setTime(exp.getTime() + 18000000000000);
deleteCookie("fontsize");
setCookie("fontSize", size, exp, "/", window.location.hostname, "");
}
function changeStyles (size) {
var id='story_text';
setMySize(size);
obj = document.getElementById(id);
if (!obj) {
alert("unrecognized ID");
return false;
}
if(size=='small'){
obj.style.fontSize = "12px";
}
if(size=='medium'){
obj.style.fontSize = "14px";
}
if(size=='large'){
obj.style.fontSize = "16px";
}
//setMySize(size)
return true;
}
//CREATES AN INLINE VMIX VIDEO
function makeVideoObj(obj){
if(!obj.width){
obj.width = 235;
}
if(!obj.height){
obj.height = obj.width * .787;
}
if(!obj.autoplay){
obj.autoplay = 'false';
}
if(!obj.ref){
obj.ref = document.location;
}
var video = '';
if(obj.target_id){
var target = document.getElementById(obj.target_id);
target.innerHTML = video;
}else{
return video;
}
}
//CREATES AN INLINE SWF OBJ
function makeSwfObject(obj){
if(!obj.width){
obj.width = 600;
}
if(!obj.height){
obj.height = 500;
}
var video = '';
if(obj.target_id){
var target = document.getElementById(obj.target_id);
target.innerHTML = video;
}else{
return video;
}
}
// Popup
var popVideo = null;
function video_pop(url)
{
if (popVideo && !popVideo.closed)
popVideo.location.href = url;
else
var h = 370;
var w = 340;
/*if((url.match(/gallery/)||url.match(/photos/)) && url.match(/iditarod/)){
w = 770;
h = 650;
}*/
popVideo = window.open(url,'popVideo','height=' + h + ',width=' + w + ',scrollbars=yes,resizable=yes,toolbar=no,location=no');
popVideo.focus();
return false;
}
var popGallery = null;
function story_gallery(url)
{
if (popGallery && !popGallery.closed)
popGallery.location.href = url;
else
popGallery = window.open(url,'popGallery','height=500,width=350,scrollbars=yes,resizable=yes,toolbar=no,location=no');
popGallery.focus();
return false;
}
var popMedia = null;
function adn_media(url)
{
if (popMedia && !popMedia.closed)
popMedia.location.href = url;
else
popMedia = window.open(url,'media','height=820,width=800,scrollbars=yes,resizable=yes,toolbar=no,location=no');
popMedia.focus();
return false;
}
var popMedia = null;
function media(url)
{
if (popMedia && !popMedia.closed)
popMedia.location.href = url;
else
popMedia = window.open(url,'media','height=820,width=800,scrollbars=yes,resizable=yes,toolbar=no,location=no');
popMedia.focus();
return false;
}
var popGallery = null;
function story_gallery(url)
{
if (popGallery && !popGallery.closed)
popGallery.location.href = url;
else
popGallery = window.open(url,'popGallery','height=500,width=350,scrollbars=yes,resizable=yes,toolbar=no,location=no');
popGallery.focus();
return false;
}
var popInfo = null;
function info_box(url)
{
if (popInfo && !popInfo.closed)
popInfo.location.href = url;
else
popInfo = window.open(url,'popInfo','height=300,width=420,scrollbars=yes,resizable=yes,toolbar=no,location=no');
popInfo.focus();
return false;
}
var popStory = null;
function print_story(url)
{
if (popStory && !popStory.closed)
popStory.location.href = url;
else
var w = 590;
var h = 600;
if(url.match(/v-story_gallery/)){
w = 790;
h = 650;
}
popStory = window.open(url,'popStory','height=' + h + ',width=' + w + ',scrollbars=yes,resizable=yes,toolbar=no,location=no');
popStory.focus();
return false;
}
var popGallery = null;
function photo_gallery(url)
{
if (popGallery && !popGallery.closed)
popGallery.location.href = url;
else
var w = 800;
var h = 820;
popGallery = window.open(url,'popGallery','height=' + h + ',width=' + w + ',scrollbars=yes,resizable=yes,toolbar=no,location=no');
popGallery.focus();
return false;
}
var popWide = null;
function short_wide(url)
{
if (popWide && !popWide.closed)
popWide.location.href = url;
else
popWide = window.open(url,'popWide','height=415,width=625,scrollbars=yes,resizable=yes,toolbar=no,location=no');
popWide.focus();
return false;
}
var popJob = null;
function top_job(ref)
{
var url=ref.href;
if (popJob && !popJob.closed)
popJob.location.href = url;
else
popJob = window.open(url,'popJob','height=540,width=540,scrollbars=yes,resizable=yes,toolbar=no,location=no');
popJob.focus();
return false;
}
var popEnlarge = null;
function enlarge(ref)
{
var url=ref.href;
if (popEnlarge && !popEnlarge.closed)
popEnlarge.location.href = url;
else
popEnlarge = window.open(url,'popEnlarge','height=540,width=540,resizable=yes,toolbar=no,location=no');
popEnlarge.focus();
return false;
}
var popSized = null;
function popup_sized(url,height,width)
{
//if (popSized && !popSized.closed)
// popSized.location.href = url;
//else
if( url.match(/gallery/) && url.match(/photos/) ){
if(width < 790){
width = 790;
}
if(height < 650){
height = 650;
}
}
popSized = window.open(url,'popSized' + height + width,'height='+height+',width='+width+',resizable=yes,toolbar=no,location=no');
popSized.focus();
return false;
}
var popSizedScrl = null;
function popup_sized_scroll(url,height,width)
{
if (popSizedScrl && !popSizedScrl.closed)
popSizedScrl.location.href = url;
else
if( url.match(/gallery/) && url.match(/photos/) ){
if(width < 790){
width = 790;
}
if(height < 650){
height = 650;
}
}
popSizedScrl = window.open(url,'popSizedScrl','height='+height+',width='+width+',scrollbars=yes,resizable=yes,toolbar=no,location=no');
popSizedScrl.focus();
return false;
}
var popApVid = null;
function popup_ap_video(url)
{
if (popApVid && !popApVid.closed){
popApVid.location.href = url;
}else{
var h = 598;
var w = 788;
popApVid = window.open(url,'popApVid','height=' + h + ',width=' + w + ',scrollbars=yes,resizable=yes,toolbar=no,location=no');
}
popApVid.focus();
record_click('ap_video',url);
return false;
}
var popVmix = null;
function popup_vmix(url)
{
if (popApVid && !popApVid.closed){
popApVid.location.href = url;
}else{
var h = 780;
var w = 840;
popVmix = window.open(url,'popVmix','height=' + h + ',width=' + w + ',scrollbars=yes,resizable=yes,toolbar=no,location=no');
}
popVmix.focus();
return false;
}
function goGallery(url) {
galleryWindow = window.open(url,'gallerypopup','status=yes,width=600,height=600,scrollbars=auto,resizable=yes');
}
function jump_to(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
/* this function allows us to track clicks on links that have other onclick functionalit.. bstone@adn.com 4/28/05 */
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//TIME STUFF
var ts;
ts=1206564307;
var d = new Date(ts * 1000);
function makeStamp(ss,hrs,str){
var str = getBreakingText(ss,hrs,str);
var className = getBreakingClass(ss);
if(str){
document.write('' + str + '');
}
}
function getBreakingClass(ss){
var diff = 4*60*60;
var className = 'breaking';
//ADDS MINOR CLASSNAME IF NEWS IS MORE THAN 4 HOURS OLD
if( (ts-ss) >= diff ){
className += ' minor';
}
return className;
}
function getBreakingText(ss,hrs,str){
//DEFAULT HOURS CHANGED TO 12 3/13/07
if(!hrs){hrs = 12;}
var diff = hrs*60*60;
if( (ts - ss) <= diff ){
if(!str){
var ds = new Date(ss * 1000);// * 1000);
//alert(ds.toLocaleString() + "\n" + d.toLocaleString());
var mer = 'a.m.';
var hr = ds.getHours();
var min = String(ds.getMinutes());
if(min.length < 2){
min = '0' + min;
}
if(hr > 12){
hr = hr - 12;
mer = 'p.m.';
}else if(hr == 12){
mer = 'p.m.';
}
str = hr + ':' + min + ' ' + mer + ' AKST';
}
return str;
}else{
return false;
}
}
function record_click(name,ref){
s_linkType="o";
s_linkName=name;
s_links_lnk=ref;
var done = false;
var ct = 0;
if(window.s_gs){
setTimeout("s_gs('nmanchorage')",0);
done = true;
}
}
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
function placeAd(){
var rh = 0;
var h1 = 0;
var h2 = 0;
if(document.getElementById('side_section')){
h1 = findPos(document.getElementById('side_section'))[1] + document.getElementById('side_section').offsetHeight;
}
if(document.getElementById('story_inset')){
h2 = findPos(document.getElementById('story_inset'))[1] + document.getElementById('story_inset').offsetHeight;
}
var story_text = document.getElementById('story_text');
var nodes = story_text.getElementsByTagName('p');
var done = false;
var className = 'embed_left';
if(h2 > h1){
className = 'embed_right';
}
for(var i=0;i ' + title + '