﻿// JScript File
function loadSwfs(filename,width,height)
{
    var fname = new Array();
    fname = filename.split(',');
    
    var hei = new Array();
    hei = height.split(',');
    
    var wid = new Array();
    wid = width.split(',');
    
    var swf = "";
    
    for(var i=0;i<fname.length;i++)
    {
        swf = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='"+wid[i]+"' height='"+hei[i]+"'><param name='movie' value='../swf/"+fname[i]+".swf' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><embed wmode='transparent' src='../swf/"+fname[i]+".swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+wid[i]+"' height='"+hei[i]+"'></embed> </object>";
        document.getElementById(fname[i]).innerHTML=swf;
    }
}

function playVideo()
{
    var video="<object width='292' height='251'><param name='movie' value='http://www.youtube.com/v/gQQtexGybFc&hl=en&fs=1&color1=0x3a3a3a&color2=0x999999' /><param name='allowFullScreen' value='true' /><embed src='http://www.youtube.com/v/gQQtexGybFc&hl=en&fs=1&color1=0x3a3a3a&color2=0x999999' type='application/x-shockwave-flash' allowfullscreen='true' width='292' height='251'></embed></object>";
    //document.getElementById('playvideo').style.display='block';
    document.getElementById('lblVideo').innerHTML=video;
}

function ClearDefault(ctrl)
{
    if(ctrl.value=='Get the Good Times')
    {
        ctrl.value='';
    }
}
function RestoreValue(ctrl)
{
    if(ctrl.value.trim()=='')
    {
        ctrl.value='Get the Good Times';
    }
}
String.prototype.trim = function() 
{
    return this.replace(/^\s+|\s+$/g,"");
}

function isChecked()
{
    var hidSession=document.form1.TopMenu1_hidSession.value;
    if(hidSession=="False")
    {
        document.getElementById('divchk1').style.display="block";
        document.getElementById('divchk2').style.display="block";
        Timer();
    }
    else
    {
        location.href="../cheers/cheers.aspx";
    }
}

function closeChkDiv()
{
    document.getElementById('divchk1').style.display="none";
    document.getElementById('divchk2').style.display="none";
}


var loc=window.location;
var bit = 1;
var timerform
speed=1000

function dotimer()
{
    today=new Date()
    slutsec=today.getSeconds()
    slutmin=today.getMinutes()
    sluttim=today.getHours()
    sluta=(slutsec) + 60 * (slutmin) + 3600 * (sluttim)
    diff=sluta - starta
    tim=Math.floor(diff / 3600)
    min=Math.floor((diff / 3600 - tim) * 60)
    sek=Math.round((((diff / 3600 - tim) * 60) - min) * 60)
    if(sek > 5)
    {
        bit = 0;
        location.href=loc;
    }
    if(bit == 1)
    {
        window.setTimeout("dotimer()",speed)
    }
}

function Timer()
{
    today=new Date()
    startsek=today.getSeconds()
    startmin=today.getMinutes()
    starttim=today.getHours()
    starta=(startsek) + 60 * (startmin) + 3600 * (starttim)
    dotimer()
}
