﻿
//scrolling images and videos
//update on Monday 6:00PM

var initDate = new Date();
var curDate = initDate.getDate();
var curMonth = initDate.getMonth() + 1;
var curYear = initDate.getFullYear();
var curHour = initDate.getHours();
var curUTCHour = initDate.getUTCHours() ;

//var todayDate = curMonth + "/" + curDate + "/" + curYear; 

var segLabel= new Array;
var segTitle= new Array;
var itemID = new Array;
var show = 1;
var showLink = "no";


/*
//Week 1 - 06/28 - 07/04
if ((curMonth == 6 && curDate >= 28) || (curMonth == 7 && curDate <= 3) )
{
    show=1;
    segLabel[1] = "Taurus TCP";
    segTitle[1]  = "Taurus TCP Pistol";
    itemID[1]    = "1-738039";
    segLabel[2] = "Ruger LCP";
    segTitle[2]  = "Ruger LCP Pistol";
    itemID[2]    = "3701";
    segLabel[3] = "Glock 27";
    segTitle[3]  = "Glock 27 Pistol";
    itemID[3]    = "PI-27502";
    segLabel[4] = "Walther PPS";
    segTitle[4]  = "Walther PPS Pistol";
    itemID[4]    = "WAP10001";
    segLabel[5] = "FNH TSR";
    segTitle[5]  = "Cool to Own - FNH TSR Rifle";
    itemID[5]    = "75404";

    if ( (curDate == 28 && curUTCHour >= 22) || (CurDate > 28 || curDate <= 3) ) {
        showLink = "yes";
    }   
}
    
 
// week 2 - 07/04 - 07/10
if  (curMonth == 7 && curDate >= 4 && curDate <= 10)
{
    show=2;
    segLabel[1] = "Taurus<br>PT1911";
    segTitle[1]  = "Taurus PT1911 Pistol";
    itemID[1]    = "1-191101ALR";
    segLabel[2] = "S & W<br>SW1911";
    segTitle[2]  = "S~W SW1911 Pistol";
    itemID[2]    = "108282";
    segLabel[3] = "Legacy<br>Citadel";
    segTitle[3]  = "Legacy Citadel Pistol";
    itemID[3]    = "CIT45FSP";
    segLabel[4] = "IAC<br>R100";
    segTitle[4]  = "IAC R100 Pistol";
    itemID[4]    = "R100";
    segLabel[5] = "Springfield<br>M1A";
    segTitle[5]  = "Cool to Own - Springfield M1A Rifle";
    itemID[5]    = "AA9626";

    if ( (curDate == 5 && curUTCHour >= 22) || (curDate > 5) ) {
        showLink = "yes";
    }   
}
 

//Week 3 - 07/11 - 07/17 Shotguns
if  (curMonth == 7 && curDate >= 11 && curDate <= 17)
{
    show=3;
    segLabel[1] = "Mossberg<br>500";
    segTitle[1]  = "Mossberg 500 TAC Shotgun";
    itemID[1]    = "50420";
    segLabel[2] = "Weatherby<br>PA459";
    segTitle[2]  = "Weatherby PA459 Shotgun";
    itemID[2]    = "PA4591219PGM";
    segLabel[3] = "Remington<br>870";
    segTitle[3]  = "Remington 870 Shotgun";
    itemID[3]    = "5077";
    segLabel[4] = "FNH<br>SLP-MK1";
    segTitle[4]  = "FNH SLP-MK1 Shotgun";
    itemID[4]    = "3088929022";
    segLabel[5] = "Winchester<br>1892";
    segTitle[5]  = "Cool to Own - Winchester 1892 Rifle";
    itemID[5]    = "534154140";

    if ( (curDate == 12 && curUTCHour >= 22) || (curDate > 12) ) {
        showLink = "yes";
    }     
}

//week4 - 07/18 - 07/24 - 10/22 LR Rifles
   if  (curMonth == 7 && curDate >= 18 && curDate <= 24)
    {
    show=4;
    segLabel[1] = "Ruger<br>10/22";
    segTitle[1]  = "Ruger 10/22 Rifle";
    itemID[1]    = "1240";
    segLabel[2] = "Marlin<br>70PSS";
    segTitle[2]  = "Marlin 70PSS Rifle";
    itemID[2]    = "70PSS";
    segLabel[3] = "S & W<br>M&P 15-22";
    segTitle[3]  = "Smith ~ Wesson M~P 15-22 Rifle";
    itemID[3]    = "811033";
    segLabel[4] = "Mossberg<br>702 ";
    segTitle[4]  = "Mossberg 702 Rifle";
    itemID[4]    = "37001";
    segLabel[5] = "Mossberg<br>500 JIC";
    segTitle[5]  = "Cool to Own - Mossberg 500 JIC Shotgun";
    itemID[5]    = "55340";
    
    if ( (curDate == 19 && curUTCHour >= 22) || (curDate > 19) ) {
        showLink = "yes";
    }     
}



//week5 - 07/25 - 07/31 Rifles
if  (curMonth == 7 && curDate >= 25 && curDate <= 31)
{
    show=5;
    segLabel[1] = "BrazTech<br>R92C";
    segTitle[1]  = "BrazTech Rossi 92C Rifle";
    itemID[1]    = "R92-56008";
    segLabel[2] = "Ruger<br>New Vaq";
    segTitle[2]  = "Ruger New Vaquero Revolver";
    itemID[2]    = "NV-455";
    segLabel[3] = "Marlin<br>1895";
    segTitle[3]  = "Marlin 1895 Rifle";
    itemID[3]    = "1895-COWBOY";
    segLabel[4] = "Mossberg<br>464";
    segTitle[4]  = "Mossberg 464 Rifle";
    itemID[4]    = "41010";
    segLabel[5] = "Glock<br>22";
    segTitle[5]  = "Cool to Own - Glock 22 Pistol";
    itemID[5]    = "PG-22502-03";
    
    if ( (curDate == 26 && curUTCHour >= 22) || (curDate > 26) ) {
        showLink = "yes";
    }         
}

//week6 - 08/1 - 08/7 
if (curMonth == 8 && curDate  >= 1  && curDate <= 7)   
{
    show=6;
    segLabel[1] = "Ruger<br>P90TH";
    segTitle[1]  = "Ruger P90TH Pistol";
    itemID[1]    = "P90TH";
    segLabel[2] = "Glock<br>21";
    segTitle[2]  = "Glock 21 Pistol";
    itemID[2]    = "PI-21502-03";
    segLabel[3] = "FNH<br>Five-SeveN";
    segTitle[3]  = "FNH Five-SeveN Pistol";
    itemID[3]    = "3868929120";
    segLabel[4] = "FNH<br>FNP-45";
    segTitle[4]  = "FNH FNP-45 Pistol";
    itemID[4]    = "47577";
    segLabel[5] = "FNH<br>FNAR";
    segTitle[5]  = "Cool to Own - FNH FNAR Rifle";
    itemID[5]    = "3108929100";

    if ( (curDate == 2 && curUTCHour >= 22) || (curDate > 2) ) {
        showLink = "yes";
    }         

}

//week7 - 08/8 - 08/14 Rifles
if (curMonth == 8 && curDate >= 8 && curDate <= 14)   
{
    show=7;
    segLabel[1] = "Taurus<br>85";
    segTitle[1]  = "Taurus 85 Revolver";
    itemID[1]    = "M85SS2UL";
    segLabel[2] = "Ruger<br>LCR";
    segTitle[2]  = "Ruger LCR Revolver";
    itemID[2]    = "5401";
    segLabel[3] = "Charter<br>Pink Lady";
    segTitle[3]  = "Charter Pink Lady Revolver";
    itemID[3]    = "53830";
    segLabel[4] = "S & W<br>Bodyguard";
    segTitle[4]  = "Smith ~ Wesson Bodyguard Revolver";
    itemID[4]    = "103038";
    segLabel[5] = "Weatherby<br>Mark XXII";
    segTitle[5]  = "Cool to Own - Weatherby Mark XXII Rifle";
    itemID[5]    = "DXT22LR3O";

    if ( (curDate == 9 && curUTCHour >= 22) || (curDate > 9) ) {
        showLink = "yes";
    }         

}

//week8 - 08/15 - 08/21 
if (curMonth == 8 && curDate >= 15 && curDate <= 21) 
{
    show=8;
    segLabel[1] = "Taurus<br>PT24/7";
    segTitle[1]  = "Taurus PT24/7 Pro DS Pistol";
    itemID[1]    = "1-247409P-15";
    segLabel[2] = "Ruger<br>P-95";
    segTitle[2]  = "Ruger P-95 Pistol";
    itemID[2]    = "P95PR15";
    segLabel[3] = "Glock<br>19";
    segTitle[3]  = "Glock 19 Pistol";
    itemID[3]    = "#PI-19502-03";
    segLabel[4] = "FNH<br>FNX-9";
    segTitle[4]  = "FNH FNX-9 Pistol";
    itemID[4]    = "66822";
    segLabel[5] = "Browning<br>BAR";
    segTitle[5]  = "Cool to Own - Browning BAR Rifle ";
    itemID[5]    = "031539246";

    if ( (curDate == 16 && curUTCHour >= 22) || (curDate > 16) ) {
        showLink = "yes";
    }         

}



//week9 - 08/22 - 08/28 
if (curMonth == 8 && curDate >= 22 && curDate <= 28) 
{
    show=9;
    segLabel[1] = "Remington<br>887";
    segTitle[1]  = "Remington 887 Shotgun";
    itemID[1]    = "82500";
    segLabel[2] = "Browning<br>Maxus";
    segTitle[2]  = "Browning Maxus Shotgun";
    itemID[2]    = "011601204";
    segLabel[3] = "Weatherby<br>SA-08";
    segTitle[3]  = "Weatherby SA-08 Shotgun";
    itemID[3]    = "SA08S1228PGM";
    segLabel[4] = "Mossberg<br>500";
    segTitle[4]  = "Mossberg 500 FLD Shotgun";
    itemID[4]    = "56420";
    segLabel[5] = "S & W<br>642-C";
    segTitle[5]  = "Cool to Own - S~W 642 Centennial Revolver";
    itemID[5]    = "178025";

    if ( (curDate == 23 && curUTCHour >= 22) || (curDate > 23) ) {
        showLink = "yes";
    }       
}
*/

