// JavaScript Document
function get_month_selected(month) {
var obj = {
'Dec': '12',
'Jan': '01',
'Feb': '02',
'Mar': '03',
'Apr': '04',
'May':'05',
'Jun':'06',
'Jul':'07',
'Aug': '08',
'Sep': '09',
'Oct':'10',
'Nov':'11'
}
return obj[month];
}
/////////////////////
//////// Car Detail page//
/////////////////////////
$('body').on('keypress', '.add_bits_data', function (e) {
var self_obj = $(this).parent().parent();
var is_show_bids_value = 0 ;
var auction_date_fetch= "";
try
{
//fetching date
var _auction_date = $(self_obj).find(".aaDate").text();
var url = window.location.href;
if(url.indexOf("modelFull.aspx") >= 0 || url.indexOf("cornerFull.aspx") >= 0 || url.indexOf("bidnoFull.aspx") >= 0 || url.indexOf("exhibitFull.aspx") >= 0 ) {
_auction_date = $('#MainContents_Exhibit_GridArea').find("td.aaDate").text();
}
_auction_date = _auction_date.replace("[End]",'');
_auction_date = _auction_date.replace("[--:--]",'');
_auction_date = _auction_date.split(" ");
var _month= _auction_date[0].trim();
_month = get_month_selected(_month);
_auction_date = _auction_date[1];
_auction_date = _auction_date.split(".");
var _day = _auction_date[0].trim();
if(_day.length == 1 )
{
_day = "0" + _day;
}
//console.log(_auction_date[1]);
var _year = "20"+_auction_date[1].trim();
auction_date_fetch = _year + "-"+_month+"-"+_day;
//selected date//
var _selected_date = $(".jans_auction_date").val();
_selected_date = _selected_date.split("-");
var _s_month = _selected_date[0].trim();
if(_s_month.length == 1)
{
_s_month = "0" + _s_month;
}
var _s_day = _selected_date[1].trim();
if(_s_day.length == 1 )
{
_s_day = "0" + _s_day;
}
var _s_year = _selected_date[2].trim();
//console.log(_s_year + " == " + _year + " => " + _month + " == " + _s_month + " => " + _day + " == " + _s_day);
if(_s_year == _year && _month == _s_month && _day == _s_day)
{
is_show_bids_value = 1;
//console.log("Equal");
}
else
{
is_show_bids_value = 0;
//console.log("Not Equal");
}
//console.log(is_show_bids_value);
}
catch(error)
{
}
book_mark_data(self_obj,0);
var key = e.which;
if (key == 13) {
///
var action = "insert";
var username = $("#janusername").val();
var password = $("#janpassword").val();
var jans_auction_date = $(".jans_auction_date").val();
var jans_auction_dates = jans_auction_date.split('-');
jans_auction_date = jans_auction_dates[2] + '-' + jans_auction_dates[0] + '-' + jans_auction_dates[1];
if (Date.parse(auction_date_fetch)) {
jans_auction_date = auction_date_fetch;
}
var jans_country = $('#jans_user_country').val();
var url = window.location.href;
if(url.indexOf("modelFull.aspx") >= 0 || url.indexOf("cornerFull.aspx") >= 0 || url.indexOf("bidnoFull.aspx") >= 0 || url.indexOf("exhibitFull.aspx") >= 0 ) {
book_mark_data(self_obj,44);
var obj = $('#MainContents_Exhibit_GridArea');
///
var jans_bid_price = [];
$('body').find("#bids_value").each(function () {
jans_bid_price.push($(this).val());
});
var jans_bid_marks = [];
$('body').find("#remarks").each(function () {
jans_bid_marks.push($(this).val());
});
var info = $(obj).find('td.bidNo').html();
if(info)
{
info = info.split("
");
}
var auction_company = [];
if(info && info[1])
auction_company.push("USS " + info[1].trim());
var lot_no = "";
if(info && info[0])
lot_no = info[0];
var lot_no1 = '';
var lot_no2 = lot_no;
var modelyear = [];
var grade = [];
var inspection = [];
var transactionstatus = [];
var cc = '';
var carname = [];
var carname_1 = $(obj).find("td.model").text();
if(carname_1)
{
carname_1 = carname_1.split(" ");
if(carname_1[1])
{
carname_1 = carname_1[0] + " " + carname_1[1];
}
else
{
carname_1 = carname_1[0];
}
}
carname.push(carname_1);
var year = $(obj).find("td.mYear").text();
if(year)
modelyear.push(year);
var mileage = [];
var shifts = [];
var startprice = [];
var info1 = $(obj).find("td.shift").html();
if(info1)
{
info1 = info1.split("
");
shifts.push(info1[0]);
cc = info1[1];
}
var info1 = $(obj).find("td.mile").html();
if(info1)
{
info1 = info1.split("
");
mileage.push(info1[0]);
inspection.push(info1[1]);
}
var info1 = $(obj).find("td.color").text();
var color_name = info1;
var info1 = $(obj).find("td.cType").text();
if(info1)
{
info1 = info1.split(" ");
info1 = info1[0];
}
var type = info1;
var info1 = $(obj).find("td.price").text();
if(info1)
{
info1 = info1.split("----");
transactionstatus.push(info1[0]);
var stp = info1[1];
if(stp)
stp = stp.replace(',','');
startprice.push(stp);
}
var info1 = $(obj).find("td.score").text();
grade.push(info1);
//////////////////////////////////////////////////////////////////////////////////////////////////////
$.ajax({
type: 'POST',
url: 'https://iauc.jjonlinesystems.com/ajphp_v41.php',
crossDomain: true,
async: true,
data: {
action: action, username: username, password: password, jans_auction_date: jans_auction_date,
jans_country: jans_country,
auction_company: auction_company,
lot_no1: lot_no1,
lot_no2: lot_no2,
modelyear: modelyear,
carname: carname,
grade: grade,
ctype: type,
cc: cc,
color: color_name,
'shift':shifts,
inspection: inspection,
mileage: mileage,
jans_bid_price: jans_bid_price,
remark: jans_bid_marks,
start_price: startprice,
},
success: function (data) {
/////////////////////////////////////////////////
if (isNaN(data)) {
alert(data);
}
else{
//set seen car //
var img_path = $(".imgTag");
if(img_path)
{
img_path = img_path[1];
img_path = $(img_path).attr("src");
img_path = img_path.replace("Front","ThumbFront");
img_path = img_path.replace("_0","_T");
var arr_ = localStorage.getItem("hide_arr");
if (img_path && img_path.length >= 2) {
if (arr_) {
arr_ = JSON.parse(arr_);
if (arr_.indexOf(img_path) == -1) {
arr_.push(img_path);
}
} else {
arr_ = [];
arr_.push(img_path);
}
localStorage.setItem("hide_arr", JSON.stringify(arr_));
}
}
//end seen car //
var hr_name = get_country_class(jans_country);
var sh_cntry = $("#jans_user_country option:selected").text();
var show_bid_name = sh_cntry + ' ( ' + username + ' ) ' ;
var add_bid = '
';
var obj_checking = $('#MainContents_Exhibit_GridArea');
var info_bid_no = $(obj).find('td.bidNo').html();
if(info_bid_no)
{
info_bid_no = info_bid_no.split("
");
info_bid_no = info_bid_no[0];
}
//console.log(is_show_bids_value);
if(lot_no == info_bid_no)
{
if(is_show_bids_value == 1 )
{
$(".show_already_existing_bids_full").parent().append(add_bid);
}
}
////////
$("#jancurrentprice").text(jans_bid_price);
if (localStorage.getItem('jantotalbids') == '')
var count = 1;
else
var count = parseInt(localStorage.getItem('jantotalbids')) + 1;
localStorage.setItem('jantotalbids', count);
$("#janstotalbids").text(count);
////////
}
/////////////////////////////////////////////////
},
error: function (error) {
alert("Error");
// console.log(error);
}
});
}
else
{
///
var jans_bid_price = [];
$(self_obj).find("#bids_value").each(function () {
jans_bid_price.push($(this).val());
});
var jans_bid_marks = [];
$(self_obj).find("#remarks").each(function () {
jans_bid_marks.push($(this).val());
});
var info = $(self_obj).find('.bidNo').html();
if(info)
{
info = info.split("
");
}
var auction_company = [];
if(info && info[1])
auction_company.push("USS " + info[1].trim());
var lot_no = "";
if(info && info[0])
lot_no = info[0];
var lot_no1 = '';
var lot_no2 = lot_no;
var modelyear = [];
var grade = [];
var inspection = [];
var transactionstatus = [];
var cc = '';
var year = $(self_obj).find(".mYear").text();
if(year)
modelyear.push(year);
var mileage = [];
var shifts = [];
var startprice = [];
var info1 = $(self_obj).find(".shift").html();
if(info1)
{
info1 = info1.split("
");
shifts.push(info1[0]);
cc = info1[1];
}
var info1 = $(self_obj).find(".mile").html();
if(info1)
{
info1 = info1.split("
");
mileage.push(info1[0]);
inspection.push(info1[1]);
}
var info1 = $(self_obj).find(".color").text();
var color_name = info1;
var info1 = $(self_obj).find(".cTypeDir").text();
var type = info1;
var info1 = $(self_obj).find(".price").text();
if(info1)
{
info1 = info1.split("----");
transactionstatus.push(info1[0]);
var stp = info1[1];
if(stp)
stp = stp.replace(',','');
startprice.push(stp);
}
var info1 = $(self_obj).find(".score").text();
grade.push(info1);
var carname = [];
var info1 = $(self_obj).find(".carLink").text();
if(info1)
{
info1 = info1.split(" ");
info1 = info1[0];
}
carname.push(info1);
//////////////////////////////////////////////////////////////////////////////////////////////////////
$.ajax({
type: 'POST',
url: 'https://iauc.jjonlinesystems.com/ajphp_v41.php',
//url: 'http://localhost/new_extension/ajphp_v41.php',
crossDomain: true,
async: true,
data: {
action: action, username: username, password: password, jans_auction_date: jans_auction_date,
jans_country: jans_country,
auction_company: auction_company,
lot_no1: lot_no1,
lot_no2: lot_no2,
modelyear: modelyear,
//carname: carname,
grade: grade,
ctype: type,
carname: carname,
cc: cc,
//crate: grade,
// ext: ext_color,
//inter:
color: color_name,
//color_no: color_no,
'shift':shifts,
//ac: ac,
//chassiscode: chassiscode,
inspection: inspection,
mileage: mileage,
jans_bid_price: jans_bid_price,
// car_detail_url: car_detail_url,
remark: jans_bid_marks,
start_price: startprice,
},
success: function (data) {
if (isNaN(data)) {
alert(data);
}
else{
var hr_name = get_country_class(jans_country);
var sh_cntry = $("#jans_user_country option:selected").text();
var show_bid_name = sh_cntry + ' ( ' + username + ' ) ' ;
var add_bid = '';
if(is_show_bids_value == 1 )
{
$(self_obj).find(".show_already_existing_bids").append(add_bid);
}
////////
$("#jancurrentprice").text(jans_bid_price);
if (localStorage.getItem('jantotalbids') == '')
var count = 1;
else
var count = parseInt(localStorage.getItem('jantotalbids')) + 1;
localStorage.setItem('jantotalbids', count);
$("#janstotalbids").text(count);
////////
}
},
error: function (error) {
alert("Error");
// console.log(error);
}
});
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
}
});
////user login and get user assaign countries////////////////////
$('body').on('click', '#janlogin_user', function () {
///alert('logn again');
var action = "countries";
var username = $("#janusername").val();
var password = $("#janpassword").val();
///
$.ajax({
type: 'POST',
url: 'https://iauc.jjonlinesystems.com/ajphp_v41.php',
crossDomain: true,
async: true,
data: { action: action, username: username, password: password },
success: function (data) {
if(data == "1" || data == "2" )
{
if(data == "2")
{
alert("Userename OR Password is Incorrect!");
}
else
{
alert("Countries is not in your rights");
}
}
else
{
$("#jans_user_country").html(data);
localStorage.setItem('janusername', username);
localStorage.setItem('janpassword', password);
localStorage.setItem('jancountrylist', data);
}
},
});
///
///////////
var action = "set_token";
$.ajax({
type: 'POST',
url: 'https://iauc.jjonlinesystems.com/ajphp_v41.php',
crossDomain: true,
async: true,
data: { action: action, username: username, password: password },
success: function (data) {
var obj = jQuery.parseJSON(data);
localStorage.setItem('jans_user_login_id', obj.user_id);
localStorage.setItem('jans_user_login_token', obj.token);
},
});
//////////
});
///////////////submit bids/////////
//photo only view//
$('body').on('keypress', '.item', function (e) {
book_mark_data(this,1);
var key = e.which;
if (key == 13) {
//alert("hello1");
///
if ($(this).find(".already_bid_value").is(':focus')) {
return false;
}
var my_this = $(this);
var action = "insert";
var username = $("#janusername").val();
var password = $("#janpassword").val();
var jans_auction_date = $(".jans_auction_date").val();
var jans_auction_dates = jans_auction_date.split('-');
jans_auction_date = jans_auction_dates[2] + '-' + jans_auction_dates[0] + '-' + jans_auction_dates[1];
var jans_country = $('#jans_user_country').val();
///
var jans_bid_price = [];
$(this).find("#bids_value").each(function () {
jans_bid_price.push($(this).val());
});
var jans_bid_marks = [];
$(this).find("#remarks").each(function () {
jans_bid_marks.push($(this).val());
});
var info = $(this).find('.info1 div').first().text();
info = info.split('No');
var company = info[0];
var auction_company = [];
auction_company.push("USS " + company.trim());
var lot_no = info[1];
if(lot_no)
lot_no = lot_no.replace('.','');
var lot_no1 = '';
var lot_no2 = lot_no;
var modelyear = [];
var grade = [];
var inspection = [];
var transactionstatus = '';
var cnt = 1;
$(this).find(".info2 div ul li:nth-child(1)").each(function () {
var vl = $(this).text();
if(cnt == 1)
{
vl = vl.replace('[Year]','');
modelyear.push(vl);
}
if(cnt == 2)
{
vl = vl.replace('[Score]','');
grade.push(vl);
}
if(cnt == 3)
{
vl = vl.replace('[Inspect]','');
inspection.push(vl);
}
if(cnt == 4)
{
transactionstatus = vl;
}
cnt++;
});
var mileage = [];
var shifts = [];
var startprice = [];
cnt = 1;
$(this).find(".info2 div ul li:nth-child(2)").each(function () {
var vl = $(this).text();
if(cnt == 1)
{
vl = vl.replace('[Odo.]','');
mileage.push(vl);
}
if(cnt == 2)
{
vl = vl.replace('[T/M]','');
shifts.push(vl);
}
//if(cnt == 3)
//inspection.push(vl);
cnt++;
});
//////////////
cnt = 1;
$(this).find(".info2 div ul li:nth-child(3)").each(function () {
var vl = $(this).text();
if(cnt == 2)
{
vl = vl.replace(',','');
startprice.push(vl);
}
cnt++;
});
var carname = [];
var info1 = $(this).find(".info1").find("div").eq(1).text();
if(info1)
{
info1 = info1.split(" ");
info1 = info1[0];
}
carname.push(info1);
var type="";
var main_name_of_car = $(this).find(".info1").find("div").eq(0).text();
if(main_name_of_car)
{
main_name_of_car = main_name_of_car.replace(/ /g, "_");
type = localStorage.getItem(main_name_of_car);
localStorage.removeItem(main_name_of_car);
}
//end //
try
{
var auction_date_fetch = "";
var _auction_date = localStorage.getItem(main_name_of_car+"_date");
localStorage.removeItem(main_name_of_car+"_date");
_auction_date = _auction_date.split(" ");
var _month= _auction_date[0].trim();
_month = get_month_selected(_month);
_auction_date = _auction_date[1];
_auction_date = _auction_date.split(".");
var _day = _auction_date[0].trim();
if(_day.length == 1 )
{
_day = "0" + _day;
}
var _year = "20"+_auction_date[1].trim();
auction_date_fetch = _year + "-" + _month + "-" + _day;
//selected date//
var _selected_date = $(".jans_auction_date").val();
_selected_date = _selected_date.split("-");
var _s_month = _selected_date[0].trim();
if(_s_month.length == 1)
{
_s_month = "0" + _s_month;
}
var _s_day = _selected_date[1].trim();
if(_s_day.length == 1 )
{
_s_day = "0" + _s_day;
}
var _s_year = _selected_date[2].trim();
//it will set by default auction date from car auction page//
if (Date.parse(auction_date_fetch)) {
jans_auction_date = auction_date_fetch;
}
}
catch(ex)
{
}
/////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
$.ajax({
type: 'POST',
url: 'https://iauc.jjonlinesystems.com/ajphp_v41.php',
//url: 'http://localhost/new_extension/ajphp_v41.php',
crossDomain: true,
async: true,
data: {
action: action, username: username, password: password, jans_auction_date: jans_auction_date,
jans_country: jans_country,
auction_company: auction_company,
lot_no1: lot_no1,
lot_no2: lot_no2,
modelyear: modelyear,
carname: carname,
grade: grade,
ctype: type,
//cc: cc,
crate: grade,
// ext: ext_color,
//inter:
//color: color_name,
//color_no: color_no,
'shift':shifts,
//ac: ac,
//chassiscode: chassiscode,
inspection: inspection,
mileage: mileage,
jans_bid_price: jans_bid_price,
// car_detail_url: car_detail_url,
remark: jans_bid_marks,
start_price: startprice,
//aimage: aimage,
//fimage: fimage,
//rimage: rimage,
// ex_document: ex_document,
// ex_note: ex_note,
// ex_vehicle_history:ex_vehicle_history,
// ex_drive:ex_drive,
//ex_accessories:ex_accessories,
//ex_fuel: ex_fuel,
// ex_seats: ex_seats,
//ex_load_capacity: ex_load_capacity,
//ex_registeration_month: ex_registeration_month,
//ex_doors: ex_doors
},
success: function (data) {
if (isNaN(data)) {
alert(data);
}
else{
var hr_name = get_country_class(jans_country);
var sh_cntry = $("#jans_user_country option:selected").text();
var show_bid_name = sh_cntry + ' ( ' + username + ' ) ' ;
var add_bid = '';
//car type/chasssis code //
var is_show_bids_value = 0 ;
try
{
//console.log(_s_year + " == " + _year + " => " + _month + " == " + _s_month + " => " + _day + " == " + _s_day);
if(_s_year == _year && _month == _s_month && _day == _s_day)
{
is_show_bids_value = 1;
//console.log("Equal");
}
else
{
is_show_bids_value = 0;
//console.log("Not Equal");
}
}
catch(error)
{
}
if(is_show_bids_value == 1)
{
$(my_this)
.append(add_bid);
}
////////
$("#jancurrentprice").text(jans_bid_price);
if (localStorage.getItem('jantotalbids') == '')
var count = 1;
else
var count = parseInt(localStorage.getItem('jantotalbids')) + 1;
localStorage.setItem('jantotalbids', count);
$("#janstotalbids").text(count);
////////
}
},
error: function (error) {
alert("Error");
// console.log(error);
}
});
//////////////////////////////////////////////////////////////////////////////////////////////////////
}
});
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////
$('body').on('click', '.jans_ext_bid', function (e) {
var username = $("#janusername").val();
var password = $("#janpassword").val();
var action = "delete_existing_bids";
var pare_div = $(this).parent();
pre_bid_id = $(pare_div).find(".jans_pre_id").val();
var r = confirm("Are you sure you want to delete this bid?");
if (r == true)
{
$.ajax({
type: 'POST',
url: 'https://iauc.jjonlinesystems.com/ajphp_v41.php',
//url: 'http://localhost/new_extension/ajphp_v41.php',
crossDomain: true,
async: true,
data: { action: action, id:pre_bid_id,
username:username,
password:password
},
success: function (data) {
var obj = jQuery.parseJSON(data);
if(obj.success == true)
{
$(pare_div).hide();
}
alert(obj.msg);
},
});
}
});
/////////////////////////////////////////
//it will update bids value
/////////////////////////////////////////
$('body').on('keypress', '.bid-header', function (e) {
var key = e.which;
if (key == 13) {
// event.preventDefault();
var pre_bid_price = $(this).find(".jans_pre_price").val();
var pre_bid_remarks = $(this).find(".jans_pre_ramarks").val();
var pre_bid_id = $(this).find(".jans_pre_id").val();
var username = $("#janusername").val();
var password = $("#janpassword").val();
var country = $("#jans_user_country").val();
var action = "update";
var this_obj = this;
var prnt = $(this).parent().find("#bids_value");
/////////////
$.ajax({
type: 'POST',
url: 'https://iauc.jjonlinesystems.com/ajphp_v41.php',
crossDomain: true,
async: true,
data: { action: action, jans_bid_price: pre_bid_price, remarks: pre_bid_remarks, id:pre_bid_id,
username:username,
password:password,
jans_country:country
},
success: function (data) {
//////////////////////
var hr_name = get_country_class(country);
var sh_cntry = $("#jans_user_country option:selected").text();
var add_bid =' '+sh_cntry+'';
//$(this_obj).find(".jans_ext_bid_cntry").html(add_bid);
//////////////////////
$(prnt).val(pre_bid_price);
},
});
/////////////
}
});
//////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
/////////
$('body').on('click','#toggle', function() {
$(".main-user").toggleClass("tgl");
$("#slide").toggleClass("tgl");
});
////////
function get_country_class(country_id) {
var obj = {
10: 'flag tanzania',
12: 'flag zambia',
14: 'flag south-africa',
17: 'flag uae',
19: 'flag pakistan',
20: 'flag kenya',
21: 'flag uk',
23: 'flag japan',
209: 'flag south-africa',
212: 'flag namibia',
213: 'flag botswana',
214: 'flag mozambique',
267: 'flag japan',
279: 'flag uganda',
282: 'flag pakistan',
284: 'flag japan-online',
297: 'flag zimbabwe',
317: 'flag pakistan',
322: 'flag chili',
335: 'flag kenya',
353: 'flag lesotho',
359: 'flag swaziland',
363: 'flag Dominica',
387: 'flag south-africa',
391: 'flag dominican',
396: 'flag mongolia',
410: 'flag uganda',
419: 'flag uk',
462: 'flag philippines',
467: 'flag namibia',
480: 'flag botswana',
486: 'flag newzealand',
496: 'flag uae',
524: 'flag philippines',
534: 'flag uk'
}
return obj[country_id];
}
function getUrlVars(url) {
var vars = {};
if(url && url.length != 0 )
{
var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
vars[key] = value;
});
}
return vars;
}
function book_mark_data(self_obj,type)
{
var href = "";
if(type == 44)
{
href = $("#MainForm").attr("action");
}
else if(type == 0 )
{
href = $(self_obj).find(".carLink").parent().attr("href");
}
else
{
href = $(self_obj).find(".carImg").parent().attr("href");
}
var params={};
href = getUrlVars(href);
var key_list = "";
if(href && href.ExKey)
{
params['ExKey'] = href.ExKey;
key_list = href.ExKey;
}
var fav_id = $("#image_hidden_value").val();
if(href && href.RecordNo)
{
params['RecordNo'] = href.RecordNo;
}
params['__VIEWSTATE'] = $('#__VIEWSTATE').val();
params['__VIEWSTATEGENERATOR'] = $('#__VIEWSTATEGENERATOR').val();
params['AAResultOpen']= $('#AAResultOpen').val();
params['AAResultType']= $('#AAResultType').val();
params['AATermOpen']= $('#AATermOpen').val();
params['Aircon']= $('#Aircon').val();
params['AuctionTerm']= $('#AuctionTerm').val();
params['BrandCode']= $('#BrandCode').val();
params['BrandScrollTop']= $('#BrandScrollTop').val();
params['CarCategoryNo']= $('#CarCategoryNo').val();
params['CarType']= $('#CarType').val();
params['CarTypeMatch']= $('#CarTypeMatch').val();
params['CarTypeText']= $('#CarTypeText').val();
params['Color']= $('#Color').val();
params['CommercialType']= $('#CommercialType').val();
params['DisplacementFrom']= $('#DisplacementFrom').val();
params['DisplacementTo']= $('#DisplacementTo').val();
params['Drive']= $('#Drive').val();
params['ExInf']= $('#ExInf').val();
params['ExKeyList']= $('#ExKeyList').val();
params['FinalPriceFrom']= $('#FinalPriceFrom').val();
params['FinalPriceTo']= $('#FinalPriceTo').val();
params['Grade']= $('#Grade').val();
params['GradeMatch']= $('#GradeMatch').val();
params['GradeText']= $('#GradeText').val();
params['ImportedHandle']= $('#ImportedHandle').val();
params['ImportedModelYearFrom']= $('#ImportedModelYearFrom').val();
params['ImportedModelYearTo']= $('#ImportedModelYearTo').val();
params['ImportedType']= $('#ImportedType').val();
params['IsEquipAW']= $('#IsEquipAW').val();
params['IsEquipLeather']= $('#IsEquipLeather').val();
params['IsEquipNavi']= $('#IsEquipNavi').val();
params['IsEquipPS']= $('#IsEquipPS').val();
params['IsEquipPW']= $('#IsEquipPW').val();
params['IsEquipSR']= $('#IsEquipSR').val();
params['ListMode']= $('#ListMode').val();
params['MaxListRow']= $('#MaxListRow').val();
params['MaxRow']= $('#MaxRow').val();
params['MileageFrom']= $('#MileageFrom').val();
params['MileageTo']= $('#MileageTo').val();
params['MileageType']= $('#MileageType').val();
params['MileType']= $('#MileType').val();
params['ModelScrollTop']= $('#ModelScrollTop').val();
params['ModelYearFrom']= $('#ModelYearFrom').val();
params['ModelYearTo']= $('#ModelYearTo').val();
params['Mot']= $('#Mot').val();
params['OrderNo']= $('#OrderNo').val();
params['PageNo']= $('#PageNo').val();
params['RecordNo']= $('#RecordNo').val();
params['Score']= $('#Score').val();
params['ScrollTop']= $('#ScrollTop').val();
params['SearchFlow']= $('#SearchFlow').val();
params['SearchType']= $('#SearchType').val();
params['Shift']= $('#Shift').val();
params['SortNo']= $('#SortNo').val();
params['StartPriceFrom']= $('#StartPriceFrom').val();
params['StartPriceTo']= $('#StartPriceTo').val();
params['Tieup']= $('#Tieup').val();
params['TieupWeek']= $('#TieupWeek').val();
params['Uss']= $('#Uss').val();
params['UssWeek']= $('#UssWeek').val();
var url_arr = window.location.href;
url_arr = url_arr.split("/");
var replace_url = "";
if(url_arr && url_arr[4])
{
replace_url = url_arr[4];
}
//https://ssl.cis6200.jp
//http://www.cis6200.jp/cis/
var book_url = "https://ssl.cis6200.jp/cis/"+replace_url+"/en/etc/addBookmark.ashx?BookType=0";
$.ajax({
type: 'POST',
url: book_url,
crossDomain: true,
data : {ExKeyList: key_list},
success: function (data) {
$.ajax({
type: 'POST',
url: "https://ssl.cis6200.jp/cis/"+replace_url+"/en/etc/setFavoriteMark.ashx?MarkNoList="+fav_id+"&IsFavoriteMark=true",
crossDomain: true,
data : params,
success: function (data) {
var url_12 = "https://ssl.cis6200.jp/cis/"+replace_url+"/en/request/addBookmark.aspx?BookType=0&FavResultType=1&ExKeyList="+key_list+"&ListSelectCount=1";
$.ajax({
type: 'GET',
url: url_12,
crossDomain: true,
success: function (data) {
},
error:function(err){
console.log(err);
}
});
},
error:function(err){
console.log(err);
}
});
},
error:function(err){
console.log(err);
}
});
}
//});
////////////////
$('body').on('click','.janresetcounter', function() {
localStorage.setItem('jantotalbids', 0);
$("#janstotalbids").text(0);
});
////////////////
var is_simple_photo = localStorage.getItem("is_simple_photo");
if(is_simple_photo != 1 )
{
localStorage.setItem("is_simple_photo",0);
}
$("#janusername").val(localStorage.getItem('janusername'));
$("#janpassword").val(localStorage.getItem('janpassword'));
$("#jans_user_country").html(localStorage.getItem('jancountrylist'));
$("#jans_user_country").val(localStorage.getItem('jancountry'));
$("#janstotalbids").text(localStorage.getItem('jantotalbids'));
if(is_simple_photo == 1 )
{
$('#is_photo_only').prop('checked', true);
}
else
{
$('#is_photo_only').prop('checked', false);
}
var date_save = localStorage.getItem('januserauctiondate');
var store_time = "";
try{
var store_time = $.cookie("date_time_store");
}
catch(ex)
{
console.log("purchase.html = > $cookie is not defined");
}
if(date_save && date_save!= null && date_save.length >= 5 && store_time && store_time.length != 0 )
{
$(".jans_auction_date").val(date_save);
try
{
$("#datepicker").datepicker({
autoclose: true,
todayHighlight: true
}).datepicker('update', localStorage.getItem('januserauctiondate'));
}
catch(ex)
{
console.log("ajax => Datepicker is not loaded");
}
}
else
{
try
{
$("#datepicker").datepicker({
autoclose: true,
todayHighlight: true
});
}
catch(ex)
{
console.log("ajax => Datepicker is not loaded");
}
/* $('#datepicker').Zebra_DatePicker({
format: 'm-d-Y'
});*/
}
$('body').on('click','.change_date', function() {
localStorage.setItem('januserauctiondate', $(".jans_auction_date").val());
var today = new Date();
var today_1 = new Date();
today_1.setDate(today_1.getDate() + 1);
today_1.setHours(0);
today_1.setMinutes(0);
today_1.setSeconds(0);
var diff =(today_1.getTime() - today.getTime()) / 1000;
diff /= (60 * 60);
var hours = Math.abs(Math.round(diff));
hours = parseInt(hours) * 60;
try
{
$.cookie('date_time_store', '1', {expires: hours/1440});
}
catch(err)
{
console.log("$cookie si not define");
}
});
$('body').on('change','#jans_user_country', function() {
localStorage.setItem('jancountry', $(this).val());
});
$('#kk').Zebra_DatePicker();