/* Copyright (c) Fotki Inc */

var notOrderedPrint="uf_not_ordered";var OrderedPrint="uf_ordered";var Furl=window.location.href;var fotki_hostname2=location.hostname.match(/fotki\.com$/)?"fotki.com":location.hostname;function CartItemPhoto(qnt){this.types=new Array();this.giftQ=0;this.changed=0;this.quantity=(qnt?qnt:0);this.is_checked_at_page=(qnt?1:0);this.switchSel=function(type,idPhoto){this.changed=1;if(this.types[type]==1){this.types[type]=0;this.is_checked_at_page=0;if(type!='photo_print'&&this.giftQ>-1){this.giftQ--;if(this.giftQ==0){document.getElementsByName('gift'+idPhoto)[0].src=notOrderedPrint;}}
Core.switchClassNames(idPhoto,OrderedPrint,notOrderedPrint);try{chint.quickHide();CartHint_items["quantity"]=(CartHint_items["quantity"]-(this.quantity?this.quantity:1));if(CartHint_items["quantity"]<1)Core.setClassName("shopping_cart","shoppingcartempty");}catch(ex){return;}
}else{this.types[type]=1;this.quantity=(this.quantity?this.quantity:1);this.is_checked_at_page=1;if(type!='photo_print'){this.giftQ++;document.getElementsByName('gift'+idPhoto)[0].src=OrderedPrint;}
Core.switchClassNames(idPhoto,notOrderedPrint,OrderedPrint);try{chint.quickHide();if(CartHint_items["quantity"]==0)Core.setClassName("shopping_cart","shoppingcart");CartHint_items["quantity"]=CartHint_items["quantity"]+1;}catch(ex){return;}
}}
this.getSelect=function(type){return this.types[type];}
this.addSelect=function(type){this.types[type]=1;if(type!="photo_print"){this.giftQ++;}}}
function PageCartItemPhotos(){this.photos=new Array();this.getPhoto=function(id){return this.photos[id];}
this.switchPhotoItem=function(idPhoto,type){this.photos[idPhoto].switchSel(type,idPhoto);this.generateCookie();}
this.setSelect=function(idPhoto,type){this.photos[idPhoto].addSelect(type);if(type=='photo_print'){Core.switchClassNames(idPhoto,OrderedPrint,notOrderedPrint);}else{document.getElementsByName('gift'+idPhoto)[0].src=OrderedPrint;}}
this.setCookie=function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");document.cookie=curCookie;}
this.generateCookie=function(){var expiredate=new Date();expiredate.setTime(expiredate.getTime()+14*24*60*60*1000);var c=getCookie("fcart2")||'';var addToCart="";for(i in this.photos){if(this.photos[i].changed>0){var indexof=c.indexOf(i);if(indexof!=-1){var indexofend=c.indexOf('*',indexof);c=c.substring(0,indexof)+c.substring(indexofend+1);}
addToCart+=i;for(k in this.photos[i].types){addToCart+=","+k+"-"+this.photos[i].types[k];}
addToCart+='*';}}
addToCart=c+addToCart;this.setCookie("fcart2",addToCart,expiredate,'/','.'+fotki_hostname2);}}
var page=new PageCartItemPhotos();addAlbumDialog=function addAlbumDialog(link){if(Core.getElementU('add_album_dialog')==null){if(!addAlbumDialog.box){addAlbumDialog.box=document.createElement("div");addAlbumDialog.box.setAttribute("id","add_album_dialog");addAlbumDialog.box.setAttribute("style","display: none;");}
document.getElementsByTagName("body")[0].appendChild(addAlbumDialog.box);}
advAJAX.post({cmd:"add_album_to_cart",url:''+document.location+link,onLoading:function(obj){var load_str="<center><img src=http://images.fotki.com/progress.gif> <span class='text2b black'>Loading...</span></center>";Core.flushElementCache();if(!addAlbumDialog.dialog){addAlbumDialog.dialog=new ModalDialog('add_album_dialog');}
addAlbumDialog.dialog.show();addAlbumDialog.dialog.setContent(load_str);},onSuccess:function(obj){if(addAlbumDialog.dialog!=null&&obj.responseText!='error'){addAlbumDialog.dialog.setContent(obj.responseText);}else{var err_tpl="<span class='text3'>You cannot add this album to the shopping cart.</span><br><br><div align='right'><button onclick='javascript:closeAddAlbumDialog();'>Close</button></div>";addAlbumDialog.dialog.setContent(err_tpl);}},onError:function(obj){alert('System error. Please reload this page (<F5>).');}});}
closeAddAlbumDialog=function closeAddAlbumDialog(action){if(addAlbumDialog.dialog!=null){addAlbumDialog.dialog.hide();switch(action){case'gotoalbum':_setPhotoQuantity();_setAllPrintOrders();break;default:_setPhotoQuantity();break;};AddAlbum.descructor();}}
function _setAllPrintOrders(type){var OrderedPrint="http://images.fotki.com/order_print_new-1.gif";var notOrderedPrint="http://images.fotki.com/pixel.gif";type=type?type:'photo_print';try{if(page.photos){for(var idPhoto in page.photos){page.photos[idPhoto].types[type]=1;page.photos[idPhoto].is_checked_at_page=1;var obj=document.getElementsByName(type+idPhoto)[0];if(obj){obj.src=OrderedPrint;}}}}
catch(ex){return;}}
function _getOrderedPhotoCount(type){type=type?type:'photo_print';var count=0;try{if(page){for(var idPhoto in page.photos){if(document.getElementsByName(type+idPhoto)[0]&&page.photos[idPhoto].types[type]==1){count++;}}}}
catch(ex){return 0;}
return count;}
function _setPhotoQuantity(){try{if(page){for(var idPhoto in page.photos){if(page.photos[idPhoto]){var q=parseInt(page.photos[idPhoto].quantity);var v=parseInt(AddAlbum.value["factor"]);page.photos[idPhoto].quantity=(page.photos[idPhoto].is_checked_at_page?q:v);}}}}
catch(ex){return 0;}}
addAlbumToCart=function addAlbumToCart(path,el_name,form_name,to_back){form_name=form_name?form_name:"add_album";el_name=el_name?el_name:"clear";var form=Core.getElementU(form_name);var radio_el;var pr_format=pr_paper="";var btn_1,btn_2;for(var i=0;i<form.elements.length;i++){radio_el=form.elements[i];if(radio_el.name=="format"&&radio_el.checked==true){pr_format=radio_el.value;}else if(radio_el.name=="paper"&&radio_el.checked==true){pr_paper=radio_el.value;}
if(pr_format&&pr_paper)break;}
advAJAX.post({cmd:"addalbum",url:path,f_back:(to_back?'1':'0'),clear:(Core.getElementU(el_name).checked==true?"1":"0"),format:pr_format||"size4x6_1",paper:pr_paper||"glossy",timeout:(1000*30),onTimeout:function(){addAlbumDialog.dialog.setContent2("addalbum_progress","");alert("Connection timed out. Pleace try again later.");if(btn_1=Core.getElementU("addandgotocart_button"))btn_1.disabled=false;if(btn_2=Core.getElementU("addandgotoalbum_button"))btn_2.disabled=false;closeAddAlbumDialog('gotoalbum');},onLoading:function(obj){addAlbumDialog.dialog.setContent2("addalbum_progress","<img src=http://images.fotki.com/progress.gif>");if(btn_1=Core.getElementU("addandgotocart_button"))btn_1.disabled=true;if(btn_2=Core.getElementU("addandgotoalbum_button"))btn_2.disabled=true;},onSuccess:function(obj){var response=obj.responseText.split("|");addAlbumDialog.dialog.setContent2("addalbum_progress","");if(btn_1=Core.getElementU("addandgotocart_button"))btn_1.disabled=false;if(btn_2=Core.getElementU("addandgotoalbum_button"))btn_2.disabled=false;if(response[0]=="ok"){try{if(to_back){CHint.setQuantity(response[1]);closeAddAlbumDialog('gotoalbum');}else{document.location=response[1];Core.flushElementCache();var load_str="<center><img src=http://images.fotki.com/progress.gif> <span class='text2b black'>Loading...</span></center>";addAlbumDialog.dialog.setContent(load_str);Core.addEvent(window,'unload',closeAddAlbumDialog);}}catch(ex){try{closeAddAlbumDialog('gotoalbum');}catch(ex){return;}}}else{alert('System error.');closeAddAlbumDialog();}
return true;},onError:function(obj){if(btn_1=Core.getElementU("addandgotocart_button"))btn_1.disabled=false;if(btn_2=Core.getElementU("addandgotoalbum_button"))btn_2.disabled=false;addAlbumDialog.dialog.setContent2("addalbum_progress","");alert('System error. Please reload this page (<F5>).');}});}
function _clearChecked(e){if(e!=null){var el=(typeof(e)=='object')?e:Core.getElementU(e);}
if(typeof(e)=='object'){if(el.checked){Core.hideElement('cartinfo');Core.hideElement('totalinfo');}else{Core.showElement('cartinfo');Core.showElement('totalinfo');}}else{if(el.checked){el.checked=false;Core.showElement('cartinfo');Core.showElement('totalinfo');}else{el.checked=true;Core.hideElement('cartinfo');Core.hideElement('totalinfo');}}}
AddAlbum=function(){}
AddAlbum.init_data=null;AddAlbum.value={"format":"size4x6_glossy","paper":"glossy","factor":1};AddAlbum.price=null;AddAlbum.descructor=function(){AddAlbum.init_data=null;AddAlbum.value={"format":"size4x6_glossy","paper":"glossy","factor":1};AddAlbum.price=null;}
AddAlbum.calc=function(el,price){if(AddAlbum.price==null){if(!price||price==null){AddAlbum.price={"size4x5_glossy":0.09,"size4x5_matte":0.09,"size4x6_glossy":0.09,"size4x6_matte":0.09,"size5x7_glossy":0.40,"size5x7_matte":0.40,"size8x10_glossy":1.50,"size8x10_matte":1.50,"size3x5_glossy":0.09,"size3x5_matte":0.09};}else{AddAlbum.price=price;}}
if(AddAlbum.value==null){AddAlbum.value={"format":"size4x6_glossy","paper":"glossy","factor":1};}
if(AddAlbum.init_data==null){var data=new Object();data["cartquantity"]=Core.getText("cartquantity");data["albumquantity"]=Core.getText("albumquantity");data["cartsum"]=Core.getText("cartsum");if(data["cartsum"].indexOf("$")!=-1){data["cartsum"]=data["cartsum"].substr(data["cartsum"].indexOf("$")+1);}
AddAlbum.init_data=data;}
if(el.name=="format"){var mass=el.value.split("_");AddAlbum.value["format"]=mass[0]+"_"+AddAlbum.value["paper"];AddAlbum.value["factor"]=mass[1];}else if(el.name=="paper"){var mass=AddAlbum.value["format"].split("_");AddAlbum.value["paper"]=el.value;AddAlbum.value["format"]=mass[0]+"_"+el.value;}
var album_quantity=AddAlbum.value["factor"]*AddAlbum.init_data["albumquantity"];var total_quantity=album_quantity*1+AddAlbum.init_data["cartquantity"]*1;var album_sum=album_quantity*AddAlbum.price[AddAlbum.value["format"]];var total_sum=album_sum*1+AddAlbum.init_data["cartsum"]*1;Core.setText("albumquantity",album_quantity);Core.setText("totalquantity",total_quantity);Core.setText("albumsum","$"+Core.formatMoney(album_sum));Core.setText("totalsum","$"+Core.formatMoney(total_sum));}
var DialogInviteLoading=null;var DialogInviteForm=null;var DialogInviteSending=null;var DialogInviteComplete=null;var trans_enter_login='Please enter your username!';var trans_enter_password='Please enter your password!';var trans_email_format='Wrong email address format.';var trans_enter_email='Please specify email address.';var trans_enter_name='Please specify your name.';var trans_enter_your_email='Please specify email address.';var trans_enter_text='Please type your text';var trans_incor_uname_passwd='UserName or Password is incorrect.';var iv_ssid=null;var iv_key=null;var member=true;function AlbumInvite(){advAJAX.post({"cmd":"invite_album",evalScripts:true,onLoading:function(obj){if(!DialogInviteForm){DialogInviteForm=new ModalDialog('album_invite_form');}
DialogInviteForm.setContent('<center><img src=http://images.fotki.com/progress.gif> <span class=\"text2b black\">'+LangDict.translateToken('Lite.Albums.Invite.Loading')+'</span></center>');setTimeout('DialogInviteForm.show();',20);},onSuccess:function(obj){var response=obj.responseText.split("||");DialogInviteForm.setContent(response[0]);eval(response[1]);}});}
function addemail(email){document.emailform.to.focus();if(document.emailform.to.value==0){document.emailform.to.value=email;}else{var index=document.emailform.to.value.indexOf(","+email);if(index==-1){index=document.emailform.to.value.indexOf(", "+email);}
if(index==-1){document.emailform.to.value=document.emailform.to.value+', '+email;}else{var regexp=new RegExp(","+email);var regexp2=new RegExp(","+email);var regexp3=new RegExp(", "+email);document.emailform.to.value=document.emailform.to.value.replace(regexp3,"");document.emailform.to.value=document.emailform.to.value.replace(regexp,"");document.emailform.to.value=document.emailform.to.value.replace(regexp2,"");}}}
function checkEmailRun(){Core.setText('email_error',"");Core.setText('message_error',"");var check1=checkEmails('field_to');var check2=checkEmails('email_from');if(check1){Core.setText('email_error',trans_email_format);}else if(check2){Core.setText('from_error',trans_email_format);}else if(!(Core.getText('field_to'))){Core.setText('email_error',trans_enter_email);}else if(!(Core.getText('user_name'))||trim(Core.getText('user_name')).length==0){Core.setText('from_error',trans_enter_name);}else if(!(Core.getText('email_from'))){Core.setText('from_error',trans_enter_your_email);}else if(!(Core.getText('message_text'))){Core.setText('message_error',trans_enter_text);}else{sendEmail();}}
function checkEmails(field){var txt=Core.getText(field);var e_regexp=new RegExp("^([A-Za-z0-9\-\_\.])+@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,4}$");var error=0;txt=txt.replace(/\n/g,"");txt=txt.replace(/\r/g,"");txt=txt.replace(/ /g,"");txt=trim(txt);if(txt.length==0){return 1;}
var matches=txt.split(",");for(var i=0;i<matches.length;i++){if(matches[i]){var email=matches[i];if(!email.match(e_regexp)){error=1;}}}
return error;}
var mailservice='fotki';function setServ(type){mailservice=type;}
function encryptForInvite(str,pwd){if(pwd==null||pwd.length<=0){alert("Please enter a password with which to encrypt the message.");return null;}
var prand="";for(var i=0;i<pwd.length;i++){prand+=pwd.charCodeAt(i).toString();}
var sPos=Math.floor(prand.length/5);var mult=parseInt(prand.charAt(sPos)+prand.charAt(sPos*2)+prand.charAt(sPos*3)+prand.charAt(sPos*4)+prand.charAt(sPos*5));var incr=Math.ceil(pwd.length/2);var modu=Math.pow(2,31)-1;if(mult<2){alert("Algorithm cannot find a suitable hash. Please choose a different password. \nPossible considerations are to choose a more complex or longer password.");return null;}
var salt=Math.round(Math.random()*1000000000)%100000000;prand+=salt;while(prand.length>10){prand=(parseInt(prand.substring(0,10))+parseInt(prand.substring(10,prand.length))).toString();}
prand=(mult*prand+incr)%modu;var enc_chr="";var enc_str="";for(var i=0;i<str.length;i++){enc_chr=parseInt(str.charCodeAt(i)^Math.floor((prand/modu)*255));if(enc_chr<16){enc_str+="0"+enc_chr.toString(16);}else enc_str+=enc_chr.toString(16);prand=(mult*prand+incr)%modu;}
salt=salt.toString(16);while(salt.length<8)salt="0"+salt;enc_str+=salt;return enc_str;}
function getContact(){var login=Core.getText("login");var password=Core.getText("password");if(!login){Core.setText('error',trans_enter_login);Core.showElement('error');return;}
if(!password){Core.setText('error',trans_enter_password);Core.showElement('error');return;}
if(mailservice=='fotki'){password=encryptForInvite(password,iv_key);advAJAX.post({"login":login,"passwd":password,"cmd":"get_contact","mailservice":mailservice,"iv_ssid":iv_ssid,timeout:28900,onTimeout:function(){Core.setText('loading','');Core.setText('error','Connection timed out. Please try again.');Core.showElement('error');},onLoading:function(obj){Core.hideElement('error');Core.setText('error','');Core.setText('loading','<img src=http://images.fotki.com/progress.gif> ');},onSuccess:function(obj){var n=obj.responseText.indexOf('<!DOCTYPE');if(n==0){Core.setText('password','');Core.setText('loading','');Core.setText('error',trans_incor_uname_passwd);Core.showElement('error');}else{Core.hideElement('login_form');Core.setText('loading','');Core.setText('login','');Core.setText('password','');Core.setText('add_book_'+mailservice,obj.responseText);}}});}else{password=password;advAJAX.post({"login":login,"passwd":password,"cmd":"get_contact","mailservice":mailservice,timeout:28900,onTimeout:function(){Core.setText('loading','');Core.setText('error','Connection timed out. Please try again.');Core.showElement('error');},onLoading:function(obj){Core.hideElement('error');Core.setText('error','');Core.setText('loading','<img src=http://images.fotki.com/progress.gif> ');},onSuccess:function(obj){var n=obj.responseText.indexOf('Error');if(n==0){Core.setText('password','');Core.setText('loading','');Core.setText('error',obj.responseText.substr(n+7));Core.showElement('error');}else{Core.hideElement('login_form');Core.setText('loading','');Core.setText('login','');Core.setText('password','');Core.setText('add_book_'+mailservice,obj.responseText);}}});}}
function sendEmail(){var display_name=Core.getText('user_name');var subject_text=display_name+Core.getText("subject_text");var checkbox='';if(Core.getElementU('checkbox')){checkbox=''+Core.getElementU("checkbox").checked;}
var pid='';var is_ecard='';if(Core.getElementU('is_ecard')){is_ecard=Core.getText('is_ecard');}
if(Core.getElementU('pid')){pid=Core.getText("pid");progress_text="E-card sending...";limit_text="Dayly e-cards limit reached";complite_text="E-card sent";}else{progress_text="Sending invitation...";limit_text="Daily invitation limit reached";complite_text=LangDict.translateToken('Lite.Albums.Invite.InvitationSent');}
advAJAX.post({"cmd":"invite_sendemail","to":Core.getText("field_to"),"subject":subject_text,"text":Core.getText("message_text"),"checkbox":checkbox,"email_from":Core.getText("email_from"),"user_name":display_name,"pid":pid,"is_ecard":is_ecard,onLoading:function(obj){DialogInviteForm.hide();DialogInviteSending=new ModalDialog('<center><img src=http://images.fotki.com/progress.gif> <span class=\"text2b black\">'+progress_text+'</span></center>');DialogInviteSending.show();},onSuccess:function(obj){var n=obj.responseText.indexOf('ERROR');setTimeout('DialogInviteSending.hide();',3000);if(n==0){DialogInviteComplete=new ModalDialog('<center><span class=\"text2b black\"><img src=http://images.fotki.com/cart/warning.gif>'+limit_text+'</span></center>');setTimeout('DialogInviteComplete.show();',3000);setTimeout('DialogInviteComplete.hide();',5000);}else{DialogInviteComplete=new ModalDialog('<center><img src=http://images.fotki.com/cart/ok.gif> <span class=\"text2b black\">'+complite_text+'</span></center>');setTimeout('DialogInviteComplete.show();',3000);setTimeout('DialogInviteComplete.hide();',5000);}}});}
function setBg(element,bg){element.style.background=bg;}
function trim(str){str=str.replace(/^\s*/,'').replace(/\s*$/,'');return str;}
function changeMailType(type){var mails=['hotmail','yahoo','fotki','gmail'];for(var i in mails){if(mails[i]==type){setServ(type);Core.setClassName(mails[i]+'_td','arrow_'+mails[i]);if((mails[i]=="fotki"&&member==false)||mails[i]!="fotki"){Core.showElement('login_form');}else{Core.hideElement('login_form')}
Core.showElement("add_book_"+mails[i]);if(Core.getText("add_book_"+mails[i])){if(trim(Core.getText("add_book_"+mails[i]))){Core.hideElement('login_form');}}}else{Core.setClassName(mails[i]+'_td','');Core.hideElement('error','');Core.hideElement('add_book_'+mails[i]);}}}
function ajaxAddFavorite(){$('#addfav').hide();$('#fav_progress').show();$.ajax({type:"POST",data:'cmd=add_to_favorite',timeout:5000,cache:false,success:function(obj){if(obj==0){$('#cnt_faved').html('');}else{$('#cnt_faved').html(' ('+obj+')').show();}
if($('#view_favedby').data('qtip')){$('#view_favedby').qtip("destroy");}
$('#fav_progress').hide();$('#remfav').show();},error:function(obj,err_str){$('#fav_progress').hide();$('#addfav').show();var err='Network error';if(err_str){err=err_str;}
alert("Alas, something went wrong: "+err+"!");}});}
function ajaxRemoveFavorite(){$('#fav_progress').show();$('#remfav').hide();$.ajax({type:"POST",data:'cmd=remove_from_favorite',timeout:5000,cache:false,success:function(obj){if(obj==0||obj=='0'){$('#cnt_faved').html('');}else{$('#cnt_faved').html('('+obj+')');}
if($('#view_favedby').data('qtip')){$('#view_favedby').qtip("destroy");}
$('#fav_progress').hide();$('#addfav').show();},error:function(obj,err_str){$('#fav_progress').hide();$('#remfav').show();var err='Network error';if(err_str){err=err_str;}
alert("Alas, something went wrong: "+err+"!");}});}
function ajaxAddRemoveNotify(){$('.notify_select').live("change",function(){var val_change=$(this).find(':selected').val();$('#select_notify_top option').each(function(){if($(this).val()==val_change){$(this).attr("selected",true);}});});}
function ajaxAddNotify(pid){$('#img_notif_disabled_top').hide();$('#notif_progress').show();$.ajax({type:"POST",data:{fav_cmd:'add_notify',photo_id:pid},success:function(){$('#notif_progress').hide();$('#img_notif_top').show();var arr=getElementsByIdPrefix("input","notify_check");for(var i=0;i<arr.length;i++){arr[i].checked=true;}},error:function(){alert('Alas, something went wrong');$('#notif_progress').hide();$('#img_notif_top').show();}});}
function ajaxRemoveNotify(pid){$('#img_notif_top').hide();$('#notif_progress').show();$.ajax({type:"POST",data:{fav_cmd:'remove_notify',photo_id:pid},success:function(){$('#notif_progress').hide();$('#img_notif_disabled_top').show();var arr=getElementsByIdPrefix("input","notify_check");for(var i=0;i<arr.length;i++){arr[i].checked=false;}},error:function(){alert('Something went wrong');$('#notif_progress').hide();$('#img_notif_disabled_top').show();}});}
function removeNotifiedUser(){$('.remove_notifed_user').live('click',function(){var user_id=$(this).attr('id').replace('remove_','');$.ajax({type:"POST",data:{fav_cmd:'remove_notify',entry_id:user_id},success:function(obj){if(!isNaN(obj)){if(obj==0){$('#show_notified_users').qtip("destroy").hide();}else{$('#notify_'+user_id).hide();}}},error:function(obj){}});});}
function showNotifiedUsers(){$('#show_notified_users').qtip({content:{title:{text:'Following members have chosen to be notified of comments',button:'x'},url:'?',data:{fcmd:'show_notif'}},show:{solo:true,delay:0,ready:true,when:{event:'click'},effect:{length:500,type:'slide'}},position:{corner:{target:'bottomMiddle',tooltip:'topMiddle'},adjust:{y:5,screen:true}},hide:false,style:{padding:4,title:{padding:3,'font-size':'12px','white-space':'nowrap'},'font-size':'12px',border:{width:2,radius:5},tip:true,name:'cream',width:{max:625,min:625}}});}
function showFavoriteUsers(ref,user_id,photo_id,page_num){if(typeof(page_num)=='undefined'){page_num=1;}
$('#'+ref).qtip({content:{title:{text:'Following members faved this',button:'x'},url:'?',data:{cmd:'viewusers',fav_user_id:user_id,fav_photo_id:photo_id,fav_page:page_num}},show:{solo:true,delay:0,ready:true,when:{event:'click'},effect:{length:500,type:'slide'}},position:{corner:{target:'bottomMiddle',tooltip:'topMiddle'},adjust:{screen:true,y:5}},hide:false,style:{padding:4,title:{padding:3,'font-size':'12px','white-space':'nowrap'},'font-size':'12px',border:{width:2,radius:5},tip:true,name:'cream',width:{max:625,min:625}},api:{}});}
function next_page(page,user_id,photo_id){var api=$('#view_favedby').qtip("api");$.ajax({type:"POST",url:'?',data:{cmd:'viewusers',fav_user_id:user_id,fav_photo_id:photo_id,fav_page:page},success:function(obj){api.updateContent(obj);}});}
$(document).ready(function(){ajaxAddRemoveNotify();removeNotifiedUser();$('.favorite_users').live("mouseenter mouseleave",function(e){if(e.type=='mouseenter'){$(this).addClass('favorite_hover');}
if(e.type=='mouseleave'){$(this).removeClass('favorite_hover');}});$('#addfav2').qtip({content:{text:' ',title:{text:$('#fav_login_text').html(),button:'x'}},show:{solo:true,when:'click',delay:0},hide:false,position:{corner:{target:'bottomLeft',tooltip:'topLeft'},adjust:{resize:false,scroll:false,x:12}},style:{width:{min:300,max:800},padding:2,title:{padding:4,'font-size':'12px','white-space':'nowrap'},button:{'font-size':'10px','padding-left':'5px','padding-right':'5px'},'font-size':'0px','white-space':'nowrap',padding:0,margin:0,border:{width:2,radius:4},tip:true,name:'cream'}});});