//week10 - 08/29 - 09/04 Rifles
if ((curMonth == 8 && curDate >= 29) || (curMonth == 9 && curDate <= 4))
{
    show=10;
    segLabel[1] = "Browning<br>X-Bolt";
    segTitle[1]  = "Browning X-Bolt Rifle";
    itemID[1]    = "035200226";
    segLabel[2] = "Ruger<br>M77";
    segTitle[2]  = "Ruger M77 Rifle";
    itemID[2]    = "7124";
    segLabel[3] = "Weatherby<br>Vanguard";
    segTitle[3]  = "Weatherby Vanguard Rifle";
    itemID[3]    = "VGW306SR4O";
    segLabel[4] = "Marlin<br>XL7";
    segTitle[4]  = "Marlin XL7 Rifle";
    itemID[4]    = "XL7-3006";2
    segLabel[5] = "Mossberg<br>500";
    segTitle[5]  = "Cool to Own - Mossberg 500 SPL Shotgun";
    itemID[5]    = "51482";

    if ( (curDate == 30 && curUTCHour >= 22) || (curDate > 30 || curDate <= 4) ) {
        showLink = "yes";
    }       

}

//week11 - 09/5 - 09/11 
if (curMonth == 9 && curDate >= 5 && curDate <= 11) 
{
    show=11;
    segLabel[1] = "Taurus<br>990";
    segTitle[1]  = "Taurus 990 Pistol";
    itemID[1]    = "2-990069";
    segLabel[2] = "Ruger<br>22/45";
    segTitle[2]  = "Ruger 22/45 Pistol ";
    itemID[2]    = "P512MKIII";
    segLabel[3] = "Walther<br>P22"
    segTitle[3]  = "Walther P22 Pistol";
    itemID[3]    = "WAP22003";
    segLabel[4] = "Browning<br>Buckmark";
    segTitle[4]  = "Browning Buckmark Pistol";
    itemID[4]    = "051415490";
    segLabel[5] = "Para USA<br>TTR";
    segTitle[5]  = "Cool to Own - Para USA TTR Rifle";
    itemID[5]    = "TTRXAS";

    if ( (curDate == 6 && curUTCHour >= 22) || (curDate > 6) ) {
        showLink = "yes";
    }       

}

