function PrintPage(){	
	if (window.location.href.indexOf("?") == -1 ) { 
	openwin(window.location.href + '?mode=print',25,25);
	}else{
	  openwin(window.location.href + '&mode=print',25,25);  
	 }
    
}

function openwin(url, tmp3, tmp4){
	scn_w = screen.availwidth;
	scn_h = screen.availheight;
	pos_x = (scn_w - tmp3)/2 - 20;
	pos_y = (scn_h - tmp4)/2;
	show3 = window.open( url,'show','width='+ tmp3 +',height='+ tmp4 +',top='+ pos_y +',left='+ pos_x +',resizable=0,scrollbars=auto,directories=0,toolbar=0,menubar=0');
	window.show3.focus();
}

$(document).ready(function () {
    $(".tour").fancybox({ 
    'width': 600, 
    'height': 427, 
    'autoScale': false, 
    'transitionIn': 'none', 
    'transitionOut': 'none',
     'type': 'iframe',
    'hideOnContentClick': false,
    'overlayColor': '#000',
    'overlayOpacity': 0.6
     });
});


function trim(s)
{
	return rtrim(ltrim(s));
}

function ltrim(s)
{
	var l=0;
	while(l < s.length && s[l] == ' ')
	{	l++; }
	return s.substring(l, s.length);
}

function rtrim(s)
{
	var r=s.length -1;
	while(r > 0 && (s[r] == ' ' || s[r] == '/'))
	{	r-=1;	}
	return s.substring(0, r+1);
}

      
    function Play() {
        if (window != window.top) {
            parent.Moodsplay();
        } else {
            window.location.href = $("#HfURL").text() + "?startplayer=1";
	}
    }

    function Stop() {
        if (window != window.top) {
            parent.MoodsStop();
        }
    }
    function Prev() {
        if (window != window.top) {
            parent.MoodsPrev();
        } else {
            window.location.href = $("#HfURL").text() + "?startplayer=1";
        }
    }
    function Next() {
        if (window != window.top) {
            parent.MoodsNext();
        } else {
            window.location.href = $("#HfURL").text() + "?startplayer=1";
        }
    }

 hs.graphicsDir = '/images/gallery/';
    hs.align = 'center';
    hs.transitions = ['expand', 'crossfade'];
    hs.fadeInOut = true;
    hs.outlineType = 'glossy-dark';
    hs.wrapperClassName = 'dark';
    hs.captionEval = 'this.a.title';
    hs.numberPosition = 'caption';
    hs.useBox = true;
    hs.width = 620;
    hs.height = 440;
    hs.dimmingOpacity = 0.6;

    // Add the slideshow providing the controlbar and the thumbstrip
    hs.addSlideshow({
        interval: 5000,
        repeat: false,
        useControls: true,
        fixedControls: 'fit',
        overlayOptions: {
            position: 'bottom center',
            opacity: .6,
            hideOnMouseOut: true
        },
        thumbstrip: {
            position: 'above',
            mode: 'horizontal',
            relativeTo: 'expander'
        }
    });
 


