﻿
function hideCtl()
{
    var ctl ;
    ctl=document.getElementById('Button1') ;
    //ctl.setAttribute('Visible', 'False');
    ctl.style.display = 'none';
}

function ScrollIt() {
    window.scrollTo(0, 120);
}
function ReceiveServerData(arg, context) {

    //document.getElementById('Image1').setAttribute('ImageUrl', imstr);

    for (cnt = 0; cnt <= 50; cnt = cnt + 1) {
        var ctr = cnt;
        var imstr = arg.toString;
        imstr = arg.toString();

        imstr = imstr.replace(imstr.slice(imstr.search('.gif') - 1, imstr.length), '');
        imstr = imstr + Math.floor(Math.random() * 10) + '.gif';
        document.getElementById('lblResults').innerText = imstr;
        document.getElementById('Himg').src = imstr
        //sleep(85)
    }

}

function sleep(ms) {
    var dt = new Date();
    dt.setTime(dt.getTime() + ms);
    while (new Date().getTime() < dt.getTime());
}

function SearchSite() {
    window.open('http://www.google.com/search?hl=en&amp;q=' + URLEncode(document.getElementById('q').value) + '&amp;btnG=Google+Search&amp;aq=f&amp;oq=', 'mywindow', 'width=1200,height=1200,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes')
;
}

function SubmitOnEnter(myfield, e) {
    var keycode;
    if (window.event)
        keycode = window.event.keyCode;
    else if (e)
        keycode = e.which;
    else
        return true;
    if (keycode == 13) {
        event.returnValue = false;
        SearchSite();
        return false;
    }
    else
        return true;
}

function URLEncode(clearString) {
    var output = '';
    var x = 0;
    clearString = clearString.toString();
    var regex = /(^[a-zA-Z0-9_.]*)/;
    while (x < clearString.length) {
        var match = regex.exec(clearString.substr(x));
        if (match != null && match.length > 1 && match[1] != '') {
            output += match[1];
            x += match[1].length;
        } else {
            if (clearString[x] == ' ')
                output += '+';
            else {
                var charCode = clearString.charCodeAt(x);
                var hexVal = charCode.toString(16);
                output += '%' + (hexVal.length < 2 ? '0' : '') + hexVal.toUpperCase();
            }
            x++;
        }
    }
    return output;
}
var wooYayIntervalId = 0;
var VGcounter = 0;

function StartVGcount() {

    VGcounter = document.getElementById("VGlast").innerHTML;
    document.getElementById("VGcount").innerHTML = "test";
    // Start the timer
    wooYayIntervalId = setInterval("GetVGcount()", 10000);


}

function GetVGcount() {
    //VGcounter = document.getElementById("VGlast").value
    
    document.getElementById("VGcount").innerHTML = VGcounter;
    

}

function 
doCheckDHTMLcapable() {
    browserName = navigator.appName;

    browserVersion = parseInt(navigator.appVersion);
    if
(browserName == "Netscape" && browserVersion >= 4) {

        MM_timelinePlay('Timeline1') // If it's NS 4+, run the animation

    }
    else;
    if (browserName == "Microsoft Internet Explorer" &&
browserVersion >= 4) {
        MM_timelinePlay('Timeline1') // If it's IE 4+, run the animation
    }
    else;
    // otherwise don't run the animation
}

function MM_initTimelines() {

    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.

    var ns = navigator.appName == "Netscape";  // set up check used to customize syntax
    document.MM_Time = new Array(1);

    document.MM_Time[0] = new Array(1);
    document.MM_Time["Timeline1"] =
document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";

    document.MM_Time[0].fps = 15;
    document.MM_Time[0][0] = new 
String("sprite");
    document.MM_Time[0][0].slot = 1;
    // The above line handles alternate syntax needed by Netscape and Explorer

    document.MM_Time[0][0].obj = (ns) ? document.animatedText :
document.all["animatedText"];
    document.MM_Time[0][0].keyFrames = new 
Array(1, 15);
    document.MM_Time[0][0].values = new Array(2);
    // The line below holds the horizontal positions for each move

    document.MM_Time[0][0].values[0] = new 
Array(300, 279, 257, 236, 214, 193, 171, 150, 129, 107, 86, 64, 43, 21, 0);

    document.MM_Time[0][0].values[0].prop = "left";
    // The line below holds the vertical positions for each move
    document.MM_Time[0][0].values[1] =
new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

    document.MM_Time[0][0].values[1].prop = "top";
    // The lines below handle alternate syntax needed by Explorer and Netscape
    if (!ns) {

        document.MM_Time[0][0].values[0].prop2 = "style";

        document.MM_Time[0][0].values[1].prop2 = "style";
    }

    document.MM_Time[0].lastFrame = 15;
    for (i = 0;
i < document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;

        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay =
1000 / document.MM_Time[i].fps;
    }
}

function 
MM_timelinePlay(tmLnName, myID) { //v1.0
    //Copyright 1997 Macromedia, Inc. All rights reserved.
    var 
i, j, tmLn, props, keyFrm, sprite, numKeyFr, firstKeyFr, propNum, theObj, firstTime = false;

    if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time

    tmLn = document.MM_Time[tmLnName];
    if (myID == null) {
        myID = ++tmLn.ID;
        firstTime = true;
    } //if new call, incr ID
    if (myID == tmLn.ID) { //if Im newest

        setTimeout('MM_timelinePlay("' + tmLnName + '",' + myID + ')', tmLn.delay);
        fNew
= ++tmLn.curFrame;
        for (i = 0; i < tmLn.length; i++) {
            sprite =
tmLn[i];
            if (sprite.charAt(0) == 's') {
                if (sprite.obj) {

                    numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];

                    if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr - 1]) {//in range
                        keyFrm = 1;
                        for (j = 0; j < sprite.values.length;
j++) {
                            props = sprite.values[j];
                            if (numKeyFr
!= props.length) {
                                if (props.prop2 == null)
                                    sprite.obj[props.prop] = props[fNew - firstKeyFr];
                                else
                                    sprite.obj[props.prop2][props.prop] = props[fNew - firstKeyFr];

                            } else {
                                while (keyFrm < numKeyFr &&
fNew >= sprite.keyFrames[keyFrm]) keyFrm++;
                                if (firstTime ||
fNew == sprite.keyFrames[keyFrm - 1]) {
                                    if (props.prop2 ==
null) sprite.obj[props.prop] = props[keyFrm - 1];
                                    else
                                        sprite.obj[props.prop2][props.prop] = props[keyFrm - 1];
                                }
                            }
                        }
                    }
                }

            } else if (sprite.charAt(0) == 'b' && fNew == sprite.frame)
                eval(sprite.value);
            if (fNew > tmLn.lastFrame) tmLn.ID = 0;
        }
    }
}