//week12 - 09/12 - 09/18 
if (curMonth == 9 && curDate >= 12 && curDate <= 18) 
{
    show=12;
    segLabel[1] = "Ruger<br>SR556";
    segTitle[1]  = "Ruger SR556 Rifle";
    itemID[1]    = "5902-RUG";
    segLabel[2] = "FNH<br>SCAR";
    segTitle[2]  = "FNH SCAR Rifle";
    itemID[2]    = "98521";
    segLabel[3] = "Bushmaster<br>E2S";
    segTitle[3]  = "Bushmaster E2S Rifle";
    itemID[3]    = "BCWA3F-16M4";
    segLabel[4] = "Les Baer<br>PS";
    segTitle[4]  = "Les Baer PS Rifle";
    itemID[4]    = "ARLB0019/PS/N";
    segLabel[5] = " ";
    segTitle[5]  = "Cool to Own -  ";
    itemID[5]    = " ";

    if ( (curDate == 13 && curUTCHour >= 22) || (curDate > 13) ) {
        showLink = "yes";
    }       

}

//week13 - 09/19 - 09/25 
if (curMonth == 9 && curDate >= 19 && curDate <= 25)
{
    show=13;
    segLabel[1] = "Remington<br>770";
    segTitle[1]  = "Remington 770 Rifle";
    itemID[1]    = "85633";
    segLabel[2] = "Mossberg<br>4X4";
    segTitle[2]  = "Mossberg 4X4 Rifle";
    itemID[2]    = "27487";
    segLabel[3] = "Legacy<br>M1500";
    segTitle[3]  = "Legacy M1500 Rifle";
    itemID[3]    = "HWK97101P+";
    segLabel[4] = "Savage<br>10XP";
    segTitle[4]  = "Savage 10XP Rifle";
    itemID[4]    = "18115";
    segLabel[5] = "Springfield<br>XDM";
    segTitle[5]  = "Cool to Own - Springfield XDM Pistol";
    itemID[5]    = "XDM9389BHC";

    if ( (curDate == 20 && curUTCHour >= 22) || (curDate > 20) ) {
        showLink = "yes";
    }       

}


