var request_uri = ''; function open_popup_window(url){ window.open(url,'window','width=700,height=620,scrollbars=0'); } function open_currency_converter(price){ url = 'http://www.pogo-direct.co.uk/currency_converter.php?price='+price; window.open(url,'window','width=700,height=350,scrollbars=0'); } function change_currency(element_id, currency_id, villa_id, villa_price){ $.ajax({ type: "POST", url: 'http://www.pogo-direct.co.uk/ajax_calculate_price.php', data: "element_id="+element_id+"¤cy_id="+currency_id+"&villa_id="+villa_id+"&villa_price="+villa_price, success: function(msg){ $('#'+element_id).html(msg); } }); } function mycallbackform(v,m){ if(v=='register'){ window.location.href = 'http://www.pogo-direct.co.uk/en/register/'; } else if(v=='login'){ window.location.href = 'http://www.pogo-direct.co.uk/en/login/'; } else if(v=='login2'){ window.location.href = 'http://www.pogo-direct.co.uk/en/login/'+'?redirect='+request_uri+''; } else if(v=='register2'){ window.location.href = 'http://www.pogo-direct.co.uk/en/register/'+'?redirect='+request_uri+''; } } function remove_from_short_list(short_id){ } function display_short_list(){ } function add_2_short_list(villa_id, uri){ request_uri = uri; $.prompt('
');
$('#newsletter_signup_box2').css({display:"none"});
$('#newsletter_signup_box').css({width:"215px",textAlign:"center"});
$('#newsletter_signup_box').load('/ajax_create_newsletter.php?email='+email+'');
return false;
}
}
function send_villa_to_friend(villa_id){
var friend_email = $('#friend_email').val();
var friend_name = $('#friend_name').val();
var user_name = $('#friend_your_name').val();
$('#send_to_friend_info').html('Please wait...');
$.ajax({
type: "POST",
url: 'http://www.pogo-direct.co.uk/ajax_send_villa_to_friend.php',
data: "friend_email="+friend_email+"&friend_name="+friend_name+"&villa_id="+villa_id+"&user_name="+user_name+"&rand="+Math.random()+"",
success: function(msg){
if (msg == 'ok'){
$('#send_to_friend_info').html('Email sent');
$('#friend_email').val('');
$('#friend_name').val('');
} else {
$('#send_to_friend_info').html('Email not sent');
}
}
});
return false;
}
function show_check_flights(){
var my_url = 'http://www.travelsupermarket.com/flights/FlightFinderStep1.asp';
$('#search_flights').modal();
$('#search_flights').html('');
}
function send_question_to_villa_owner(villa_id){
$('#message_to_villa_owner_info').html('Please wait...');
var user_id = $('#user_id').val();
var first_name = $('#first_name').val();
var surname = $('#surname').val();
var email = $('#email').val();
var name = $('#enquiry_name').val();
var tel1 = $('#tel1').val();
var tel2 = $('#tel2').val();
var tel3 = $('#tel3').val();
var message = $('#message').val();
$.ajax({
type: "POST",
url: 'http://www.pogo-direct.co.uk/ajax_send_message_to_villa_owner.php',
data: "user_id="+encodeURIComponent(user_id)+"&email="+encodeURIComponent(email)+"&message="+encodeURIComponent(message)+"&villa_id="+encodeURIComponent(villa_id)+"&name="+encodeURIComponent(name)+"&rand="+Math.random()+"",
success: function(msg){
if (msg == 'ok'){
$('#message_to_villa_owner_info').html('Email sent');
$('#message_to_villa_owner_container').toggle();
} else {
$('#message_to_villa_owner_info').html('Email not sent');
}
}
});
return false;
}
function text_limit(limit, field, span_field){
if (document.getElementById(field).value.length > limit){
document.getElementById(field).value = document.getElementById(field).value.substring(0, limit);
}
if(span_field.length > 0){
txt = "";
left_chars = limit - document.getElementById(field).value.length;
txt = "Left " + left_chars + " of total limit " + limit + "";
document.getElementById(span_field).innerHTML = txt;
}
}
/*
var HELP_LOADED = true;
function show_help(id){
//var my_url = "http://www.pogo-direct.co.uk/help.html?rand="+Math.random()+"#help_"+id+"";
//var my_url = "http://www.pogo-direct.co.uk/help.html#help_"+id+"";
$('#account_help').modal();
if (HELP_LOADED == false){
$.ajax({
type: "GET",
url: 'http://www.pogo-direct.co.uk/help.html',
data: "",
success: function(msg){
$('#account_help').html(msg);
}
});
}
//Target examples bindings
var $paneTarget = $('#account_help');
var t_name = new String('help_'+id+'');
eval('var target = $paneTarget.find("a[name=\''+t_name+'\']");');
if (target){
$paneTarget.stop().scrollTo(target, 800 );
} else {
alert('err');
}
}*/
var HELP_LOADED = true;
function show_help(id){
//var my_url = "http://www.pogo-direct.co.uk/help.html?rand="+Math.random()+"#help_"+id+"";
var my_url = "http://www.pogo-direct.co.uk/help.php#help_"+id+"";
var my_win = window.open(my_url,'window','width=700,height=350,scrollbars=1');
my_win.focus();
/*$('#account_help').modal();
if (HELP_LOADED == false){
$.ajax({
type: "GET",
url: 'http://www.pogo-direct.co.uk/help.html',
data: "",
success: function(msg){
$('#account_help').html(msg);
}
});
}
//Target examples bindings
var $paneTarget = $('#account_help');
var t_name = new String('help_'+id+'');
eval('var target = $paneTarget.find("a[name=\''+t_name+'\']");');
if (target){
$paneTarget.stop().scrollTo(target, 800 );
} else {
alert('err');
}*/
}
function clear_my_details(){
$('#party_name_1').val('');
$('#party_surname_1').val('');
$('#party_age_1').val('');
$('#remove_details').html('');
}
function check_party_person(){
var name = $('#party_name_1').val();
var surname = $('#party_surname_1').val();
var age = $('#party_age_1').val();
var sex = $('#party_sex_1').val();
if (name.length==0 || surname.length==0 || age.length==0 || sex.length == 0){
alert('Please enter Name, Surname, Age and Sex of person!');
return false;
}else{
return true;
}
}
function create_new_party_person(){
var obj = document.getElementById('no_of_people');
var obj2 = document.getElementById('party_people');
var obj3 = document.getElementById('max_no_of_people');
if (obj){
var no = obj.value;
var name = $('#party_name_'+no+'').val();
var surname = $('#party_surname_'+no+'').val();
var age = $('#party_age_'+no+'').val();
var sex = $('#party_sex_'+no+'').val();
if (name.length==0 || surname.length==0 || age.length==0 || sex.length == 0){
alert('Please enter Name, Surname, Age and Sex of person no '+no+'!');
return false;
}
if (no == obj3.value){
alert("You already entered maximum number of people ("+obj3.value+") allowed in this property!\nPlease enter information about other party people in message box above");
return false;
}
no++;
var row = '