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('
You are not logged user
Do you want to register or login to Pogo Travel site now?',{
callback: mycallbackform,
buttons: { Register: 'register2', Login: 'login2', 'Do nothing': false }
}).corner();
}
function select_area(id,selected){
$('#search_area_id').html('');
$('#search_area_id').attr({disabled: false});
$('#search_area_id').load('/ajax_create_options.php?field1=id&field2=name&where=country_id='+id+'&table=pt_areas_en&selected='+selected+'');
}
function select_area_villa_edit(id,selected){
$('#area_id').html('');
$('#area_id').attr({disabled: false});
$('#area_id').load('/ajax_create_options.php?field1=id&field2=name&where=country_id='+id+'&table=pt_areas_en&selected='+selected+'');
}
function newsletter_add(){
var email = $('#newsletter_email').val();
if (/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(email) == false){
alert("Please enter a valid email address");return false;
}else{
$('#newsletter_signup_box').html('Please wait... ');
$('#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();
var ssq = $('#ssq').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+"&sq="+ssq+"&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 {
if(msg == 'err incorrect sq'){
$('#send_to_friend_info').html('Email not sent, Please prove you are the human and provide a correct answer to the security question.');
}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();
var sq = $('#sq').val();
$.ajax({
type: "POST",
url: 'http://www.pogo-direct.co.uk/ajax_send_message_to_villa_owner.php',
data: "user_id="+encodeURIComponent(user_id)+"&sq="+encodeURIComponent(sq)+"&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 {
if(msg == 'err incorrect sq'){
$('#message_to_villa_owner_info').html('Email not sent, Please prove you are the human and provide a correct answer to the security question.');
}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');
var fpc_value = 0;
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 = '
';
$("#party_people").append(row);
fpc_value = no*2.73;
fpc_value = '£'+fpc_value+'';
$("#fpc_value").html(fpc_value);
obj.value = no;
}
}
function remove_party_person(no){
var users = new Array();
var obj = document.getElementById('no_of_people');
j = 0;
for (i=1; i<=obj.value; i++){
if (i != no){
var name = $('#party_name_'+i+'').val();
var surname = $('#party_surname_'+i+'').val();
var age = $('#party_age_'+i+'').val();
var sex = $('#party_sex_'+i+'').val();
users[j] = new Array(name, surname, age, sex);
j++;
}
}
$("#party_people").html('');
obj.value = 0;
for (i=0; i, ';
row += 'Surname , Age ';
row += ', Sex: [male ] [female ] ';
if (no>1){
row += ' [Delete]';
}
row += '';
$("#party_people").append(row);
obj.value = no;
}
}
function create_new_party_person2_c(){
var obj = document.getElementById('no_of_people');
var obj2 = document.getElementById('party_people');
if (obj){
var no = parseInt(obj.value);
no++;
var row = '
';
$("#party_people").append(row);
obj.value = no;
}
}
function remove_party_person_c(no){
var users = new Array();
var obj = document.getElementById('no_of_people');
j = 0;
for (i=1; i<=obj.value; i++){
if (i != no){
var name = $('#party_name_'+i+'').val();
var surname = $('#party_surname_'+i+'').val();
var age = $('#party_age_'+i+'').val();
var sex = $('#party_sex_'+i+'').val();
users[j] = new Array(name, surname, age, sex);
j++;
}
}
$("#party_people").html('');
obj.value = 0;
for (i=0; i