//====================== end weeks ============================

function openModalWindowTV(tvURL) {
    var sFeatures="dialogHeight:425px; dialogWidth:580px; dialogTop:140px;resizable:no;scroll:no;status:no;center:yes";
    tvURL = "http://video.galleryofguns.com/tvshow/tvPlayHomePageVideo.aspx?" + tvURL;
    window.showModalDialog(tvURL, "TVWindow", sFeatures)

}
 

//########## DO NOT CHANGE BELOW THIS LINE ####################

var swidth = 645; //scroller's width  645
var sheight = 120; //scroller's height  125
var imgWidth = 122;  //images width
var imgHeight = 90;  //image height
var descFontSize = 12; //text size
var labelWidth = 110; //label width
var labelHeight = 18; // label height
var sspeed = 20;  //scroller's speed
var restart = sspeed;
var rspeed = sspeed;
var spause = 9000; //scroller's pause
var sbcolor = "transparent"; //scroller's background

var msg0Strip = new Array;
var msg1Strip = new Array;

//msg0 - get quote
for (i=1; i<=5;i++) {
    msg0Strip[i] = "<td align='center' valign=top style='cursor:pointer'>"
        + "<img width='" + imgWidth + "' height='" + imgHeight + "' "
        + "src='http://video.galleryofguns.com/imagesgog/img-tv-s"+i+".jpg'  border='0' style='border:solid 1px #ffffff' ";

    if (showLink == "yes") {    
    msg0Strip[i] += "alt='Click to watch this segment video' title='Click to watch this segment video' "
        + "onclick=\"openModalWindowTV('showseg=show"+show+"_segment"+i+"&itemID="+itemID[i]+"&segTitle="+segTitle[i]+"')\" >"
        + "<div style='font-size:11pt; font-weight:bold; font-family:verdana; color:#ffff99; height:"+(labelHeight+14)+"px;width:"+labelWidth+"px; position:relative;margin-top:-87px;margin-left:-2px;padding-top:2px; vertical-align:middle' onclick=\"openModalWindowTV('showseg=show"+show+"_segment"+i+"&itemID="+itemID[i]+"&segTitle="+segTitle[i]+"')\" >"
        + "<div style='position:relative;margin-left:-6px;'><img src='http://video.galleryofguns.com/images/icon-video-left-off.png' height='16' width='28' border='0' alt='Click to watch the segment video.' /></div>"
        + "<div style='margin-top:-1px;'>"+segLabel[i]+"</div>"
        +"</div>";
    }
    else {
    msg0Strip[i] = "<td align='center' valign=top style='cursor:default'>"
    +"<img width='" + imgWidth + "' height='" + imgHeight + "' src='http://video.galleryofguns.com/imagesgog/img-tv-s"+i+".jpg'  border='0' style='border:solid 1px #ffffff' alt='Video Available on Monday Evening' title='The segment video &#10;will be available at airing time: &#10;Monday, 6:00 PM ET' >"
    +"<div style='font-size:11pt; font-weight:bold; font-family:verdana; color:#ffff99; height:"+labelHeight+"px;width:"+labelWidth+"px; position:relative;margin-top:-75px;margin-left:-2px;padding-top:2px; vertical-align:middle'>"+ segLabel[i]+"</div>";
    }    
    
    msg0Strip[i] += "<a class='noline' href='http://www.galleryofguns.com/genie/Default.aspx?item="+itemID[i]+"' target='_parent' title='Get an instant quote for this item'><div style='background-color:#880000; color:#ffffff; border:solid 1px #ffffff; height:16px;width:100px; position:relative;margin-top:20px;margin-left:-3px; text-decoration:none;padding-top:2px;font-weight:normal;font-size:8pt;z-index:100'> INSTANT QUOTE</div></a>"
    + "</td>";
}



