﻿/// <reference name="MicrosoftAjax.js"/>

Type.registerNamespace("Rkids");

Rkids.ClientControl = function(element) {
    Rkids.ClientControl.initializeBase(this, [element]);
}

Rkids.ClientControl.prototype = {
    initialize: function() {
        Rkids.ClientControl.callBaseMethod(this, 'initialize');
       
        
        // Add custom initialization here
    },
    dispose: function() {        
        //Add custom dispose actions here
        Rkids.ClientControl.callBaseMethod(this, 'dispose');
    }
}
Rkids.ClientControl.registerClass('Rkids.ClientControl', Sys.UI.Control);

var sliderEvents;
var imageEvents;
var imgUrlEvents = "";

var sliderSTC;
var imageSTC;
var imgUrlSTC = "";


function pageLoad() {

    sliderEvents = $find('EventsBehaviorBAID');
    if (sliderEvents == null)
    { }
    else {
        sliderEvents.add_slideChanging(onSlideChangedEvents);
        imageEvents = document.getElementById('ctl00_ContentPlaceHolder1_SlideShowEvents');
    }

    sliderSTC = $find('STCBehaviorBAID');
    if (sliderSTC == null)
    { }
    else {
        sliderSTC.add_slideChanging(onSlideChangedSTC);
        imageSTC = document.getElementById('ctl00_ContentPlaceHolder1_SlideShowSTC');
    }    
}

function onSlideChangedEvents(sender, args) {
    imgUrlEvents = sliderEvents._slides[args._slideIndex].Description;
    if (imgUrlEvents == null) {
        imageEvents.style.cursor = "default";
    }
    else {
        imageEvents.style.cursor = "hand";
    }
}

function onSlideChangedSTC(sender, args) {
    imgUrlSTC = sliderSTC._slides[args._slideIndex].Description;
    if (imgUrlSTC == null) {
        imageSTC.style.cursor = "default";
    }
    else {
        imageSTC.style.cursor = "hand";
    }
}

function openAdWindowEvents() {

    if (imgUrlEvents == null) {
    }
    else {
        window.open(imgUrlEvents);
    }
}

function openAdWindowSTC() {

    if (imgUrlSTC == null) {
    }
    else {
        window.open(imgUrlSTC);
    }
}

if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

