function OpenWindow(page, win_width, win_height) {
	window.open("index.php?page=" + page,"_blank","width="+win_width+", height="+win_height+",left=170, top=50, status=no, toolbar=no, location=no, directories=no, menubar=no, scrollbars=yes, resizable=yes");
}


$(document).ready(function() {
	$(".sortable").tablesorter();
});


$(document).ready(function() {
	$(".sortable_dashboard").tablesorter({
        headers: {
            4: { sorter: false }
        }
    });
});

function removeSpaces(string) {
 return string.split(' ').join('');
}

function verifyInqiry(oLink, vQuest)
{
  var el = oLink.parentNode;
  var text;
  var href = oLink.href;
  var original_text = el.innerHTML;
  text = vQuest;
  text += '<a href="' + href + '">Yes</a>';
  text += ' / ';
  text += '<a href="#" onclick="this.innerHTML=\'".escape(original_text)."\';return false;">No</a>'
}

$(document).ready(function(){

	$('#slides1').bxSlider({
		alignment: 'vertical',          // 'horizontal', 'vertical' - direction in which slides will move
		controls: false,                // determines if default 'next'/'prev' controls are displayed
		speed: 700,                     // amount of time slide transition lasts (in milliseconds)
		pager: true,                    // determines if a numeric pager is displayed (1 2 3 4...)
		pager_short: true,              // determines if a 'short' numeric pager is displayed (1/4)
		pager_short_separator: ' / ',   // text to be used to separate the short pager
		margin: 150,                    // if 'horizontal', applies a right margin to each slide, if 'vertical' a
		                                // bottom margin is applied. example: margin: 50
		next_text: '',                  // text to be displayed for the 'next' control
		next_image: '',                 // image to be used for the 'next' control
		prev_text: '',                  // text to be displayed for the 'prev' control
		prev_image: '',                 // image to be used for the 'prev' control
		auto: true,                     // determines if slides will move automatically
		pause: 7000,                    // time between each slide transition (auto mode only)
		auto_direction: 'next',         // order in which slides will transition (auto mode only)
		auto_hover: true,               // determines if slideshow will pause while mouse is hovering over slideshow
		auto_controls: false,           // determines if 'start'/'stop' controls are displayed (auto mode only)
		ticker: false,                  // determines if slideshow will behave as a constant ticker
		ticker_controls: false,         // determines if 'start'/'stop' ticker controls are displayed (ticker mode only)
		ticker_direction: 'next',       // order in which slides will transition (ticker mode only)
		ticker_hover: true,             // determines if slideshow will pause while mouse is hovering over slideshow
		stop_text: 'stop',              // text to be displayed for the 'stop' control
		start_text: '',                 // text to be displayed for the 'start' control
		wrapper_class: 'bxslider_wrap'  // class name to be used for the outer wrapper of the slideshow

	});

	// ZMENA FARBY PO HOVERI NA PRODUKT
	$(".product").mouseover(function () {
		$(this).css('background-color', '#f9f9f9');
		$(this).find('.product-photo').css('background', 'white');
	});
	
	// ZMENA FARBY PO ODIDENI MYSOU Z PRODUKTU
	$(".product").mouseout(function () {
	  $(this).css('background-color', 'white');
		$(this).find('.product-photo').css('background', 'white');
	});
	
	$("#display_form").click(function () {
	 $("div#form_to_display").toggle('fast');
	});
	
	$("#preloader").hide("slow");
	$("#preloader").remove();

});

function check_neighbour(checkbox_id) {
	$("#checkme_"+checkbox_id).attr('checked','checked');
	$("#checkme_"+checkbox_id).parent('td').css('background-color', '#DD5454');
}

function uncheck_me(checkbox_id) {
	$("#checkme_"+checkbox_id).parent('td').css('background-color', '');
}
