
paths['admin_base_url']         = paths['base_url'] + 'admin/';
paths['css_admin_folder']       = paths['base_url'] + 'public/admin/css/';
paths['js_admin_folder']        = paths['base_url'] + 'public/admin/js/';
paths['images_admin_folder']    = paths['base_url'] + 'public/admin/images/';
paths['base_url']               = paths['base_url'] + '';
paths['css_front_folder']       = paths['base_url'] + 'public/frontend/css/old/';
paths['js_front_folder']        = paths['base_url'] + 'public/frontend/js/';
paths['images_front_folder']    = paths['base_url'] + 'public/frontend/images/_old/';

paths['css_shared_folder']      = paths['base_url'] + 'public/shared/css/';
paths['js_shared_folder']       = paths['base_url'] + 'public/shared/js/';
paths['images_shared_folder']   = paths['base_url'] + 'public/shared/images/';
paths['modules_shared_folder']  = paths['base_url'] + 'public/shared/';
paths['users_folder']           = paths['base_url'] + 'public/users/';
paths['groups_folder']          = paths['base_url'] + 'public/groups/';

var vd_ajax_img = Array();

vd_ajax_img['common']   = '<img src="' + paths['images_shared_folder'] + 'ajaxLoader.gif" />';
vd_ajax_img['3d']       = '<img src="' + paths['images_shared_folder'] + '3d-rotation.gif" />';
vd_ajax_img['points']   = '<img src="' + paths['images_shared_folder'] + 'points-indicator.gif" />';
vd_ajax_img['circle']   = '<img src="' + paths['images_shared_folder'] + 'circle-indicator.gif" />';
vd_ajax_img['button'] 	= '<img src="' + paths['images_shared_folder'] + 'circles.gif" />';
vd_ajax_img['loader'] 	= '<img src="' + paths['images_shared_folder'] + 'loader.gif"  alt="Please wait, loading..."  style="margin: 30px 90px; " />';


//Preload used images here
jQuery("<img>").attr("src", paths['images_shared_folder'] + 'points-indicator.gif');
jQuery("<img>").attr("src", paths['images_shared_folder'] + 'button-disabled.gif');
jQuery("<img>").attr("src", paths['images_shared_folder'] + 'circles.gif');

