var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var IE7 = false /*@cc_on || @_jscript_version == 5.7 @*/;  // exactly IE7
var gteIE7 = false /*@cc_on || @_jscript_version >= 5.7 @*/; // IE7+
var isMSIE = /*@cc_on!@*/false; // any IE

var cam=1;
var wtv=1;
function HoverEfect(id){
if(id=="camera")
{
	if(cam==0){
		document.getElementById(id).src="images/button_header_gallery_off.png";
		cam=1;
	}else{
		document.getElementById(id).src="images/button_header_gallery_on.png";
		cam=0;
	}
}
if(id=="webtv"){
		if(wtv==0){
			document.getElementById(id).src="images/button_header_web-tv_off.png";
			wtv=1;
		}else{
			document.getElementById(id).src="images/button_header_web-tv_on.png";
			wtv=0;
		}
	}
}

function largeimage(img)
{
     $('#largeimage').html('<img class="contentbox-image" src="/pt/phpThumb.php?src=' + img + '&w=350&h=185"/>');
     return false;
}
/*
function formvariable()
{
  item = $('#itemsel option:selected').val();

  $('.formel').hide();
  if (item == 1) // bar
  {
    $('#divpeople').show();
    $('#divprice').show();
  }
  else if (item == 2) //cafe
  {
    $('#divfood').show();
    $('#divprice').show();
    $('#divalcohol').show();
    $('#divhomecook').show();
  }
  else if (item == 3) //cinema
  {
    $('#divprice').show();
    $('#divconnection').show();
  }
  else if (item == 4) //hotel
  {
    $('#divhoteltype').show();
    $('#divhotelstars').show();
    $('#divhotelrooms').show();
    $('#divprice').show();
    $('#divconnection').show();
  }
  else if (item == 5) //museum
  {
    $('#divprice').show();
    $('#divconnection').show();
    $('#divchildfriendly').show();
  }
  else if (item == 6) //nightlife
  {
    $('#divmusic').show();
    $('#divpeople').show();
    $('#divprice').show();
    $('#diventrance').show();
  }
  else if (item == 7) //restaurant
  {
    $('#divatmosphere').show();
    $('#divpeople').show();
    $('#divprice').show();
    $('#divetakeaway').show();
  }
  else if (item == 8) //shopping
  {
    $('#divshopcat').show();
    $('#divpeople').show();
    $('#divprice').show();
  }
  else if (item == 9) //sights
  {
    $('#divprice').show();
  }
*/


 /*
  $.get("/engine/ajax/changeform.php", { type: item},
    function(data){
        $('#formvar').html(data);
    });
 
}
*/
// ajax way
function areafilter()
{
   var area_id = $('#pageareasel').val();
   $.post('/engine/ajax/areafilter.php',{area : area_id },
    function(data){
     $('#varcont').html(data);
  });
}

//reload way
function filtarea()
{
    var area_id = $('#pageareasel').val();
    var pathname = window.location.pathname;
    if(area_id != '0')
    {
      pathname = pathname +'?ar='+area_id;
    }
    window.location = pathname;
}

/*
function ajaxpage(area,page)
{
  alert(area + ' ' + page);
}
*/

function dosearch()
{
  $('#srcform').ajaxSubmit({url:'/engine/ajax/asearch.php', type : 'GET', target : '#results' });
}


$(document).ready(function()
{
  //loading form at start 
  /*
  formvariable();

  // changing form 
  $('#itemsel').change(function()
      {
          formvariable();
  });
*/
  // ajax filter for items listing
  $('#pageareasel').change(function()
  {
      //areafilter();
      filtarea();
  });
/*
  $('#listtable tr').click(function()
      {
         var url = $(this).children().eq(1).children().eq(0).attr('href');
         document.location.href = url;
      });
*/
});