var msgText = new Array();
msgText[0] = '<table style="font-size:' + descFontSize + 'px; font-family:verdana;margin-left:-2px;" width="650px"><tr><td colspan="5" align="center"> <b>+++++ GOG TV SHOW FEATURED ITEMS THIS WEEK +++++</b> </td></tr><tr>' + msg0Strip[1] + msg0Strip[2] + msg0Strip[3] + msg0Strip[4] + msg0Strip[5] + '</tr></table>';

//vote on sportsman channel
msgText[1] = '<table style="font-size:12pt; font-family:verdana;margin-left:-2px;color:#ffffff;" width="650px;"><tr><td colspan="3" align="center"><div style="width:100%;margin-top:10px;"><b>~~~ VOTE FOR GOG TV SHOW ~~~</b></div></td></tr><tr><td align="right" valign="middle" width="250px" style="vertical-align:middle;"><b>click this</b> </td><td align="center"><div style="margin-top:-10px;vertical-align:middle;"><a class="noline" href="http://www.votesportsman.com/" target="_blank"><img src="http://video.galleryofguns.com/images/sportsmanaward2010.png" height="100px" border="0" title="Click this logo to vote"></a></div></td><td align="left" width="250px" style="vertical-align:middle;"> <b>to vote</b></td></tr></table>';

//-- end Parameters and message -->


//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//----------------------------------------------- do not change below ---------------------------------
//-- begin: Scroller's Algorithm -->
var ii = 0;
var gekso = 0;
if (navigator.product) {
    var agt = navigator.userAgent.toLowerCase();
    var rvStart = agt.indexOf('rv:');
    var rvEnd = agt.indexOf(')', rvStart);
    var check15 = agt.substring(rvStart + 3, rvEnd);
    if (parseFloat(check15) < 1.8) gekso = 1;
}

var operbr = 0; operbr = navigator.userAgent.toLowerCase().indexOf('opera');