function vdAjaxError(result,displayError){var errorKeyword='[error]';if(result.indexOf(errorKeyword)==0){if(displayError){alert(result.substring(errorKeyword.length,result.length).replace(/\\n/i,' \n\n'));}
return true;}else{return false;}}
$.preloadImages=function(){for(var i=0;i<arguments.length;i++){img=new Image();img.src=arguments[i];}}
function arrayRemove(array,from,to){var rest=array.slice((to||from)+1||array.length);array.length=from<0?array.length+from:from;return array.push.apply(array,rest);}
var jqmWindowObjectCaller;$(document).ready(function(){$('.fnc-onload').removeClass('fnc-onload');setTimeout(function(){$(".info-help.green:not(.fnc-nofadeout), .fnc-fadeout").fadeOut("slow",function(){$(".info-help.green:not(.fnc-nofadeout), .fnc-fadeout").remove();});},5000);$(".fnc-closeinfo").click(function(){$(this).parent().fadeOut();});$("a.fnc-wait").click(function(){$(this).parent().html(vd_ajax_img['points']);});$(".fnc-hideable").click(function(){$(this).before(vd_ajax_img['points']).hide();});$(".fnc-hideable-big").click(function(){$(this).before(vd_ajax_img['button']).hide();});$('a.fnc-remove-friend').click(function(){var _this=$(this);jConfirm('Are you sure you want to remove this friend?',null,function(r){if(r){$('#fnc-send-msg-'+_this.attr('href')).fadeOut();_this.fadeOut().load(paths['base_url']+'friends/ajax_remove_friend/'+_this.attr('href'));}});return false;});$('a.fnc-respond-to-friend-request').click(function(){if(!me['logged']){jAlert('You need to be registered and logged in to use this feature.');return false;}
if(!me['published']){jAlert('You must publish your profile in order to use this feature.');return false;}
jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmFriendAdd" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmFriendAdd').jqm({ajax:paths['base_url']+"friends/ajax_respond_to_request/"+$(this).attr('href')}).jqmShow();return false;});$('.fnc-save-pref').click(function(){$(this).html(vd_ajax_img['points']);$.ajax({url:paths['base_url']+'profile/ajax_save_preference/'+$(this).attr('href')});$(this).ajaxStop(function(){$('.fnc-pref-container').slideUp();});return false;});$('a.edit-tags').click(function(){$('#modal-windows').empty().html('<div id="jqmTags" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmTags').jqm({ajax:paths['module_url']+"ajax_edit_tags/"+$(this).attr('href')}).jqmShow();return false;});$("a.edit-description").click(function(){$('#modal-windows').empty().html('<div id="jqmDescription" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmDescription').jqm({ajax:paths['module_url']+"ajax_edit_"+currentItemType+"_description/"+$(this).attr('href')}).jqmShow();return false;});$("a.fnc-add-friend").click(function(){if(!me['logged']){jAlert('You need to be registered and logged in to use this feature.');return false;}
if(!me['published']){jAlert('You must publish your profile in order to use this feature.');return false;}
jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmFriendAdd" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmFriendAdd').jqm({ajax:paths['base_url']+"friends/ajax_add_friend/"+$(this).attr('href')}).jqmShow();return false;});$("a.fnc-add-associate").click(function(){jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmAssociateAdd" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmAssociateAdd').jqm({ajax:paths['base_url']+"associates/ajax_add_friend/"+$(this).attr('href')}).jqmShow();return false;});$("a.fnc-send-msg").click(function(){if(!me['logged']){jAlert('You need to be registered and logged in to use this feature.');return false;}
jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmSendMsg" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmSendMsg').jqm({ajax:paths['base_url']+"messages/ajax_send_message/"+$(this).attr('href')}).jqmShow();return false;});$("a.fnc-forgot-pass").click(function(){jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmForgotPass" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmForgotPass').jqm({ajax:paths['base_url']+"login/ajax_forgot_pass/"}).jqmShow();return false;});$("a.fnc-group-join").click(function(){return(confirm('Are you sure you want to join this group?'));});$("a.fnc-group-leave").click(function(){return(confirm('Are you sure you want to leave this group?'));});$('a.fnc-add-favorites').click(function(){if(!me['logged']){alert('You need to be registered and logged in to use this feature.');return false;}
if(confirm('Add to Favorites?')){var company_data=$(this).attr('href');$.get(paths['base_url']+"favorites/ajax_add_to_favorites/"+company_data);$(this).fadeOut();}
return false;});$(".fnc-see-video").click(function(){jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmSeeVideo" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmSeeVideo').jqm({ajax:paths['base_url']+"videos/ajax_get_profile_video_code/"+$(this).attr('rel')}).jqmShow();return false;});$(".fnc-see-profile-video").click(function(){var id=$(this).attr('rel');var type=$(this).attr('rev');var profileLink=function(){$('#jqmSeeVideo').append('<a href="'+paths['base_url']+type+'/'+id+'" id="jqmProfileLink" class="more-link" title="View Profile">View Profile</a>');};jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmSeeVideo" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmSeeVideo').jqm({ajax:paths['base_url']+"videos/ajax_get_profile_video_code/"+id,onLoad:profileLink}).jqmShow();return false;});$(".fnc-see-help-video").click(function(){jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmSeeVideo" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmSeeVideo').jqm({ajax:paths['base_url']+"tutorials/ajax_get_video_code/"+$(this).attr('rel')}).jqmShow();return false;});$('a.fnc-logged-only').click(function(){if(!me['logged']){alert('You need to be registered and logged in to use this feature.');return false;}});$('.fnc-add-to-wishlist').click(function(){if(!me['logged']){alert('You need to be registered and logged in to use this feature.');return false;}
var id=$(this).attr('href');var id_product=id.split('/');$.ajax({url:paths['base_url']+"products/ajax_add_to_wishlist/"+id});$(this).ajaxStop(function(){$(this).hide();$("#fnc-fav-r-"+id_product[0]).show();});return false;});$('.fnc-remove-from-wishlist').click(function(){if(!me['logged']){alert('You need to be registered and logged in to use this feature.');return false;}
var id=$(this).attr('href');$.ajax({url:paths['base_url']+"products/ajax_remove_from_wishlist/"+id});$(this).ajaxStop(function(){$(this).hide();$("#fnc-fav-a-"+id).show();});return false;});$('.fnc-box-handler h3').click(function(){var box=$(this).parents('.standard-box');box.find('.box-content').toggle();box.find('.box-footer').toggle();box.find('.search').toggle();box.find('.additional-menu').toggle();box.toggleClass('closed');var closedFlag=$.cookie($(this).parents('.standard-box').attr('id'))==1?0:1;$.cookie($(this).parents('.standard-box').attr('id'),closedFlag,{expires:180});return false;});$(".fnc-box-handler").parents('.standard-box').each(function(){if($.cookie($(this).attr('id'))==1){$('#'+$(this).attr('id')).find('.box-content').toggle();$('#'+$(this).attr('id')).find('.box-footer').toggle();$('#'+$(this).attr('id')).find('.search').toggle();$('#'+$(this).attr('id')).find('.additional-menu').toggle();$('#'+$(this).attr('id')).toggleClass('closed');}});$(".fnc-invitation").click(function(e){if(me['invite_module_setting']=='simple')window.location=paths['base_url']+"invite/friends";var external=$(this).attr('rel')=='external'?'external':'';var page_name='show_page';e.preventDefault();$.nyroModalManual({url:paths['base_url']+'invite/'+page_name+'/'+external,bgColor:'#081F27',css:{bg:{height:$('body').height()+400},wrapper:{border:0},content:{overflow:'hidden'}}});return false;});$(".fnc-report").click(function(e){jqmWindowObjectCaller=$(this);$('#modal-windows').empty().html('<div id="jqmReport" class="jqmWindow">'+vd_ajax_img['loader']+'</div>');$('#jqmReport').jqm({ajax:paths['base_url']+'report/'+$(this).attr('href')+'/'+$(this).attr('rel')}).jqmShow();return false;});$('.fnc-validate-form').submit(function(){if($('.fnc-required-nonempty-field').val()==''){alert('Please enter a search word.');return false;}else{return true;}});$('.fnc-like').click(function(){var thisObject=$(this);$.ajax({url:paths['base_url']+"frontpage/ajax_like/"+$(this).attr('rel'),success:function(){thisObject.parent().html('You like this.');}});return false;});$('.fnc-unlike').click(function(){var thisObject=$(this);$.ajax({url:paths['base_url']+"frontpage/ajax_unlike/"+$(this).attr('rel'),success:function(){thisObject.parent().html('');}});return false;});$('.fnc-clear-notifications').click(function(){$.ajax({url:paths['base_url']+"frontpage/ajax_remove_system_notification",success:function(){alert('ok');}});return false;});});jQuery.fn.fadeToggle=function(speed,easing,callback){return this.animate({opacity:'toggle'},speed,easing,callback);};
