$(function()
    {	
        $(".ui-widget-overlay").live('click', function(){
            $(".ui-dialog-titlebar-close").trigger('click');
			$('#uzsakymai').remove();
        });

        $('.vox_uzsakymas').click(function()
        {
			createDiv();
			
            Vuzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');
			
            
					
            Vuzsakymas.html('<iframe src="http://test.vox.lt/sites/all/formos/vox.php" frameborder="0" height="860px" scrolling="no" width="700px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
		
		$('.zebra_uzsakymas').click(function()
        {
			createDiv();
			
            Zuzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');
					
            Zuzsakymas.html('<div style="position:relative; top:30px; right:-629px; width:15px; height: 16px;"><a href="JavaScript: void(0)" title="" style="background: url(\'http://internetas.zebra.lt/sites/all/formos/img/gala/pop-close.png\') repeat scroll 0 0 transparent; display: block; height: 16px; margin: -2px 0 0; text-decoration: none; text-indent: -10000px; width: 15px;" onclick="$(\'.ui-widget-overlay\').click()">&nbsp;</a></div><iframe src="http://internetas.zebra.lt/sites/all/formos/zebra.php?pasiulymas='+id+'" frameborder="0" height="667px" scrolling="no" width="665px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
		
		$('.gala2_uzsakymas').click(function()
        {
			createDiv();
			
            Zuzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');
			
			var tipas = $("#uztipas").html();
			var laikotarpis = $("#uzlaikotarpis").html();

            Zuzsakymas.html('<div style="position:relative; top:30px; right:-629px; width:15px; height: 16px;"><a href="JavaScript: void(0)" title="" style="background: url(\'http://www.gala.lt/sites/all/formos/img/gala/pop-close.png\') repeat scroll 0 0 transparent; display: block; height: 16px; margin: -2px 0 0; text-decoration: none; text-indent: -10000px; width: 15px;" onclick="$(\'.ui-widget-overlay\').click()">&nbsp;</a></div><iframe src="http://www.gala.lt/sites/all/formos/gala.php?tipas='+tipas+'&laikotarpis='+laikotarpis+'" frameborder="0" height="750px" scrolling="no" width="665px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
		
		$('.zebra2_uzsakymas').click(function()
        {
			createDiv();
			
            Zuzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');
			
			var eile = $("#akeile").html();
			var tipas = $("#aktipas").html();
			
			if ((eile == "1") || (eile == "2") || (eile == "3")) {
				var laik = $("#T"+eile+"S").attr("selectedIndex");
			} else {
				var laik = $("#B"+(eile-3)+"S").attr("selectedIndex");
			}

            Zuzsakymas.html('<div style="position:relative; top:30px; right:-629px; width:15px; height: 16px;"><a href="JavaScript: void(0)" title="" style="background: url(\'http://www.gala.lt/sites/all/formos/img/gala/pop-close.png\') repeat scroll 0 0 transparent; display: block; height: 16px; margin: -2px 0 0; text-decoration: none; text-indent: -10000px; width: 15px;" onclick="$(\'.ui-widget-overlay\').click()">&nbsp;</a></div><iframe src="http://internetas.zebra.lt/sites/all/formos/zebra2.php?tipas='+tipas+'&laikotarpis='+laik+'&eile='+eile+'" frameborder="0" height="680px" scrolling="no" width="665px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
		
		$('.gala_uzsakymas').click(function()
        {
			createDiv();
			
            Guzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');
			
            
					
            Guzsakymas.html('<iframe src="http://test.vox.lt/sites/all/formos/gala.php" frameborder="0" height="900px" scrolling="no" width="700px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
        
        $('.vox2_uzsakymas').click(function()
        {
			createDiv();
			
            Guzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');
			
            
					
            Guzsakymas.html('<div style="position:relative; top:30px; right:-634px; width:15px; height: 16px;"><a href="JavaScript: void(0)" title="" style="background: url(\'http://www.gala.lt/sites/all/formos/img/gala/pop-close.png\') repeat scroll 0 0 transparent; display: block; height: 16px; margin: -2px 0 0; text-decoration: none; text-indent: -10000px; width: 15px;" onclick="$(\'.ui-widget-overlay\').click()">&nbsp;</a></div><iframe src="http://www.vox.lt/sites/all/formos/vox2.php?pasiulymas=1" frameborder="0" height="600px" scrolling="no" width="670px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
		
		$('.gala3_uzsakymas').click(function()
        {
			createDiv();
			
            Zuzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');

            Zuzsakymas.html('<div style="position:relative; top:30px; right:-629px; width:15px; height: 16px;"><a href="JavaScript: void(0)" title="" style="background: url(\'http://www.gala.lt/sites/all/formos/img/gala/pop-close.png\') repeat scroll 0 0 transparent; display: block; height: 16px; margin: -2px 0 0; text-decoration: none; text-indent: -10000px; width: 15px;" onclick="$(\'.ui-widget-overlay\').click()">&nbsp;</a></div><iframe src="http://www.gala.lt/sites/all/formos/gala7.php?tipas=0" frameborder="0" height="700px" scrolling="no" width="665px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
		
		$('.gala4_uzsakymas').click(function()
        {
			createDiv();
			
            Zuzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var id = $(this).attr('id');

            Zuzsakymas.html('<div style="position:relative; top:30px; right:-629px; width:15px; height: 16px;"><a href="JavaScript: void(0)" title="" style="background: url(\'http://www.gala.lt/sites/all/formos/img/gala/pop-close.png\') repeat scroll 0 0 transparent; display: block; height: 16px; margin: -2px 0 0; text-decoration: none; text-indent: -10000px; width: 15px;" onclick="$(\'.ui-widget-overlay\').click()">&nbsp;</a></div><iframe src="http://www.gala.lt/sites/all/formos/gala7.php?tipas=1" frameborder="0" height="620px" scrolling="no" width="665px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
		
		$('.gala5_uzsakymas').click(function()
        {
			createDiv();
			
            Zuzsakymas = $('#uzsakymai').dialog({
                autoOpen:false,
                minHeight: 20,
                modal: true,
                resizable: false,
                width: 'auto',
                position: 'center'
            });
		
            var laikas = $('#kokslk').html();
			var tipas = $('#kokstv').html();

            Zuzsakymas.html('<div style="position:relative; top:30px; right:-629px; width:15px; height: 16px;"><a href="JavaScript: void(0)" title="" style="background: url(\'http://www.gala.lt/sites/all/formos/img/gala/pop-close.png\') repeat scroll 0 0 transparent; display: block; height: 16px; margin: -2px 0 0; text-decoration: none; text-indent: -10000px; width: 15px;" onclick="$(\'.ui-widget-overlay\').click()">&nbsp;</a></div><iframe src="http://www.gala.lt/sites/all/formos/gala5.php?tipas='+tipas+'&amp;laikotarpis='+laikas+'" frameborder="0" height="645px" scrolling="no" width="665px"> &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt; </iframe>');

			$('#uzsakymai').dialog('open');
			
            $(".ui-dialog-titlebar").hide();
            $('.ui-dialog').css('background-color','transparent');
            $('.ui-widget-content').css('background','transparent');
            $('.ui-dialog').css('border','0px');
			
        });
    });
			
function createDiv()
{
    var newdiv = document.createElement('div');
    var divIdName = 'prid';
    newdiv.setAttribute('id',divIdName);
    newdiv.style.display = "none";
    document.body.appendChild(newdiv);
	
	var newdiv2 = document.createElement('div');
    var divIdName2 = 'uzsakymai';
    newdiv2.setAttribute('id',divIdName2);
    newdiv2.innerHTML = '';
	document.getElementById('prid').appendChild(newdiv2)
}
