/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  November 21st 2008 3:15:02 AM PST                            */
/*      Machine:  10.16.140.104                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/marketplace.js.pkg.php r103597                            */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/marketplace.js.pkg.php                                    */


function classifieds_pop_remove(f,classified_id,action){if(!action){action='index.php';}
popup=new pop_dialog('classifieds_pop_remove_dialog');popup.show_form(tx('mc01'),'<p>'+tx('mc02')+'</p>'+'<input type="radio" name="remove_success" value=1>'+tx('mc03')+'<br/>'+'<input type="radio" name="remove_success" value=0>'+tx('mc04')+'<br/>'+'<input type="hidden" name="remove" value="1">'+'<input type="hidden" name="f" value="'+f+'">'+'<input type="hidden" name="classified_id" value= "'+classified_id+'">',tx('mc05'),action);}
function remove_video(classified_id,video_id){var dialog=new pop_dialog();dialog.show_choice(tx('mc06'),tx('mc07'),tx('mc03'),remove_vid,tx('mc04'),on_reject);function remove_vid(){this.onResponse=function(asyncResponse){var payload=asyncResponse.getPayload();var status=payload['status'];dialog.show_choice(tx('mc08'),status,tx('sh:ok-button'),redirect);}
this.onError=function(asyncResponse){return false;};new AsyncRequest().setURI('/ajax/marketplace/common.php').setData({'video_id':video_id,'classified_id':classified_id,'action':'remove_vid'}).setHandler(bind(this,'onResponse')).setErrorHandler(bind(this,'onError')).send();function redirect(){location.href='/marketplace/editlisting.php?classified_id='+classified_id;}}
function on_reject(){dialog.hide();}}

var pop_view_current=0;var pop_view_path='/';function classifieds_pop_view(classified_id,message){show_message=message?'&message=true':'';var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/marketplace/pop_view.php?classified_id='+classified_id+show_message);new Dialog().setContentWidth(680).setAsync(async).show();}
function prev_image(){if(pop_view_current>0){hide('c_image_'+pop_view_current);pop_view_current-=1;show('c_image_'+pop_view_current);$('current_image').innerHTML=pop_view_current+1;}
show_correct_buttons();return false;}
function next_image(){hide('c_image_'+pop_view_current);pop_view_current+=1;if(!ge('c_image_'+pop_view_current)){pop_view_current-=1;}
show('c_image_'+pop_view_current);$('current_image').innerHTML=pop_view_current+1;show_correct_buttons();return false;}
function show_correct_buttons(){if(pop_view_current>0){$('prev_image_button').src=pop_view_path_to_images+'leftPicCan.gif';}else{$('prev_image_button').src=pop_view_path_to_images+'leftPic.gif';}
if(!ge('c_image_'+(pop_view_current+1))){$('next_image_button').src=pop_view_path_to_images+'rightPicCant.gif';}else{$('next_image_button').src=pop_view_path_to_images+'rightPic.gif';}}
function close_dialog(dialog_to_close){pop_view_current=0;generic_dialog.get_dialog(dialog_to_close).fade_out(100);}
function pop_view_resize_images(){var current_id=0;while(ge('c_image_'+current_id)){var img=$('c_image_'+current_id);var rehide=current_id!=0;shrink_image(img,rehide);img.onload=bind(null,shrink_image,img,rehide);++current_id;}}
function shrink_image(img,rehide){var width=300;var height=225;show(img);if(img.width>width){img.height=(width*img.height)/img.width;img.width=width;}
if(img.height>height){img.width=(height*img.width)/img.height;img.height=height;}
if(rehide){hide(img);}}

if (window.Bootloader) { Bootloader.done(["js\/marketplace.js.pkg.php"]); }