			
var windowWidth = $(window).width();
//var ua = navigator.userAgent;
/*var checker = {			  
  android: ua.match(/Android/)			  
};*/

var if_i_am_mobile_i_will_be_true = false;
var if_page_is_optimized_i_will_be_true = false;
var opt = false;
var reg = false;


if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|IEMobile|Opera Mini/i.test(navigator.userAgent)) {

	if($.cookie("responsive-coockie") == "regular_site") {									
		show_the_regular_site();
		reg = true;
	}else if($.cookie("responsive-coockie") == "optimized_site") {
		opt = true;
		show_the_optimized_site();
		if_page_is_optimized_i_will_be_true = true;
		
	} else if (windowWidth<450){
		opt = true;
		show_the_optimized_site();
		if_page_is_optimized_i_will_be_true = true;
	}else {
		reg = true;
		show_the_regular_site();
	
	}
} else {
	
	show_the_regular_site();
	
}
/*if(checker.android || windowWidth < 769)
{
	if_i_am_mobile_i_will_be_true = true;
	if($.cookie("responsive-coockie") == "regular_site") {									
		show_the_regular_site();
		reg = true;
	}else if($.cookie("responsive-coockie") == "optimized_site") {
		opt = true;
		show_the_optimized_site();
		if_page_is_optimized_i_will_be_true = true;
		
	}else {
		//$(location).attr('href','/responsive_page.html');
		opt = true;
		show_the_optimized_site();
		if_page_is_optimized_i_will_be_true = true;
	}
}*/


function show_the_regular_site(){
	
	$('.click_me_to_go_to_the_regular_site').hide();
	$('.click_me_to_go_to_the_optimized_site').hide();
	$('#responsive-style').remove();
	
}
			
function show_the_optimized_site(){
	
	$('.click_me_to_go_to_the_optimized_site').hide();
	$('.click_me_to_go_to_the_regular_site').hide();
	$('head').append('<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>');
}