function showPic(img){
	myW = window.open("", "", 'toolbar=0,width=1024,height=768');
	myW.document.write('<HTML><HEAD><TITLE>trailer.lt</TITLE><meta http-equiv="imagetoolbar" content="no">');
	myW.document.write('<link rel="stylesheet" type="text/css" href="js-css/style_2.css" /></HEAD><BODY>');
	//myW.document.write('<table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%"><tr>');
	//myW.document.write('<td align="center" style="border:1px solid gray; background-color:#ECECEC">');
   myW.document.write('<img src="/phpThumb/phpThumb.php?src=/photos/original/'+img+'&w=1024&fltr[]=wmi|/images/watermark/watermark.png|BL" style="border:1px solid #3A519D">');
	//myW.document.write('</td></tr></table>');
	myW.document.write('</body></html>');
	myW.document.bgColor="#244497";
	myW.document.close();
}



function getPageSize()
{
    var xScroll, yScroll;

    if (window.innerHeight && window.scrollMaxY) {
        xScroll = window.innerWidth + window.scrollMaxX;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight) {
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else {
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }

    var windowWidth, windowHeight;

    if (self.innerHeight) {
        if(document.documentElement.clientWidth){
            windowWidth = document.documentElement.clientWidth;
        } else {
            windowWidth = self.innerWidth;
        }
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) {
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }

    if(yScroll < windowHeight){
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }

    if(xScroll < windowWidth){
        pageWidth = xScroll;
    } else {
        pageWidth = windowWidth;
    }

    return [pageWidth,pageHeight];
}

function makeOverlay()
{
    var w = getPageSize()[0];
    var h = getPageSize()[1];

    jQuery('<div id="black" class="togglings"></div>').css({
        "background":"#000",
        "width":w+"px",
        "height":h+"px",
        "color":"#FFF",
        "opacity":".8",
        "filter":"alpha(opacity=80)",
        "position":"absolute",
        "z-index":10
    }).appendTo(document.body).click(function(){
        $(".togglings").hide();
    });

    var over_html = 'asdasdasfasfasfasfas';    
   

    jQuery(over_html).css({
        "width":"600px",
        //"height":"100px",
        "color":"#F00",
        "position":"absolute",
        "left":"33%",
        "top":"50%",
        "margin":"-50px 0 0 -100px",
        "z-index":20,
        "color":"#FFF",
        "font-weight":"bold",
        "font-size":"40px",
        "text-transform":"uppercase",
        "text-align":"center"
    }).appendTo(document.body);
}