function goup() {
    if (sspeed != rspeed * 16) { sspeed = sspeed * 2; restart = sspeed; }
}
function start() {
    if (document.getElementById) {
        ns6div = document.getElementById('iens6div');
        if (operbr != -1) operdiv = document.getElementById('operaslider');
        ns6div.style.left = swidth + "px";
        ns6div.innerHTML = msgText[0];
        sizeup = ns6div.offsetWidth;
        if (operbr != -1 && sizeup == swidth) {
            operdiv.innerHTML = msgText[0];
            sizeup = operdiv.offsetWidth;
        }
        ns6scroll();
    }
    else if (document.layers) {
        ns4layer = document.ns4div.document.ns4div1; ns4layer.left = swidth;
        ns4layer.document.write(msgText[0]);
        ns4layer.document.close();
        sizeup = ns4layer.document.width; ns4scroll();
    }
    else if (document.all) {
        iediv = iens6div;
        iediv.style.pixelLeft = swidth + "px";
        iediv.innerHTML = msgText[0]; sizeup = iediv.offsetWidth; iescroll();
    }
}

function iescroll() {
    if (iediv.style.pixelLeft > 0 && iediv.style.pixelLeft <= sspeed) {
        iediv.style.pixelLeft = 0; setTimeout("iescroll()", spause);
    }
    else if (iediv.style.pixelLeft >= sizeup * -1) {
        iediv.style.pixelLeft -= sspeed + "px";
        setTimeout("iescroll()", 10000);
    }
    else {
        if (ii == msgText.length - 1) ii = 0;
        else ii++;
        iediv.style.pixelLeft = swidth + "px";
        iediv.innerHTML = msgText[ii];
        sizeup = iediv.offsetWidth;
        iescroll();
    }
}

function ns4scroll() {
    if (ns4layer.left > 0 && ns4layer.left <= sspeed) {
        ns4layer.left = 0;
        setTimeout("ns4scroll()", spause);
    }
    else if (ns4layer.left >= sizeup * -1) {
        ns4layer.left -= sspeed; setTimeout("ns4scroll()", 10);
    }
    else {
        if (ii == msgText.length - 1) ii = 0; else ii++;
        ns4layer.left = swidth;
        ns4layer.document.write(msgText[ii]);
        ns4layer.document.close();
        sizeup = ns4layer.document.width; ns4scroll();
    }
}

function ns6scroll() {
    if (parseInt(ns6div.style.left) > 0 && parseInt(ns6div.style.left) <= sspeed) {
        ns6div.style.left = 0; setTimeout("ns6scroll()", spause);
    }
    else if (parseInt(ns6div.style.left) >= sizeup * -1) {
        ns6div.style.left = parseInt(ns6div.style.left) - sspeed + "px"; setTimeout("ns6scroll()", 10); //100
    }
    else {
        if (ii == msgText.length - 1) ii = 0; else ii++;
        ns6div.style.left = swidth + "px";
        ns6div.innerHTML = msgText[ii];
        sizeup = ns6div.offsetWidth;
        if (operbr != -1 && sizeup == swidth) {
            operdiv.innerHTML = msgText[ii]; sizeup = operdiv.offsetWidth;
        }
        ns6scroll();
    }
}
//-- end Algorithm -->


document.write('<table align="center" border="0" cellpadding=0 cellspacing=0 style="color:#ffffff; font-size:10px; font-family:verdana"><tr>');
document.write('<td width="' + swidth + 'px">');
if (document.layers) {
    document.write('<ilayer id="ns4div" width="' + swidth + '" height="' + sheight + '" bgcolor=' + sbcolor + '><layer id="ns4div1" width="' + swidth + '" height="' + sheight + '" onmouseover="sspeed=0;" onmouseout="sspeed=restart"></layer></ilayer>')
}
if (document.getElementById || document.all) {
    document.write('<div style="position:relative;overflow:hidden;width:' + swidth + 'px;height:' + sheight + 'px;clip:rect(0 ' + swidth + 'px ' + sheight + 'px 0);background-color:' + sbcolor + ';" onmouseover="sspeed=0;" onmouseout="sspeed=restart">');
    if (operbr == -1) document.write('<div id="iens6div" style="position:absolute;height:' + sheight + 'px;"></div></div>');
    else document.write('<div id="iens6div" style="position:relative;height:' + sheight + 'px;"></div><div id="operaslider" style="position:absolute;visibility:hidden;"></div></div>');
    document.write('</td></tr></table>');
}

start();
