/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$(document).ready(function()
{
    $("#showcase").awShowcase(
    {
        content_width:			595,
        content_height:			249,
        fit_to_parent:			false,
        auto:					true,
        interval:				3000,
        continuous:				true,
        loading:				true,
        tooltip_width:			200,
        tooltip_icon_width:		32,
        tooltip_icon_height:	32,
        tooltip_offsetx:		18,
        tooltip_offsety:		0,
        arrows:					true,
        buttons:				true,
        btn_numbers:			true,
        keybord_keys:			true,
        mousetrace:				false, /* Trace x and y coordinates for the mouse */
        pauseonover:			true,
        stoponclick:			false,
        transition:				'vslide', /* hslide/vslide/fade */
        transition_delay:		100,
        transition_speed:		500,
        show_caption:			'onhover', /* onload/onhover/show */
        thumbnails:				true,
        thumbnails_position:	'outside-last', /* outside-last/outside-first/inside-last/inside-first */
        thumbnails_direction:	'vertical', /* vertical/horizontal */
        thumbnails_slidex:		0, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
        dynamic_height:			false, /* For dynamic height to work in webkit you need to set the width and height of images in the source. Usually works to only set the dimension of the first slide in the showcase. */
        speed_change:			true, /* Set to true to prevent users from swithing more then one slide at once. */
        viewline:				false /* If set to true content_width, thumbnails, transition and dynamic_height will be disabled. As for dynamic height you need to set the width and height of images in the source. */
    });
});




function FloatTopDiv()
{
    startLX = ((document.body.clientWidth -MainContentW)/2)-LeftBannerW-LeftAdjust , startLY = TopAdjust+80;
    startRX = ((document.body.clientWidth -MainContentW)/2)+MainContentW+RightAdjust , startRY = TopAdjust+80;
    var d = document;
    function ml(id)
    {
        var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
        el.sP=function(x,y){
            this.style.left=x +4 + 'px';
            this.style.top=y + 'px';
        };
        el.x = startRX;
        el.y = startRY;
        return el;
    }
    function m2(id)
    {
        var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
        e2.sP=function(x,y){
            this.style.left=x - 10 + 'px';
            this.style.top=y + 'px';
        };
        e2.x = startLX;
        e2.y = startLY;
        return e2;
    }
    window.stayTopLeft=function()
    {
        if (document.documentElement && document.documentElement.scrollTop)
            var pY =  document.documentElement.scrollTop;
        else if (document.body)
            var pY =  document.body.scrollTop;
        if (document.body.scrollTop > 30){
            startLY = 3;
            startRY = 3;
        } else {
            startLY = TopAdjust;
            startRY = TopAdjust;
        };
        ftlObj.y += (pY+startRY-ftlObj.y)/16;
        ftlObj.sP(ftlObj.x, ftlObj.y);
        ftlObj2.y += (pY+startLY-ftlObj2.y)/16;
        ftlObj2.sP(ftlObj2.x, ftlObj2.y);
        setTimeout("stayTopLeft()", 1);
    }
    ftlObj = ml("divAdRight");
    //stayTopLeft();
    ftlObj2 = m2("divAdLeft");
    stayTopLeft();
}
function ShowAdDiv()
{
    var objAdDivRight = document.getElementById("divAdRight");
    var objAdDivLeft = document.getElementById("divAdLeft");       
    if (document.body.clientWidth < 1000)
    {
        objAdDivRight.style.display = "none";
        objAdDivLeft.style.display = "none";
    }
    else
    {
        objAdDivRight.style.display = "block";
        objAdDivLeft.style.display = "block";
        FloatTopDiv();
    }
}
