var JSON;if(!JSON){JSON={};}
(function(){"use strict";function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());;function foo(swing){if(swing=='open'){$('#bompa_stuff').show('slow');$('#login_stuff').hide('fast');$('#login_username').focus();}else{$('#bompa_stuff').hide('slow');$('#login_stuff').show('fast');}}
function LTrim(value){var re=/\s*((\S+\s*)*)/;return value.replace(re,"$1");}
function RTrim(value){var re=/((\s*\S+)*)\s*/;return value.replace(re,"$1");}
function trim(value){return LTrim(RTrim(value));}
var errorMessageHideTimer;function setTargetBlank(thelink){thelink.target="_blank";}
function hideElement(id){var element=document.getElementById(id);element.style.display='none';}
function showElement(id){var element=document.getElementById(id);element.style.display='';}
function getCheckedValue(radioName){var radioObj=document.getElementsByName(radioName);if(!radioObj){return'';}
var radioLength=radioObj.length;if(radioLength==undefined){if(radioObj.checked){return radioObj.value;}else{return'';}}
for(var i=0;i<radioLength;i++){if(radioObj[i].checked){return radioObj[i].value;}}
return'';}
function ismaxlength(obj){var mlength=obj.getAttribute?parseInt(obj.getAttribute("maxlength")):"";if(obj.getAttribute&&obj.value.length>mlength){obj.value=obj.value.substring(0,mlength);return false;}
return true;}
function radioIsChecked(radio_element){if(!radio_element.length){return true;}
for(i=0;i<radio_element.length;i++){if(radio_element[i].checked){return true;}}
return false;}
function confirmSubmit(msg){if(typeof msg=='undefined'){msg='Are you sure you wish to delete this?'+"\n"+'This cannot be undone!!';}
var agree=confirm(msg);if(agree){return true;}else{return false;}}
function checkAllSongBoxes(){var songs_are_checked=document.getElementById('checkall_songs');var checkbox_elements=document.getElementsByName('song_array[]');to_be_checked=toggleCheckTracker(songs_are_checked);toggleChecks(checkbox_elements,to_be_checked);}
function checkAllGenres(){var genres_are_checked=document.getElementById('checkall_genres');var checkbox_elements=document.getElementsByName('genres[]');to_be_checked=toggleCheckTracker(genres_are_checked);toggleChecks(checkbox_elements,to_be_checked);}
function toggleChecks(element,checked){for(var i=0;i<element.length;i++){element[i].checked=checked;}}
function toggleCheckTracker(element){if(element.value=='false'){to_be_checked=1
element.value='true';}else{to_be_checked=0
element.value='false';}
return to_be_checked;}
function daysInMonth(iMonth,iYear){return 32-new Date(iYear,iMonth,32).getDate();}
function date_month_change(){var month=document.getElementById('birthday_month').value;month=month-1;var day=document.getElementById('birthday_day').value;var year=document.getElementById('birth_year').value;var lastDay;switch(month+1){case 1:case 3:case 5:case 7:case 8:case 10:case 12:lastDay=31;break;case 2:lastDay=29;break;case 4:case 6:case 9:case 11:lastDay=30;break;}
if(month>=0&&year!=""){lastDay=daysInMonth(month,year);}
if(month<0){lastDay=31;}
var previousSelectedDay=document.getElementById('birthday_day').value;document.getElementById('birthday_day').options.length=0;var option=document.createElement("OPTION");theText=document.createTextNode("Day:");option.appendChild(theText);option.value="99";document.getElementById("birthday_day").appendChild(option);for(i=1;i<=lastDay;i++){var option=document.createElement("OPTION");theText=document.createTextNode(i);option.appendChild(theText);option.value=i;if(previousSelectedDay==i){option.selected=true;}
document.getElementById("birthday_day").appendChild(option);}}
function showLogin(redirection,url){if(redirection==1){jQuery("#dest").val(redirection);}
var position=jQuery("#header_login_link").position();var position1=jQuery("#menu").position();var s=(position.left+position1.left)+'px';document.getElementById('login_outer').style.left=s;if(!jQuery("#login_outer-registration").is(":hidden")){closeRegistration();}
if(jQuery("#login_outer").is(":hidden")){jQuery('#login_outer').slideDown('slow');}}
function showRegistration(index){var position=jQuery("#header_register_link").position();var position1=jQuery("#menu").position();var s=(position.left+position1.left)+'px';document.getElementById('login_outer-registration').style.left=s;if(!jQuery("#login_outer").is(":hidden")){closeLogin();}
if(jQuery("#login_outer-registration").is(":hidden")){jQuery('#login_outer-registration').slideDown('slow');}}
function closeLogin(){jQuery('#login_outer').slideUp('slow');}
function closeRegistration(){jQuery('#login_outer-registration').slideUp('slow');}
function showNotification(message){if($('#notificationBar').length){jQuery('#notificationBar').html("<p onclick='hideErrorMessageAtTop()'>"+String(message)+"</p>");jQuery("#notificationBar").slideDown("slow");errorMessageHideTimer=setTimeout('jQuery("#notificationBar").slideUp("slow")',3000);}else{alert(message);}}
function hideErrorMessageAtTop(){if(errorMessageHideTimer!=null)
clearTimeout(errorMessageHideTimer);jQuery("#notificationBar").slideUp("slow");}
function showSuccessMsg(message){jQuery('#successMsg').html("<p onclick='hideSuccessMsg()'>"+String(message)+"</p>");jQuery("#successMsg").slideDown("slow");errorMessageHideTimer=setTimeout('jQuery("#successMsg").slideUp("slow")',3000);}
function hideSuccessMsg(){if(errorMessageHideTimer!=null)
clearTimeout(errorMessageHideTimer);jQuery("#successMsg").slideUp("slow");}
function isValidEmailAddress(emailAddress){var pattern=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return pattern.test(emailAddress);}
function isUrl(s){var regexp=new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/);return regexp.test(s);}
function moveup(id){}
function movedown(id){}
function showMessage(message){showNotification(message);}
function show_list(e){if(!e)e=window.event;if(e.target)el=e.target;else if(e.srcElement)el=e.srcElement;var id=el.id;if(document.getElementById('list_box')){if(id=='search_text'){if(document.getElementById('search_text').value==''){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else if(id=='venue_list'){if(document.getElementById('search_text').value==''){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else if(id=='cloth_list'){if(document.getElementById('search_text').value==''){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else if(id=='user_list'){if(document.getElementById('search_text').value==''){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else if(id=='band_list'){if(document.getElementById('search_text').value==''){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else{if(document.getElementById('search_text').value==''){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="none";}}}
function show_list_index(e){if(!e)e=window.event;if(e.target)el=e.target;else if(e.srcElement)el=e.srcElement;var id=el.id;if(document.getElementById('list_box')){if(id=='search_text'){if(document.getElementById('search_text').value=='Search for Band, Venue, Company or User'){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";document.getElementById('search_text').style.color="black";}else if(id=='venue_list'){if(document.getElementById('search_text').value=='Search for Band, Venue, Company or User'){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else if(id=='cloth_list'){if(document.getElementById('search_text').value=='Search for Band, Venue, Company or User'){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else if(id=='user_list'){if(document.getElementById('search_text').value=='Search for Band, Venue, Company or User'){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else if(id=='band_list'){if(document.getElementById('search_text').value=='Search for Band, Venue, Company or User'){document.getElementById('search_text').value='';}
document.getElementById('list_box').style.display="block";}else{if(document.getElementById('search_text').value==''){document.getElementById('search_text').value='Search for Band, Venue, Company or User';}
document.getElementById('list_box').style.display="none";}}}
function select_list_item(val,e){if(!e)e=window.event;if(e.target)el=e.target;else if(e.srcElement)el=e.srcElement;var id=el.id;if(id=='venue_list'||id=='cloth_list'||id=='band_list'||id=='user_list'){document.getElementById('list_box').style.display="block";}
if(val=='band'){document.getElementById('band_list').className="active";document.getElementById('venue_list').className="";document.getElementById('user_list').className="";document.getElementById('cloth_list').className="";document.getElementById('selected_item').value=0;document.getElementById("cloth_list").style.background="";}
if(val=='venue'){document.getElementById('band_list').className="";document.getElementById('venue_list').className="active";document.getElementById('user_list').className="";document.getElementById('cloth_list').className="";document.getElementById('selected_item').value=1;document.getElementById("cloth_list").style.background="";}
if(val=='user'){document.getElementById('band_list').className="";document.getElementById('venue_list').className="";document.getElementById('user_list').className="active";document.getElementById('cloth_list').className="";document.getElementById("cloth_list").style.background="";document.getElementById('selected_item').value=3;}
if(val=='company'){document.getElementById('band_list').className="";document.getElementById('venue_list').className="";document.getElementById('user_list').className="";document.getElementById('cloth_list').className="active";document.getElementById('selected_item').value=2;}
document.getElementById('search_text').focus();}
function select_list_item_search(val){if(val=='band'){document.getElementById('band_list').className="active";document.getElementById('venue_list').className="";document.getElementById('cloth_list').className="";document.getElementById('user_list').className="";document.getElementById('selected_item').value=0;document.getElementById("cloth_list").style.background="";}
if(val=='venue'){document.getElementById('band_list').className="";document.getElementById('venue_list').className="active";document.getElementById('user_list').className="";document.getElementById('cloth_list').className="";document.getElementById('selected_item').value=1;document.getElementById("cloth_list").style.background="";}
if(val=='cloth'){document.getElementById('band_list').className="";document.getElementById('venue_list').className="";document.getElementById('user_list').className="";document.getElementById('cloth_list').className="active";document.getElementById('selected_item').value=2;}
if(val=='user'){document.getElementById('band_list').className="";document.getElementById('venue_list').className="";document.getElementById('cloth_list').className="";document.getElementById('user_list').className="active";document.getElementById("cloth_list").style.background="";document.getElementById('selected_item').value=3;}}
function show_image1(){document.getElementById("cloth_list").style.background='url(../../images/bg_dropdown_hover_facebbok_search.png)';}
function hide_image1(){if(document.getElementById("cloth_list").className=="active")
document.getElementById("cloth_list").style.background='url(../../images/bg_dropdown_hover_facebbok_search.png)';else
document.getElementById("cloth_list").style.background="";}
function urlmatch(url){var companyUrl=url;var RegExp=/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;if(RegExp.test(companyUrl))
{return true;}
else
{return false;}}
function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n);}
function isNumberKey(evt){var charCode=(evt.which)?evt.which:event.keyCode;if(charCode>31&&(charCode<48||charCode>57))
return false;return true;}
function limitText(limitField,limitNum){if(limitField.value.length>limitNum){limitField.value=limitField.value.substring(0,limitNum);}}
var newsUrl='';var page=0;function loadNews(url){newsUrl=url;page=0;jQuery('#contentNews').html('<img class="loadingimg" src="./images/ajax-loader.gif" alt="News is loading.." />');jQuery.get(url,function(data){jQuery('#contentNews').html(data);});}
function loadAjaxUrl(url,divID,params){var data='?1';for(var i in params){data+='&'+i+'='+params[i];}
jQuery.ajax({url:url,data:data,cache:false,success:function(data){jQuery(divID).html(data);}});}
function ajaxCall(url,divID,params){var data='?1';for(var i in params){data+='&'+i+'='+params[i];}
jQuery.ajax({url:url,data:data,cache:false,success:function(data){console.log(data);if(data.divID&&data.html){jQuery(data.divID).html(data.html);}}});}
function makeModal(){jQuery('a[name=modal]').click(function(e){e.preventDefault();var id=jQuery(this).attr('href');var maskHeight=jQuery(document).height();var maskWidth=jQuery(window).width();jQuery('#mask').css({'width':maskWidth,'height':maskHeight});jQuery('#mask').fadeIn(1000);jQuery('#mask').fadeTo("slow",0.8);var winH=jQuery(window).height();var winW=jQuery(window).width();jQuery(id).css('top',winH/2-jQuery(id).height()/2);jQuery(id).css('left',winW/2-jQuery(id).width()/2);jQuery(id).fadeIn(2000);});jQuery('.window .close').click(function(e){e.preventDefault();jQuery('#mask').hide();jQuery('.window').hide();});jQuery('#mask').click(function(){jQuery(this).hide();jQuery('.window').hide();});}
function showEmailUpdate(){var position=jQuery("#header_login_link").position();var position1=jQuery("#menu").position();var s=(position.left+position1.left)+'px';document.getElementById('email_update_outer').style.left=s;if(jQuery("#email_update_outer").is(":hidden")){jQuery('#email_update_outer').slideDown('slow');}}
function closeEmailUpdate(){jQuery('#email_update_outer').slideUp('slow');}
function removeFacebookStyles(){jQuery(".FBConnectButton_Simple").removeClass("FBConnectButton_Simple");jQuery(".FBConnectButton_Text_Simple").addClass("whiteText");jQuery(".FBConnectButton_Text_Simple").removeClass("FBConnectButton_Text_Simple");}
function modify_facebook_share(id,imgSrc,title){var link=document.getElementById(id);link.href="http://www.facebook.com/sharer.php?u="+imgSrc+"&t="+title;var outerspan=jQuery("#"+id+".FBConnectButton_Simple");var innerspan=jQuery("#"+id+".FBConnectButton_Text_Simple");jQuery(".FBConnectButton_Simple").removeClass("FBConnectButton_Simple");jQuery(".FBConnectButton_Text_Simple").addClass("whiteText");jQuery(".FBConnectButton_Text_Simple").removeClass("FBConnectButton_Text_Simple");}
function twitterShare(status){window.open('http://twitter.com/home?status='+status,'','width=800,height=600,scrollbars=1');}
function myspaceVideoShare(title,video_code,video_url){window.open('http://www.myspace.com/Modules/PostTo/Pages/?t='+title+'&c='+video_url,'','width=800,height=600,scrollbars=1');}
function myspacePhotoShare(title,photo_url){window.open('http://www.myspace.com/Modules/PostTo/Pages/?t='+title+'&c='+photo_url,'','width=800,height=600,scrollbars=1');}
function facebookPhotoShare(title,url){window.open('http://www.facebook.com/sharer.php?u='+url+'&t='+title,'','width=800,height=600,scrollbars=1');}
function twitterShareBlog(url,contentid){var status=jQuery('#'+contentid).val();window.open('http://twitter.com/home?status='+status+' view full article at: '+url,'','width=800,height=600,scrollbars=1');}
function myspaceShareBlog(title,url,contentid){var content=jQuery('#'+contentid).val();window.open('http://www.myspace.com/Modules/PostTo/Pages/?t='+title+'&u='+url+'&c='+content+' view full article at: '+url,'','width=800,height=600,scrollbars=1');}
function facebookShareBlog(title,url,contentid){var content=jQuery('#'+contentid).val();window.open('http://www.facebook.com/sharer.php?t='+title+'&u='+url,'','width=800,height=600,scrollbars=1');}
var css_browser_selector=function(){var ua=navigator.userAgent.toLowerCase(),is=function(t){return ua.indexOf(t)!=-1;},h=document.getElementsByTagName('html')[0],b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('gecko/')?'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';var c=b+os+' js';h.className+=h.className?' '+c:c;}();function showRegistrationOption(pagetype,siturl){if(pagetype==1){jQuery('#login_outer').hide();jQuery('#firstname').focus();}else{window.location.href=siturl+'register.php';}}
function createCookieProfile(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function getCookie(cookie_name){var results=document.cookie.match('(^|;) ?'+cookie_name+'=([^;]*)(;|$)');if(results)
return(unescape(results[2]));else
return null;}
function gotomyprofile(url){createCookieProfile('redirectCookieFbconnect',"",-1);window.location.href=url;}
function addFriend(friend_id,siteurl){url=siteurl+'ajax/addFriend.php?friend_id='+friend_id;jQuery.get(url,function(data){if(data==0){showNotification('Error in adding friend');return;}else{if(data.indexOf("login")>0){showNotification('Please login to continue');showLogin(1);}else{jQuery('#addfriend_div').html(data);}}});}
function showNewStuff(){jQuery("#new-stuff").show();if(jQuery("#updates-div").attr("display")!="none"){jQuery("#updates-div").hide();}}
function showUpdates(){jQuery("#updates-div").show();getUpdates();if(jQuery("#new-stuff").attr("display")!="none"){jQuery("#new-stuff").hide();}}
function getUpdates(){var siteURL='<?php echo SITEURL ?>';jQuery('#res_tst').html('<br /><img src="'+siteurl+'images/ajax-loader-small.gif" /><br /><br />');jQuery(document).ready(function(){url=siteurl+'ajax/printUpdates.php';jQuery.get(url,function(data){var res_str=data.split("~")
jQuery("#res_tst").html(res_str[0]);if(parseInt(res_str[1])>0){jQuery("#update_count").html(res_str[1]);jQuery(".updates-point").show();}else{jQuery(".updates-point").hide();}});});}
function closeUpdateDiv(){jQuery('#updates-div').hide();}
function jsNavigation(stat){var f_count=Number($('#f_current').val());var f_count_next=Number(f_count)+1;var f_count_prev=Number(f_count)-1;if(stat=="next"){jQuery('.'+f_count).hide();jQuery('.'+f_count_next).show();$('#f_current').val(f_count_next);}else if(stat=="prev"){jQuery('.'+f_count).hide();jQuery('.'+f_count_prev).show();$('#f_current').val(f_count_prev);}
var f_count=Number($('#f_current').val());if(f_count==Number($('#f_max').val())){$('#f_nav_next').hide();}else{$('#f_nav_next').show();}
if(Number(f_count)==1){$('#f_nav_prev').hide();}else{$('#f_nav_prev').show();}}
function jsNavigationBand(stat){var b_count=Number($('#b_current').val());var b_count_next=Number(b_count)+1;var b_count_prev=Number(b_count)-1;if(stat=="next"){jQuery('.b_'+b_count).hide();jQuery('.b_'+b_count_next).show();$('#b_current').val(b_count_next);}else if(stat=="prev"){jQuery('.b_'+b_count).hide();jQuery('.b_'+b_count_prev).show();$('#b_current').val(b_count_prev);}
var b_count=Number($('#b_current').val());if(b_count==Number($('#b_max').val())){$('#b_nav_next').hide();}else{$('#b_nav_next').show();}
if(Number(b_count)==1){$('#b_nav_prev').hide();}else{$('#b_nav_prev').show();}}
function jsNavigationCloth(stat){var c_count=Number($('#c_current').val());var c_count_next=Number(c_count)+1;var c_count_prev=Number(c_count)-1;if(stat=="next"){jQuery('.c_'+c_count).hide();jQuery('.c_'+c_count_next).show();$('#c_current').val(c_count_next);}else if(stat=="prev"){jQuery('.c_'+c_count).hide();jQuery('.c_'+c_count_prev).show();$('#c_current').val(c_count_prev);}
var c_count=Number($('#c_current').val());if(c_count==Number($('#c_max').val())){$('#c_nav_next').hide();}else{$('#c_nav_next').show();}
if(Number(c_count)==1){$('#c_nav_prev').hide();}else{$('#c_nav_prev').show();}}
function getNewStuff(page){url=siteurl+'ajax/getlatestStuff.php?page='+page;jQuery(".product_container").html('<img class="loadingimg" src="./images/ajax-loader-small.gif" alt="Item is loading.." />');jQuery.get(url,function(data){jQuery("#new-stuff").html(data);});}
function closeNewStuffDiv(){jQuery('#new-stuff').hide();getNewStuff(0);}
function fbconnect_btnclick(){url=siteurl+'ajax/confirmFacebookConnectLoginAttempt.php';jQuery.get(url,function(data){window.location.reload();});}
function clearUpdatePopup(){jQuery(document).ready(function(){url=siteurl+'ajax/clearUpdates.php';jQuery.get(url,function(data){});});getUpdates();}
function changeSearchTextColor(textColor){jQuery("#search_text").css({color:'#'+textColor});}
function updateFaves(){$.ajax({type:"GET",url:siteurl+"ajax/LoadFaves.php",data:"not_used=1",success:function(msg){if(msg==''){showSuccessMsg('Error');}else{$('#faves').html(msg);}}});}
function deleteFromMyFavorites(id){if(!confirm("Are you sure to remove this band from your favorite?")){return;}
$.ajax({type:"GET",url:siteurl+"ajax/removefavoriteband.php",data:"band_id="+id,success:function(msg){if(msg==1){jQuery("#userBand"+id).hide();favcount=parseInt(jQuery("#favcount").html());favcount=favcount-1;jQuery("#favcount").html(favcount+'');updateFaves();showSuccessMsg('The band has been removed from your favorite.');}else{showNotification('Error in removing the band from your favorites');}}});}
function deleteFromMyFavoritesCompany(id){if(!confirm("Are you sure to remove this company from your favorite?")){return;}
url='ajax/removefavoritecompany.php?cloth_id='+id;jQuery.get(url,function(data){if(data==1){jQuery("#userBand"+id).remove();favcount=parseInt(jQuery("#favcount").html());favcount=favcount-1;jQuery("#favcount").html(favcount+'');showSuccessMsg('The company has been removed from your favorite.');return;}else{showNotification('Error in removing company from your favorites');}});}
function closeTellFriendsDiv(){jQuery("#tellfriends-div").hide();}
function showTellYourFriends(){var newstuff_left=jQuery('#li_newstuff').offset().left;var newstuff_top=jQuery('#li_newstuff').offset().top;jQuery("#tellfriends-div").css({left:parseInt(newstuff_left-50)+"px",top:parseInt(newstuff_top+150)+"px"});jQuery("#tellfriends-div").show();}
function tellYourFriends(){if(jQuery('#quickUpdateTextFriends').val().trim()==''){showNotification('Enter message');return false;}
closeTellFriendsDiv();showSuccessMsg('Message posted on your favorite sites.');var options={dataType:'json',success:function(data){}};jQuery('#form-post-review-networks').ajaxSubmit(options);}
function clearAllNewStuff(){url=siteurl+'ajax/getlatestStuff.php?clearall=true';jQuery(".product_container").html('<img class="loadingimg" src="./images/ajax-loader-small.gif" alt="clearing all your new stuff.." />');jQuery.get(url,function(data){jQuery("#new-stuff").html(data);jQuery("#newstuffcount-span").parent().hide();showSuccessMsg('All of your new stuff has been removed.');});}
function Show_Popup(action,userid){var hpos=(jQuery(window).height()/2)-(400/2);var wpos=(jQuery(window).width()/2)-(632/2);var popupNavHeight=jQuery('#contentPage').height()+jQuery('#header').height()+jQuery('#footer').height();jQuery('#popupNav').css({'opacity':'0.75','height':popupNavHeight}).fadeIn('slow');jQuery('#windowNav').css('top',hpos+'px').css('left',wpos+"px").fadeIn('fast');}
function Close_Popup(){jQuery('#popupNav').fadeOut('fast');jQuery('#windowNav').fadeOut('fast');}
jQuery(document).ready(function(){jQuery('#icon_nav').hover(function(){jQuery('#windowNav .close').fadeOut('fast')},function(){jQuery('#windowNav .close').fadeIn('fast')});});;function autohide(id){$(".autohide").not(id).fadeOut();};dirname="";selected="";function loadProfileContent(url,obj){if(obj){jQuery(".selected").removeClass("selected");jQuery(obj).addClass("selected");}
createCookie("opTab"+dirname,jQuery(obj).attr('title'));if(dirname&&jQuery(obj).attr('title')){createCookie("redirectCookieFbconnect",account_type+'/'+dirname+'/'+jQuery(obj).attr('title'));}
jQuery('.content1').html('<center><img class="loadingimg" src="'+siteurl+'images/ajax-loader.gif" alt="News is loading.." /></center>');jQuery.get(url,function(data){jQuery('.content1').html(data);jQuery(".autoUpdate > .updateControl").click(function(){updateId=jQuery(this).parent().attr("id").slice(10);if(confirm("Are you sure to remove the update?")){jQuery(this).html('<img height="16" width="16" class="smallIcon deleteAutoUpdateButton" id="loading" alt="Delete" src="'+siteurl+'images/upload_progress.gif"/>');clickbutton=jQuery(this);jQuery.get(url+"&update_id="+updateId,function(data){clickbutton.parents(".updateContent").fadeOut("slow");});}
return false;});});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");jQuery('.content1').html('');});if(selected=="shop"){return true;}else{return false;}}
function postCommentMulti(photoID,userID,browser_userID,fbID,fbName,fbImage){if(jQuery('#comment_'+photoID).val()==''){jQuery('#errorMessage_'+photoID).html("Please enter your comment.");return;}
jQuery('#loadingcommnets_'+photoID).html('<img src="'+siteurl+'images/upload_progress.gif" alt="Posting comments.." />').show();var url=siteurl+'ajax/profile/photos.php?action=postcomment&browser_user_id='+browser_userID+'&user_id='+userID+'&photo_id='+photoID+'&fbuser_id='+fbID+'&comment='+jQuery('#comment_'+photoID).val();jQuery('#errorMessage_'+photoID).html('');jQuery.get(url,function(data){jQuery('#loadingcommnets_'+photoID).html('').hide();if(data==0){jQuery('#errorMessage_'+photoID).html('Please login to post your comment.');}else{jQuery('.content1').html(data);s_update_sizes();var id='#pc_'+photoID;tog(id);goToByScroll(id);console.log(data);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function postComment(){if(jQuery('#commenttext').val()==''){jQuery('.errorMessage').html("Please enter your comment.");return;}
jQuery('.loadingcommnets').html('<img src="'+siteurl+'images/upload_progress.gif" alt="Posting comments.." />').show();url=siteurl+'ajax/profile/photos.php?action=postcomment&user_id='+jQuery('#user_id').val()+'&photo_id='+jQuery('#photo_id').val()+'&fbuser_id='+jQuery('#fbuser_id').val()+'&comment='+jQuery('#commenttext').val();jQuery('.errorMessage').html('');jQuery.get(url,function(data){jQuery('.loadingcommnets').html('').hide();if(data==0){jQuery('.errorMessage').html('Please login to post your comment.');}else{jQuery('.content1').html(data);console.log(data);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function postUserComment(){if(jQuery('#commenttext').val()==''){jQuery('.errorMessage').html("Please enter your comment.");return;}
jQuery('.loadingcommnets').html('<img src="'+siteurl+'images/upload_progress.gif" alt="Posting comments.." />').show();url=siteurl+'ajax/profile/comments.php?action=postcomment&comment_type='+jQuery('#comment_type').val()+'&postee_id='+jQuery('#postee_id').val()+'&comment='+jQuery('#commenttext').val();jQuery('.errorMessage').html('');jQuery.get(url,function(data){jQuery('.loadingcommnets').html('').hide();if(data==0){jQuery('.errorMessage').html('Please login to post your comment.');}else{jQuery('#comments-update').offset().top
jQuery('html,body').animate({scrollTop:jQuery('#comments-update').offset().top},1000);jQuery('#commenttext').attr("value","");jQuery('#comments-update').html(data);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function deleteComment(userid,commentid){if(confirm('Are you sure you wish to delete this? \nThis cannot be undone!!')){url=siteurl+'ajax/profile/comments.php?action=deletecomment&userid='+userid+'&commentid='+commentid;jQuery.get(url,function(data){if(data==0){jQuery('.errorMessage').html('Please login to delete your comment.');}else{jQuery('#comments-update').html(data);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}}
function leaveUpdateComment(update,userid){updateId=jQuery(update).parent().next('.updateId').val();url=siteurl+'ajax/profile/updates.php?action=comments&updateId='+updateId+'&userid='+userid;jQuery('.content1').html('<center><img class="loadingimg" src="'+siteurl+'images/ajax-loader.gif" alt="News is loading.." /></center>');jQuery.get(url,function(data){jQuery('.content1').html(data);jQuery('html,body').animate({scrollTop:jQuery('.leavecomment_container').offset().top},1000);});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");jQuery('.content1').html('');});}
function postUpdatesComment(){if(jQuery('#commenttext').val()==''){jQuery('.errorMessage').html("Please enter your comment.");return;}
jQuery('.loadingcommnets').html('<img src="'+siteurl+'images/upload_progress.gif" alt="Posting comments.." />').show();url=siteurl+'ajax/profile/updates.php?action=postcomment&updateId='+
jQuery('#update_id').val()+'&userid='+jQuery('#user_id').val()+'&comment='+jQuery('#commenttext').val();;jQuery('.errorMessage').html('');jQuery.get(url,function(data){jQuery('.loadingcommnets').html('').hide();if(data==0){jQuery('.errorMessage').html('Please login to post your comment.');}else{jQuery('#comments-update').offset().top
jQuery('html,body').animate({scrollTop:jQuery('#comments-update').offset().top},500);jQuery('#commenttext').attr("value","");jQuery('#comments-update').html(data);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");jQuery('.loadingcommnets').html('');});}
function viewUpdateCommentDirectAccess(updateId,userid){url=siteurl+'ajax/profile/updates.php?action=comments&updateId='+updateId+'&userid='+userid;jQuery('.content1').html('<center><img class="loadingimg" src="'+siteurl+'images/ajax-loader.gif" alt="News is loading.." /></center>');jQuery.get(url,function(data){jQuery('.content1').html(data);});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");jQuery('.content1').html('');});}
function viewUpdateComment(update,userid){updateId=jQuery(update).parent().prev('.updateId').val();url=siteurl+'ajax/profile/updates.php?action=comments&updateId='+updateId+'&userid='+userid;jQuery('.content1').html('<center><img class="loadingimg" src="'+siteurl+'images/ajax-loader.gif" alt="News is loading.." /></center>');jQuery.get(url,function(data){jQuery('.content1').html(data);});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");jQuery('.content1').html('');});}
function deleteUpdateComment(userid,commentid){if(confirm('Are you sure you wish to delete this? \nThis cannot be undone!!')){url=siteurl+'ajax/profile/updates.php?action=deletecomment&userid='+userid+'&commentid='+commentid+'&updateId='+jQuery('#update_id').val();jQuery.get(url,function(data){if(data==0){jQuery('.errorMessage').html('Please login to delete your comment.');}else{jQuery('#comments-update').html(data);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}}
function showLoadingInBlock(block){block.append('<img class="blockloading" src="../../images/tordateloader.gif" alt="loading.." />');block.css("opacity",'0.7');}
function hideLoadingInBlock(block){block.find('.blockloading').hide();block.css("opacity",'1');}
function requestASong(tourid,button){showDiv=jQuery(button).parents(".shows_container").next('.requested_songs');if(showDiv.is(':visible')){showDiv.slideUp();return;}
bandid=jQuery("#bandId").val();url=siteurl+'ajax/profile/requestasong.php?tour_id='+tourid+'&band_id='+bandid;jQuery(".requested_songs:visible").slideUp('fast');jQuery.get(url,function(data){jQuery('.rightbtns > .active').removeClass('active');jQuery(button).addClass('active');showDiv.html(data).slideDown();});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function submitSongs(button){var $fields=jQuery(button).parents(".requested_songs").find('input[type="checkbox"]:checked');if(!$fields.length&&!jQuery(button).hasClass("update")){showNotification('You must select at least one song!');return false;}
showLoadingInBlock(jQuery(".requested_songs:visible"));url=siteurl+'ajax/profile/requestasong.php?action=requestasong';jQuery.post(url,jQuery("#songform").serialize(),function(data){hideLoadingInBlock(jQuery(".requested_songs:visible"));if(data==0){showNotification('Please login to request songs.');}else{jQuery(button).parents(".requested_songs").html(data).slideDown();}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function editRequestedSongs(button,tourid){showLoadingInBlock(jQuery(".requested_songs:visible"));url=siteurl+'ajax/profile/requestasong.php?action=editsong&tourdate_id='+tourid;jQuery.get(url,function(data){hideLoadingInBlock(jQuery(".requested_songs:visible"));if(data==0){showNotification('Please login to request songs.');}else{jQuery(button).parents(".requested_songs").html(data).slideDown();}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function goingToThisShow(tourid,button){jQuery.get(url,function(data){if(data==0){showNotification('Please login to attend this show.');}else{jQuery(button).html("you are attending");jQuery(button).removeClass('active');}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function toggleGoingShow(tourid,button){if(jQuery(button).hasClass("active")){url=siteurl+'ajax/profile/addattendingshow.php?action=remove&tourdate_id='+tourid;}else{url=siteurl+'ajax/profile/addattendingshow.php?tourdate_id='+tourid;}
jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);}else{if(jQuery(button).hasClass("active")){jQuery(button).html("going to this show?");jQuery(button).removeClass('active');}else{jQuery(button).html("attending (remove)");jQuery(button).addClass('active');}}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function readAndReview(tourid,button){url=siteurl+'ajax/profile/readandreview.php?tour_id='+tourid;showDiv=jQuery(button).parents(".shows_container").next('.gray-container-wrap');if(showDiv.is(':visible')){showDiv.slideUp();return;}
jQuery(".gray-container-wrap:visible").slideUp('fast');jQuery.get(url,function(data){jQuery('.rightbtns > .active').removeClass('active');jQuery(button).addClass('active');showDiv.html(data).slideDown();if(document.getElementById("tourdate_id_direct").value!=""){document.getElementById("readreview_"+document.getElementById("tourdate_id_direct").value).focus();document.getElementById("tourdate_id_direct").value='';}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function postReview(tourid,botton){comment=jQuery(".gray-container-wrap:visible").find(".review-text").val();rating=jQuery(".gray-container-wrap:visible").find(".rating-value").val();if(comment==""&&!rating){showNotification('Please add any review or rate this show');return false;}
showLoadingInBlock(jQuery(".gray-container-wrap:visible"));url=siteurl+'ajax/profile/readandreview.php?action=postreview&tour_id='+tourid+'&review='+comment+'&rating='+rating;jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));return;}
jQuery(".gray-container-wrap:visible").html(data).slideDown();hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));showConfirmAddreview(tourid,rating);});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));});}
function updateReview(button){jQuery(button).hide();jQuery(button).next().show();jQuery(button).next().next().hide();jQuery(".gray-container-wrap:visible").find(".noneditstar").hide();jQuery(".gray-container-wrap:visible").find(".editstar").show();jQuery(".gray-container-wrap:visible").find(".query-reviewed").hide();jQuery(".gray-container-wrap:visible").find(".editBox").show();}
function postUpdateReview(tourid,reviewid,button){comment=jQuery(".gray-container-wrap:visible").find(".review-text").val();rating=jQuery(".gray-container-wrap:visible").find(".rating-value").val();if(comment==""&&!rating){showNotification('Please add any review or rate this show');return false;}
url=siteurl+'ajax/profile/readandreview.php?action=editreview&tour_id='+tourid+'&review='+comment+'&reviewid='+reviewid+'&rating='+rating;showLoadingInBlock(jQuery(".gray-container-wrap:visible"));jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));return;}
jQuery(".gray-container-wrap:visible").html(data).slideDown();hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));showConfirmAddreview(tourid,rating);});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));});}
function deleteReview(tourid,reviewid,button){if(confirm("Are you sure to delete your review on this show ?")){showLoadingInBlock(jQuery(".gray-container-wrap:visible"));url=siteurl+'ajax/profile/readandreview.php?action=deletereview&tour_id='+tourid+'&reviewid='+reviewid;jQuery.get(url,function(data){jQuery(".gray-container-wrap:visible").html(data).slideDown();hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));jQuery('#pastshowbutton').trigger('click');});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");hideLoadingInBlock(jQuery(".gray-container-wrap:visible"));});}}
function rateThis(button){rating=1;jQuery(button).parent().children("a").each(function(){if(parseInt(jQuery(button).attr("title"))>=rating){jQuery(this).removeClass("notrated").addClass("rated");}else{if(!jQuery(this).hasClass('cancelrating')){jQuery(this).removeClass("rated").addClass("notrated");}}
jQuery(".gray-container-wrap:visible").find(".rating-value").val(jQuery(button).attr("title"));rating++;});}
function cancelRating(button){jQuery(button).parent().children("a").each(function(){if(!jQuery(this).hasClass('cancelrating')){jQuery(this).removeClass("rated").addClass("notrated");}});}
function loadVenueContent(url){jQuery('#showlist').html('<img class="loadingimg" src="'+siteurl+'images/ajax-loader.gif" alt="loading.." />');jQuery.get(url,function(data){jQuery('#showlist').html(data);if(document.getElementById("tourdate_id_direct").value!=""){readAndReview(document.getElementById("tourdate_id_direct").value,document.getElementById("readreview_"+document.getElementById("tourdate_id_direct").value));}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");jQuery('#showlist').html('');});}
function loadMap(address){var map=new GMap2(document.getElementById("drawmap"));map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());if(geocoder){geocoder.getLatLng(address,function(point){if(!point){showNotification(address+" not found");}else{map.clearOverlays()
map.setCenter(point,14);var marker=new GMarker(point,{draggable:true});map.addOverlay(marker);}});}}
function drawMap(){GUnload();geocoder=new GClientGeocoder();geocoder.getLatLng(jQuery("#startAddress").val(),function(Point){if(!Point){showNotification("Starting point not found");return false;}else{starPoint=Point;}});geocoder=new GClientGeocoder();geocoder.getLatLng(jQuery("#destinationAdress").val(),function(Point){if(!Point){showNotification("Destination not found");return false;}else{endPoint=Point;}});var lat1=starPoint.lat(),lon1=starPoint.lng();var lat2=endPoint.lat(),lon2=endPoint.lng();var d=Math.acos(Math.sin(lat1.toRad())*Math.sin(lat2.toRad())+
Math.cos(lat1.toRad())*Math.cos(lat2.toRad())*Math.cos(lon2.toRad()-lon1.toRad()))*6371;var map=new GMap2(document.getElementById("drawmap"));map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());if(isNaN(lat1)||isNaN(lon1)||isNaN(lat2)||isNaN(lon2)){map.setCenter(new GLatLng(51.477,0.000),15);jQuery('#coords').html('No co-ordinates given');return false;}
var pt1=new GLatLng(lat1,lon1);var pt2=new GLatLng(lat2,lon2);var route=new GPolyline([pt1,pt2],'#ff0000',4,0.5,{geodesic:true});var bounds=route.getBounds();map.setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds),G_HYBRID_MAP);var lbl1=lat1.toFixed(4)+'�,'+lon1.toFixed(4)+'�';var lbl2=lat2.toFixed(4)+'�,'+lon2.toFixed(4)+'�';map.addOverlay(route);var mk1=new GMarker(pt1,{title:lbl1});GEvent.addListener(mk1,'click',function(){mk1.openInfoWindowHtml('P1: '+lbl1);});map.addOverlay(mk1);var mk2=new GMarker(pt2,{title:lbl2});GEvent.addListener(mk2,'click',function(){mk2.openInfoWindowHtml('P2: '+lbl2);});map.addOverlay(mk2);}
var map;var gdir;var geocoder=null;var addressMarker;function initializeGdirections(){fromAddress=jQuery("#startAddress").val();toAddress=jQuery("#destinationAdress").val();locale='en_US';if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("drawmap"));gdir=new GDirections(map,document.getElementById("directions"));GEvent.addListener(gdir,"load",onGDirectionsLoad);GEvent.addListener(gdir,"error",handleErrors);map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());if(geocoder){geocoder.getLatLng(toAddress,function(point){if(!point){showNotification(address+" not found");}else{map.clearOverlays();map.setCenter(point,14);var marker=new GMarker(point,{draggable:true});map.addOverlay(marker);}});}}}
function onGDirectionsLoad(){jQuery("#directions").slideDown('slow');jQuery("#hide_directions").show();}
function handleErrors(){if(gdir.getStatus().code==G_GEO_UNKNOWN_ADDRESS){showNotification("Directions are not available");}
else if(gdir.getStatus().code==G_GEO_SERVER_ERROR){showNotification("Directions are not available");}
else if(gdir.getStatus().code==G_GEO_MISSING_QUERY){showNotification("Directions are not available");}
else if(gdir.getStatus().code==G_GEO_BAD_KEY){showNotification("Directions are not available");}
else if(gdir.getStatus().code==G_GEO_BAD_REQUEST){showNotification("Directions are not available");}
else if(gdir.getStatus().code==604){showNotification("Directions are not available");}
else{showNotification("An unknown error occurred.");}
hide_directions();document.getElementById("drawmap").innerHTML='';loadMap(jQuery("#destinationAdress").val());initializeGdirections();}
function drawMapDirection(){fromAddress=jQuery("#startAddress").val();toAddress=jQuery("#destinationAdress").val();locale='en_US';geocoder=new GClientGeocoder();geocoder.getLatLng(jQuery("#startAddress").val(),function(Point){if(!Point){showNotification("Starting point not found");return false;}else{starPoint=Point;}});geocoder=new GClientGeocoder();geocoder.getLatLng(jQuery("#destinationAdress").val(),function(Point){if(!Point){showNotification("Destination not found");return false;}else{endPoint=Point;}});gdir.load("from: "+fromAddress+" to: "+toAddress,{"locale":locale});}
function hide_directions(){jQuery("#directions").slideUp('slow');jQuery("#hide_directions").hide();}
Number.prototype.toRad=function(){return this*Math.PI/180;}
Number.prototype.toDeg=function(){return this*180/Math.PI;}
function becomeAFanBand(bandId){url=siteurl+'ajax/profile/becomeafan.php?band_id='+bandId;jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);return false;}else{$("#fan_btn").hide();$("#fan_msg").html(message[1]);}});}
function becomeAFanCloth(clothId){url=siteurl+'ajax/profile/becomeafanClothing.php?cloth_id='+clothId;jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);return;}else{$("#fan_btn").hide();$("#fan_msg").html(message[1]);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function becomeFanfromLandingPage(bandId){url=siteurl+'ajax/profile/becomeafan.php?band_id='+bandId;jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);return;}else{showSuccessMsg(message[1]);}});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
function open_attendee_list(tourid){document.getElementById('whoisattending'+tourid).style.display='block';}
function close_attendee_list(tourid){document.getElementById('whoisattending'+tourid).style.display='none';}
function sendReport(obj,comment_type,profile_user_id,id,photo_comment_id){var url='';if(comment_type=='photo_comment'){url=siteurl+'ajax/sendReport.php?comment_type='+comment_type+'&profile_user_id='+profile_user_id+'&photo_id='+id+'&photo_comment_id='+photo_comment_id;}else if(comment_type=='quick_update_comment'){url=siteurl+'ajax/sendReport.php?comment_type='+comment_type+'&profile_user_id='+profile_user_id+'&quick_update_id='+id;}
jQuery.get(url,function(data){obj.style.display='none';});jQuery('#notificationBar').ajaxError(function(){showNotification("Grrr! bompa is not available at the moment. Please try again later.");});}
function twitterShareVenue(tourid,desc,title){var url=jQuery("#venue_link_hid").val()+tourid;window.open('http://twitter.com/home?status='+title+' review at: '+url,'','width=800,height=600,scrollbars=1');}
function myspaceShareVenue(tourid,desc,title){var url=jQuery("#venue_link_hid").val()+tourid;window.open('http://www.myspace.com/Modules/PostTo/Pages/?t='+title+'&u='+url+'&c=review at: '+url,'','width=800,height=600,scrollbars=1');}
function facebookShareVenue(tourid,desc,title){var url=jQuery("#venue_link_hid").val()+tourid;window.open('http://www.facebook.com/sharer.php?t='+title+'&u='+url,'','width=800,height=600,scrollbars=1');}
function addShareImageCode(photo_id){photo_id=photo_id*99;photo_id=photo_id.toString(16).toUpperCase();jQuery("#commentForm").show();jQuery('#shareImageCode').val('<div id="mySharedPhoto"><scrip'+'t type="text/javascript" '+'src="'+siteurl+'include/js/shareImage.js"></scrip'+'t><scrip'+'t type="text/javascript" >'+'width = 300; height = 300;  getMysharedImage("'+photo_id+'",width,height); </scrip'+'t></div>');}
function selectCode(replaceTextArea){replaceTextArea.select();}
function postAddFanStream(){closeConfirmPostFanDiv();showSuccessMsg('posted the activity on your favorite sites.');var profile_name=jQuery("#post-stream-profile-name").val();var profile_type=jQuery("#post-stream-profile-type").val();var profile_userid=jQuery("#post-stream-profile-id").val();url=siteurl+'ajax/profile/postAddFanStream.php?profile_name='+profile_name+'&profile_type='+profile_type+'&profile_userid='+profile_userid;jQuery.get(url,function(data){});jQuery('#notificationBar').ajaxError(function(){});}
function closeConfirmPostFanDiv(){jQuery("#confirm-postfan-div").hide();}
function closepostReview(){jQuery("#confirm-addreview-div").hide();}
function showConfirmAddreview(tourid,rating){if(rating>0){jQuery("#rated_value").val(rating);}else{jQuery("#rated_value").val(0);}
jQuery("#post-review-tourdateid").val(tourid);var twitter_left=jQuery('#twitter'+tourid).offset().left;var twitter_top=jQuery('#twitter'+tourid).offset().top;jQuery("#confirm-addreview-div").css({left:parseInt(twitter_left-50)+"px",top:parseInt(twitter_top-100)+"px"});jQuery("#confirm-addreview-div").show();}
function postVenueReview(){closepostReview();showSuccessMsg('posted the activity on your favorite sites.');var options={dataType:'json',success:function(data){},failure:function(){}};jQuery('#form-post-review-networks').ajaxSubmit(options);if(jQuery("#rated_value").val()>0){jQuery('#pastshowbutton').trigger('click');}}
function print_directions(){window.open(siteurl+'map_directions.php?address='+jQuery("#destinationAdress").val()+'&startAddress='+jQuery("#startAddress").val(),"","width=740,scrollbars=yes");}
function checkUrlForAnchor(url){var myFile=url;if(myFile.match('#')){var myAnchor=''+myFile.split('#')[1];if(isUrl(myAnchor)){return myAnchor;}}}
function loadContent(url){console.log(url);jQuery.ajax({url:url,dataType:'json',success:function(data){if(data.html){jQuery('#content_main').html(data.html);}}});}
function show_more_photos(offset,limit,profile_id){$('#load_more').show('slow');$('#show_more_photos_'+offset).hide();$.ajax({type:"POST",url:siteurl+'ajax/LoadPhotos.php',data:"offset="+offset+"&limit="+limit+"&profile_id="+profile_id,success:function(data){$('.content1').append(data);s_update_sizes();$('#load_more').hide('slow');},complete:function(){s_update_sizes();}});}
function launch_iframe(url,size){if(!size){size=620;}
var if_height,src=url+'#'+encodeURIComponent(document.location.href),iframe=$('<iframe " src="'+src+'" width="'+size+'" height="1000" scrolling="no" frameborder="0"><\/iframe>').appendTo('#iframe');jQuery.receiveMessage(function(e){if(e.data.indexOf('reset_scroll')>=0){window.scrollTo(0,0);}
var h=Number(e.data.replace(/.*if_height=(\d+)(?:&|$)/,'$1'))+340;if(typeof h=='number'){if(!isNaN(h)&&h>0&&h!==if_height){iframe.height(if_height=h);}}});}
function scroll2topWindow()
{window.scrollTo(0,0);};jQuery(document).ready(function(){if(typeof processingHide=='function'){function processingHide(){};}
jQuery('#password-clear').show();jQuery('#login_password').hide();jQuery('#login_username').focus(function(){jQuery('#password-clear').hide();jQuery('#login_password').show();});jQuery('#password-clear').focus(function(){jQuery('#password-clear').hide();jQuery('#login_password').show();jQuery('#login_password').focus();});jQuery('#login_password').blur(function(){if(jQuery('#login_password').val()==''){jQuery('#password-clear').show();jQuery('#login_password').hide();}});})
function showLoginDetail(dir){if(!dir){jQuery('#login_detail').slideDown();}else{jQuery('#login_detail').slideUp();}}
function doLoginKeyPressEnter(e,url){var unicode=e.keyCode?e.keyCode:e.charCode
if(unicode==13){validateLogin(url);}}
function login(random){var data=jQuery('#login_form'+random).serialize(true);var url=siteurl+'ajax/login.php';if(typeof processingShow=='function'){processingShow('logging in');}
jQuery.ajax({type:"POST",url:url,data:data,success:function(response){if(typeof processingHide=='function'){processingHide();}
if(response.action){eval(response.action);}},complete:function(){if(typeof processingHide=='function'){processingHide();}
jQuery('#store_ajax_status').hide();}});}
function loginCrossDomain(random){var data=jQuery('#login_form'+random).serialize(true);var url=siteurl+'ajax/login.php';if(typeof processingShow=='function'){processingShow('logging in');}
jQuery.ajax({url:url,data:data,dataType:'jsonp',jsonp:'callback',success:function(response){if(typeof processingHide=='function'){processingHide();}
if(response.action){eval(response.action);}
if(response.msg){eval(response.action);}},complete:function(){if(typeof processingHide=='function'){processingHide();}
jQuery('#store_ajax_status').hide();}});}
function validateLogin(random){var data=jQuery('#login_form_'+random).serialize(true);var email_add=trim(jQuery('#login_username').val());jQuery('#login_username').val(email_add);if(jQuery('#login_username').val()!=""&&jQuery('#login_password').val()!=""&&isValidEmailAddress(jQuery('#login_username').val())){doAjaxLogin(jQuery('#login_username').val(),jQuery('#login_password').val(),0,jQuery('#dest').val());}else{showNotification("Wrong Email and password combination.");return false;}}
function doAjaxLogout(username,dest){jQuery.ajax({type:'POST',url:siteurl+'ajax/submitLogout.php',data:{username:username,dest:dest},success:function(xml){if(xml=='failure'){showNotification("Invalid Email and password combination.");return false;}else{window.location=xml;}},error:function(data){showNotification("Grrr! bompa is not available at the moment. Please try again later.");jQuery('#login_ajx_div').html('');}});};function searchTextBoxOnBlur(){if(document.getElementById('search_text').value==''){}
jQuery('#search_text').css({color:'#999999'});}
function enterButton(url){jQuery('#search_text').bind('keypress',function(e){if(e.keyCode==13){submitForm(url);}
jQuery('#search_text').css({color:'#000000'});});}
function submitForm(url){var type=jQuery('#selected_item').val();var text=jQuery('#search_text').val();window.location=url+'search/'+text+'/';}
function hide_block(){document.getElementById('list_box').style.display="none";}
function show_image(){document.getElementById("cloth_list").style.background='url(../../images/bg_dropdown_hover.png)';}
function hide_image(){if(document.getElementById("cloth_list").className=="active")
document.getElementById("cloth_list").style.background='url(../../images/bg_dropdown_hover.png)';else
document.getElementById("cloth_list").style.background="";}
function getPosition(obj){var topValue=0,leftValue=0;while(obj){leftValue+=obj.offsetLeft;topValue+=obj.offsetTop;obj=obj.offsetParent;}
finalvalue=leftValue+","+topValue;return finalvalue;}
jQuery.fn.center=function(){this.css("position","absolute");this.css("top",($(window).height()-this.height())/2
+$(window).scrollTop()+"px");this.css("left",($(window).width()-this.width())/2
+$(window).scrollLeft()+"px");return this;}
function becomeAFanBand(bandId){url=siteurl+'ajax/profile/becomeafan.php?band_id='+bandId;jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);return;}else{showSuccessMsg('The band has been added to your favourites');jQuery("#spn_"+bandId).html('');jQuery("#post-stream-profile-name").val(message[4]);jQuery("#post-stream-profile-type").val('band');jQuery("#post-stream-profile-id").val(message[3]);jQuery("#confirm-postfan-div").show();$('#confirm-postfan-div').center();}});}
function becomeAFanCloth(clothId){url=siteurl+'ajax/profile/becomeafanClothing.php?cloth_id='+clothId;jQuery.get(url,function(data){message=data.split("|");if(message[0]==0){showNotification(message[1]);return;}else{showSuccessMsg('The band has been added to your favourites');jQuery("#spn_clth_"+clothId).html('');}});}
function closeConfirmPostFanDiv(){jQuery("#confirm-postfan-div").hide();}
function postAddFanStream(){closeConfirmPostFanDiv();showSuccessMsg('posted the activity on your favorite sites.');var profile_name=jQuery("#post-stream-profile-name").val();var profile_type=jQuery("#post-stream-profile-type").val();var profile_userid=jQuery("#post-stream-profile-id").val();url=siteurl+'ajax/profile/postAddFanStream.php?profile_name='
+profile_name+'&profile_type='+profile_type
+'&profile_userid='+profile_userid;jQuery.get(url,function(data){});jQuery('#notificationBar').ajaxError(function(){});};
/*
 * jQuery Form Plugin
 * version: 2.81 (04-JUN-2011)
 * @requires jQuery v1.3.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
;(function($){$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
if(typeof options=='function'){options={success:options};}
var action=this.attr('action');var url=(typeof action==='string')?$.trim(action):'';url=url||window.location.href||'';if(url){url=(url.match(/^([^#]+)/)||[])[1];}
options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:this[0].getAttribute('method')||'GET',iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options);var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
var n,v,a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n]){a.push({name:n,value:options.data[n][k]});}}
else{v=options.data[n];v=$.isFunction(v)?v():v;a.push({name:n,value:v});}}}
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
else{options.data=q;}
var $form=this,callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});}
if(options.clearForm){callbacks.push(function(){$form.clearForm();});}
if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(oldSuccess,arguments);});}
else if(options.success){callbacks.push(options.success);}
options.success=function(data,status,xhr){var context=options.context||options;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form]);}};var fileInputs=$('input:file',this).length>0;var mp='multipart/form-data';var multipart=($form.attr('enctype')==mp||$form.attr('encoding')==mp);if(options.iframe!==false&&(fileInputs||options.iframe||multipart)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){fileUpload(a);});}
else{fileUpload(a);}}
else{$.ajax(options);}
this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(a){var form=$form[0],i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;if(a){for(i=0;i<a.length;i++){$(form[a[i].name]).attr('disabled',false);}}
if($(':input[name=submit],:input[id=submit]',form).length){alert('Error: Form elements must not have name or id of "submit".');return;}
s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id='jqFormIO'+(new Date().getTime());if(s.iframeTarget){$io=$(s.iframeTarget);n=$io.attr('name');if(n==null)
$io.attr('name',id);else
id=n;}
else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />');$io.css({position:'absolute',top:'-1000px',left:'-1000px'});}
io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==='timeout'?'timeout':'aborted');log('aborting upload... '+e);this.aborted=1;$io.attr('src',s.iframeSrc);xhr.error=e;s.error&&s.error.call(s.context,xhr,e,status);g&&$.event.trigger("ajaxError",[xhr,s,e]);s.complete&&s.complete.call(s.context,xhr,e);}};g=s.global;if(g&&!$.active++){$.event.trigger("ajaxStart");}
if(g){$.event.trigger("ajaxSend",[xhr,s]);}
if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;}
return;}
if(xhr.aborted){return;}
sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+'.x']=form.clk_x;s.extraData[n+'.y']=form.clk_y;}}}
var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=frame.contentWindow?frame.contentWindow.document:frame.contentDocument?frame.contentDocument:frame.document;return doc;}
function doSubmit(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST'){form.setAttribute('method','POST');}
if(form.getAttribute('action')!=s.url){form.setAttribute('action',s.url);}
if(!s.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);}
function checkState(){try{var state=getDoc(io).readyState;log('state = '+state);if(state.toLowerCase()=='uninitialized')
setTimeout(checkState,50);}
catch(e){log('Server abort: ',e,' (',e.name,')');cb(SERVER_ABORT);timeoutHandle&&clearTimeout(timeoutHandle);timeoutHandle=undefined;}}
var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){extraInputs.push($('<input type="hidden" name="'+n+'" />').attr('value',s.extraData[n]).appendTo(form)[0]);}}
if(!s.iframeTarget){$io.appendTo('body');io.attachEvent?io.attachEvent('onload',cb):io.addEventListener('load',cb,false);}
setTimeout(checkState,15);form.submit();}
finally{form.setAttribute('action',a);if(t){form.setAttribute('target',t);}else{$form.removeAttr('target');}
$(extraInputs).remove();}}
if(s.forceSync){doSubmit();}
else{setTimeout(doSubmit,10);}
var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;}
try{doc=getDoc(io);}
catch(ex){log('cannot access response document: ',ex);e=SERVER_ABORT;}
if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort('timeout');return;}
else if(e==SERVER_ABORT&&xhr){xhr.abort('server abort');return;}
if(!doc||doc.location.href==s.iframeSrc){if(!timedOut)
return;}
io.detachEvent?io.detachEvent('onload',cb):io.removeEventListener('load',cb,false);var status='success',errMsg;try{if(timedOut){throw'timeout';}
var isXml=s.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&window.opera&&(doc.body==null||doc.body.innerHTML=='')){if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return;}}
var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml)
s.dataType='xml';xhr.getResponseHeader=function(header){var headers={'content-type':s.dataType};return headers[header];};if(docRoot){xhr.status=Number(docRoot.getAttribute('status'))||xhr.status;xhr.statusText=docRoot.getAttribute('statusText')||xhr.statusText;}
var dt=s.dataType||'';var scr=/(json|script|text)/.test(dt.toLowerCase());if(scr||s.textarea){var ta=doc.getElementsByTagName('textarea')[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute('status'))||xhr.status;xhr.statusText=ta.getAttribute('statusText')||xhr.statusText;}
else if(scr){var pre=doc.getElementsByTagName('pre')[0];var b=doc.getElementsByTagName('body')[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerHTML;}
else if(b){xhr.responseText=b.innerHTML;}}}
else if(s.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}
try{data=httpData(xhr,s.dataType,s);}
catch(e){status='parsererror';xhr.error=errMsg=(e||status);}}
catch(e){log('error caught: ',e);status='error';xhr.error=errMsg=(e||status);}
if(xhr.aborted){log('upload aborted');status=null;}
if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?'success':'error';}
if(status==='success'){s.success&&s.success.call(s.context,data,'success',xhr);g&&$.event.trigger("ajaxSuccess",[xhr,s]);}
else if(status){if(errMsg==undefined)
errMsg=xhr.statusText;s.error&&s.error.call(s.context,xhr,status,errMsg);g&&$.event.trigger("ajaxError",[xhr,s,errMsg]);}
g&&$.event.trigger("ajaxComplete",[xhr,s]);if(g&&!--$.active){$.event.trigger("ajaxStop");}
s.complete&&s.complete.call(s.context,xhr,status);callbackProcessed=true;if(s.timeout)
clearTimeout(timeoutHandle);setTimeout(function(){if(!s.iframeTarget)
$io.remove();xhr.responseXML=null;},100);}
var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
else{doc=(new DOMParser()).parseFromString(s,'text/xml');}
return(doc&&doc.documentElement&&doc.documentElement.nodeName!='parsererror')?doc:null;};var parseJSON=$.parseJSON||function(s){return window['eval']('('+s+')');};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader('content-type')||'',xml=type==='xml'||!type&&ct.indexOf('xml')>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==='parsererror'){$.error&&$.error('parsererror');}
if(s&&s.dataFilter){data=s.dataFilter(data,type);}
if(typeof data==='string'){if(type==='json'||!type&&ct.indexOf('json')>=0){data=parseJSON(data);}else if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}}
return data;};}};$.fn.ajaxForm=function(options){if(this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log('DOM not ready, queuing ajaxForm');$(function(){$(o.s,o.c).ajaxForm(options);});return this;}
log('terminating; zero elements found by selector'+($.isReady?'':' (DOM not ready)'));return this;}
return this.ajaxFormUnbind().bind('submit.form-plugin',function(e){if(!e.isDefaultPrevented()){e.preventDefault();$(this).ajaxSubmit(options);}}).bind('click.form-plugin',function(e){var target=e.target;var $el=$(target);if(!($el.is(":submit,input:image"))){var t=$el.closest(':submit');if(t.length==0){return;}
target=t[0];}
var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);});};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin');};$.fn.formToArray=function(semantic){var a=[];if(this.length===0){return a;}
var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els){return a;}
var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n){continue;}
if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}
continue;}
v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}
else if(v!==null&&typeof v!='undefined'){a.push({name:n,value:v});}}
if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return;}
var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}
else if(v!==null&&typeof v!='undefined'){a.push({name:this.name,value:v});}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length)){continue;}
v.constructor==Array?$.merge(val,v):val.push(v);}
return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(successful===undefined){successful=true;}
if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1)){return null;}
if(tag=='select'){var index=el.selectedIndex;if(index<0){return null;}
var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v){v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;}
if(one){return v;}
a.push(v);}}
return a;}
return $(el).val();};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea'){this.value='';}
else if(t=='checkbox'||t=='radio'){this.checked=false;}
else if(tag=='select'){this.selectedIndex=-1;}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType)){this.reset();}});};$.fn.enable=function(b){if(b===undefined){b=true;}
return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select===undefined){select=true;}
return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio'){this.checked=select;}
else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
this.selected=select;}});};function log(){var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log){window.console.log(msg);}
else if(window.opera&&window.opera.postError){window.opera.postError(msg);}};})(jQuery);;(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}
var validator=$.data(this[0],'validator');if(validator){return validator;}
validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}
this.submit(function(event){if(validator.settings.debug)
event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}
validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}
return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)
settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)
return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!=Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(element)).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)
this.element(element);else if(element.parentNode.name in this.submitted)
this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}
$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)
$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())
$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)
$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)
count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))
return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name).not(this.settings.ignore)[0];}
var rules=$(element).rules();var dependencyMismatch=false;for(var method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}
if(dependencyMismatch)
return;if(this.objectLength(rules))
this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)
return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)
return arguments[i];}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}
this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}
if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}
this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return /radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)
this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(var method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
if(rules.messages){delete rules.messages;}
return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))
return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))
return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))
return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(this.pending[element.name]){return"pending";}
if(previous.old===value){return previous.valid;}
previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message;validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))
return"dependency-mismatch";if(/[^0-9-]+/.test(value))
return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)
nDigit-=9;}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var pendingRequests={};if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
pendingRequests[port]=xhr;}});}else{var ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;if(mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
return(pendingRequests[port]=ajax.apply(this,arguments));}
return ajax.apply(this,arguments);};}})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery);;
/*
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */
(function(i){var q={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},r=false;i(window).bind("load.jcarousel",function(){r=true});i.jcarousel=function(a,c){this.options=i.extend({},q,c||{});this.autoStopped=this.locked=false;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl=(i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl?"right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){i(a).removeClass(d[f]);b=d[f];break}if(a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"){this.list=i(a);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container"))this.container=this.container.wrap("<div></div>");this.container=this.container.parent()}else if(!this.container.hasClass("jcarousel-container"))this.container=this.list.wrap("<div></div>").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip"))this.clip=this.list.wrap("<div></div>").parent();this.buttonNext=i(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext=this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=i(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var e=this;if(b.size()>0){var g=0,k=this.options.offset;b.each(function(){e.format(this,k++);g+=e.dimension(this,j)});this.list.css(this.wh,g+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.reload()};this.options.initCallback!==null&&this.options.initCallback(this,"init");if(!r&&i.browser.safari){this.buttons(false,false);i(window).bind("load.jcarousel",function(){e.setup()})}else this.setup()};var h=i.jcarousel;h.fn=h.prototype={jcarousel:"0.2.7"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(a,false);i(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)}},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;this.list.children("li").each(function(f){b+=a.dimension(this,c);if(f+1<a.first)d=b});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(a){if(a!==undefined){this.options.size=a;this.locked||this.buttons()}return this.options.size},has:function(a,c){if(c===undefined||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b=a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return false}return true},get:function(a){return i(".jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,f=i(c);if(b.length===0){var j,e=h.intval(a);for(b=this.create(a);;){j=this.get(--e);if(e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}}else d=this.dimension(b);if(f.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(f);b=f}else b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),a);f=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,f)-d;a>0&&a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,h.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(!(!c.length||a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,h.intval(this.list.css(this.wh))-b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(false):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(true):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!(this.locked||this.animating||!this.tail)){this.pauseAuto();var c=h.intval(this.list.css(this.lt));c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){if(!(this.locked||this.animating)){this.pauseAuto();this.animate(this.pos(a),c)}},pos:function(a,c){var b=h.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;if(this.options.wrap!="circular")a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a;for(var d=this.first>a,f=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(f):this.get(this.last),e=d?f:f-1,g=null,k=0,l=false,m=0;d?--e>=a:++e<a;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(l)k+=m;if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<=this.options.size)))b=d?b+m:b-m}f=this.clipping();var p=[],o=0,n=0;j=this.get(a-1);for(e=a;++o;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j.length===0?this.list.prepend(g):j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(m===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");if(this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size)p.push(g);else if(l)k+=m;n+=m;if(n>=f)break;e++}for(g=0;g<p.length;g++)p[g].remove();if(k>0){this.list.css(this.wh,this.dimension(this.list)+k+"px");if(d){b-=k;this.list.css(this.lt,h.intval(this.list.css(this.lt))-k+"px")}}k=a+o-1;if(this.options.wrap!="circular"&&this.options.size&&k>this.options.size)k=this.options.size;if(e>k){o=0;e=k;for(n=0;++o;){g=this.get(e--);if(!g.length)break;n+=this.dimension(g);if(n>=f)break}}e=k-o+1;if(this.options.wrap!="circular"&&e<1)e=1;if(this.inTail&&d){b+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&k==this.options.size&&k-o+1>=1){d=h.margin(this.get(k),!this.options.vertical?"marginRight":"marginBottom");if(n-d>f)this.tail=n-f-d}if(c&&a===this.options.size&&this.tail){b-=this.tail;this.inTail=true}for(;a-->e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=k;return b},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a===0&&b.list.css(b.lt,0);if(!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail))b.startAuto();b.buttons();b.notify("onAfterAnimation");if(b.options.wrap=="circular"&&b.options.size!==null)for(var f=b.prevFirst;f<=b.prevLast;f++)if(f!==null&&!(f>=b.first&&f<=b.last)&&(f<1||f>b.options.size))b.remove(f)};this.notify("onBeforeAnimation");if(!this.options.animation||c===false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!==undefined)this.options.auto=a;if(this.options.auto===0)return this.stopAuto();if(this.timer===null){this.autoStopped=false;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&&this.last>=this.options.size)a=this.tail!==null&&!this.inTail}if(c==null){c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)c=this.tail!==null&&this.inTail}var b=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);a&&this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext);this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?false:true);this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)}else this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)}else this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b,null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback",a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var g=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(g)){var k=this;if(d===undefined)g(k,b,c);else if(f===undefined)this.get(d).each(function(){g(k,this,d,b,c)});else{a=function(m){k.get(m).each(function(){g(k,this,m,b,c)})};for(var l=d;l<=f;l++)l!==null&&!(l>=j&&l<=e)&&a(l)}}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(a,c){var b=a.jquery!==undefined?a[0]:a,d=!this.options.vertical?(b.offsetWidth||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginLeft")+h.margin(b,"marginRight"):(b.offsetHeight||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginTop")+h.margin(b,"marginBottom");if(c==null||d==c)return d;d=!this.options.vertical?c-h.margin(b,"marginLeft")-h.margin(b,"marginRight"):c-h.margin(b,"marginTop")-h.margin(b,"marginBottom");i(b).css(this.wh,d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-h.intval(this.clip.css("borderLeftWidth"))-h.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-h.intval(this.clip.css("borderTopWidth"))-h.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});h.extend({defaults:function(a){return i.extend(q,a||{})},margin:function(a,c){if(!a)return 0;var b=a.jquery!==undefined?a[0]:a;if(c=="marginRight"&&i.browser.safari){var d={display:"block","float":"none",width:"auto"},f,j;i.swap(b,d,function(){f=b.offsetWidth});d.marginRight=0;i.swap(b,d,function(){j=b.offsetWidth});return j-f}return h.intval(i.css(b,c))},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a}});i.fn.jcarousel=function(a){if(typeof a=="string"){var c=i(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("jcarousel",new h(this,a))})}})(jQuery);;function processingShow(msg){var hpos=((jQuery(window).height()-jQuery('#msgbox').outerHeight())/2)+jQuery(window).scrollTop();var wpos=(jQuery(window).width()/2)-(jQuery('#msgbox').width()/2);var scrollableHeight=((jQuery(window).height()-jQuery('#msgbox').outerHeight())/2)+jQuery(window).scrollTop();if(msg){jQuery('#msgBoxContent').html(msg);}else{jQuery('#msgBoxContent').html('');}
var popupNavHeight=jQuery('#contentPage').height()+jQuery('#header').height()+jQuery('#footer').height();jQuery('#popupNav').css({'opacity':'0.75','height':popupNavHeight}).fadeIn('slow');jQuery('#msgbox').css('top',hpos+'px').css('left',wpos+"px").fadeIn('fast');}
function processingHide(msg){jQuery('#popupNav').fadeOut('fast');jQuery('#msgbox').fadeOut('fast');};;(function($){$.fn.textfill=function(options){var defaults={maxFontPixels:40,innerTag:'span'};var Opts=jQuery.extend(defaults,options);return this.each(function(){var fontSize=Opts.maxFontPixels;var ourText=$(Opts.innerTag+':visible:first',this);var maxHeight=$(this).height();var maxWidth=$(this).width();var textHeight;var textWidth;do{ourText.css('font-size',fontSize);textHeight=ourText.height();textWidth=ourText.width();fontSize=fontSize-1;}while((textHeight>maxHeight||textWidth>maxWidth)&&fontSize>3);});};})(jQuery);;function connect(profile_id){if($('#get_connect_ajax_status').is(":visible")){$('#get_connect_ajax_status').hide();}else{$('#get_connect_ajax_status').show();var data={profile_id:profile_id};autohide('#connect_'+profile_id);$('#connect_'+profile_id+'_ajax').show();url=siteurl+'ajax/connect.php';$.ajax({type:"POST",url:url,data:data,success:function(response){$('#connect_'+profile_id+'_ajax').fadeOut();if(response.html&&response.target){$(response.target).show();$(response.target).html(response.html);}
if(response.action){eval(response.action);}},complete:function(){$('#get_connect_ajax_status').hide();}});}}
function connectUpdate(profile_id){if($("input[name='is_email']:checked").val()){if(!isValidEmailAddress($('#connect_email').val())){$('#connect_email').focus().css('border-color','#ff0000');return false;}}
$('#connect_ajax_status').show();var data=$('#connect_form_'+profile_id).serialize(true);url=siteurl+'ajax/connect.php';$.ajax({type:"POST",url:url,data:data,success:function(response){if(response.sc==1){jQuery(response.target).show();}else{jQuery(response.target).hide();}
if(response.action){eval(response.action);}},complete:function(){$('#connect_ajax_status').hide();connect(profile_id);}});};;jQuery.fn.uniform=function(settings){settings=jQuery.extend({prevent_submit:false,ask_on_leave:false,valid_class:'valid',invalid_class:'invalid',error_class:'error',focused_class:'focused',holder_class:'ctrlHolder',field_selector:'input, textarea, select',default_value_color:"#AFAFAF"},settings);var i18n_en={required:'%s is required',minlength:'%s should be at least %d characters long',min:'%s should be greater than or equal to %d',maxlength:'%s should not be longer than %d characters',max:'%s should be less than or equal to %d',same_as:'%s is expected to be same as %s',email:'%s is not a valid email address',url:'%s is not a valid URL',number:'%s needs to be a number',integer:'%s needs to be a whole number',alpha:'%s should contain only letters (without special characters or numbers)',alphanum:'%s should contain only numbers and letters (without special characters)',phrase:'%s should contain only alphabetic characters, numbers, spaces, and the following: . , - _ () * # :',phone:'%s should be a phone number',date:'%s should be a date (mm/dd/yyyy)',callback:'Failed to validate %s field. Validator function (%s) is not defined!',on_leave:'Are you sure you want to leave this page without saving this form?'};var validators={get_val:function(name,classes,default_value){var value=default_value;classes=classes.split(' ');for(var i=0;i<classes.length;i++){if(classes[i]==name){if((classes[i+1]!='undefined')&&('val-'===classes[i+1].substr(0,4))){value=parseInt(classes[i+1].substr(4),10);return value;}}}
return value;},required:function(field,caption){if(jQuery.trim(field.val())==''){return i18n('required',caption);}else{return true;}},validateMinLength:function(field,caption){var min_length=this.get_val('validateMinLength',field.attr('class'),0);if((min_length>0)&&(field.val().length<min_length)){return i18n('minlength',caption,min_length);}else{return true;}},validateMin:function(field,caption){var min_val=this.get_val('validateMin',field.attr('class'),0);if((parseInt(field.val(),10)<min_val)){return i18n('min',caption,min_val);}else{return true;}},validateMaxLength:function(field,caption){var max_length=this.get_val('validateMaxLength',field.attr('class'),0);if((max_length>0)&&(field.val().length>max_length)){return i18n('maxlength',caption,max_length);}else{return true;}},validateMax:function(field,caption){var max_val=this.get_val('validateMax',field.attr('class'),0);if((parseInt(field.val(),10)>max_val)){return i18n('max',caption,max_val);}else{return true;}},validateSameAs:function(field,caption){var classes=field.attr('class').split(' ');var target_field_name='';for(var i=0;i<classes.length;i++){if(classes[i]=='validateSameAs'){if(classes[i+1]!='undefined'){target_field_name=classes[i+1];break;}}}
if(target_field_name){var target_field=jQuery('#'+target_field_name);if(target_field.length>0){var target_field_caption=field_caption(target_field);if(target_field.val()!=field.val()){return i18n('same_as',caption,target_field_caption);}}}
return true;},validateEmail:function(field,caption){if(field.val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){return true;}else{return i18n('email',caption)}},validateUrl:function(field,caption){if(field.val().match(/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i)){return true;}else{return i18n('url',caption);}},validateNumber:function(field,caption){if(field.val().match(/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/)||field.val()==''){return true;}else{return i18n('number',caption);}},validateInteger:function(field,caption){if(field.val().match(/(^-?\d\d*$)/)||field.val()==''){return true;}else{return i18n('integer',caption);}},validateAlpha:function(field,caption){if(field.val().match(/^[a-zA-Z]+$/)){return true;}else{return i18n('alpha',caption);}},validateAlphaNum:function(field,caption){if(field.val().match(/\W/)){return i18n('alphanum',caption);}else{return true;}},validatePhrase:function(field,caption){if((field.val()=='')||field.val().match(/^[\w\d\.\-_\(\)\*'# :,]+$/i)){return true;}else{return i18n('phrase',caption);}},validatePhone:function(field,caption){if(field.val().match('/^1?-?(\d{3})?-?(\d{2})?\d-?(\d{4})$/')){return true;}else{return i18n('phone',caption);}},validateDate:function(field,caption){if(field.val().match('(1[0-9]|[1-9])/([1-3][0-9]|[1-9])/((19|20)[0-9][0-9]|[0-9][0-9])')){return true;}else{return i18n('date',caption);}},validateCallback:function(field,caption){var classes=field.attr('class').split(' ');var callback_function='';for(var i=0;i<classes.length;i++){if(classes[i]=='validateCallback'){if(classes[i+1]!='undefined'){callback_function=classes[i+1];break;}}}
if(window[callback_function]!='undefined'&&(typeof window[callback_function]=='function')){return window[callback_function](field,caption);}
return i18n('callback',caption,callback_function);}};var i18n=function(lang_key){var lang_string=i18n_en[lang_key];var bits=lang_string.split('%');var out=bits[0];var re=/^([ds])(.*)$/;for(var i=1;i<bits.length;i++){p=re.exec(bits[i]);if(!p||arguments[i]==null)continue;if(p[1]=='d'){out+=parseInt(arguments[i],10);}else if(p[1]=='s'){out+=arguments[i];}
out+=p[2];}
return out;}
return this.each(function(){var form=jQuery(this);var validate=function($input,valid,text){var $p=$input.closest('div.'+settings.holder_class).andSelf().toggleClass(settings.invalid_class,!valid).toggleClass(settings.error_class,!valid).toggleClass(settings.valid_class,valid).find('p.formHint');if(!valid&&!$p.data('info-text')){$p.data('info-text',$p.html());}
else if(valid){text=$p.data('info-text');}
if(text){$p.html(text);}};form.find(settings.field_selector).each(function(){var $input=jQuery(this),value=$input.val();$input.data('default-color',$input.css('color'));if(value===$input.data('default-value')||!value){$input.not('select').css("color",settings.default_value_color);$input.val($input.data('default-value'));}});if(settings.ask_on_leave||form.hasClass('askOnLeave')){var initial_values=form.serialize();$(window).bind("beforeunload",function(e){if(initial_values!=form.serialize()){var leave_page=confirm(i18n('on_leave'));return leave_page;}});}
form.submit(function(){form.find(settings.field_selector).each(function(){if($(this).val()===$(this).data('default-value')){$(this).val("");}});if((settings.prevent_submit||form.hasClass('preventSubmit'))&&form.find('.'+settings.invalid_class).add('.'+settings.error_class).length){return false;}
return true;});form.delegate(settings.field_selector,'focus',function(){form.find('.'+settings.focused_class).removeClass(settings.focused_class);var $input=$(this);$input.parents().filter('.'+settings.holder_class+':first').addClass(settings.focused_class);if($input.val()===$input.data('default-value')){$input.val("");}
$input.not('select').css('color',$input.data('default-color'));});form.delegate(settings.field_selector,'blur',function(){var $input=$(this);var label=$(this).closest('div.'+settings.holder_class).find('label').text();form.find('.'+settings.focused_class).removeClass(settings.focused_class);if(($input.val()===""||$input.val()===$input.data('default-value'))&&!$input.hasClass('required')){$input.not('select').css("color",settings.default_value_color);$input.val($input.data('default-value'));return;}
var has_validation=false;for(validator in validators){if($input.hasClass(validator)){has_validation=true;var validation_result=validators[validator]($input,label);if(typeof(validation_result)=='string'){$input.trigger('error',validation_result);return;}}}
if(has_validation){$input.trigger('success');}
$input.css('color',$input.data('default-color'));return;});form.delegate(settings.field_selector,'error',function(e,text){validate($(this),false,text);});form.delegate(settings.field_selector,'success',function(e,text){validate($(this),true);});});};jQuery(document).ready(function(){jQuery('form').uniform({ask_on_leave:false});});;function s_update_sizes(){$('.dyn_img').each(function(){var $this=$(this);var $thewidth=$(this).width();var $con_width=$('.dyn_div_con').width();var $var_width=$('.dyn_div_var').width()-$con_width;if($thewidth>=$var_width){$(this).attr({width:$var_width-10});}});}
function tog(id){$(id).slideToggle("slow");}
function goToByScroll(id){$('html,body').animate({scrollTop:$(id).offset().top},'slow');};function addToCart(sku,options){console.log(sku);jQuery('#'+sku+'_ajax').show();url=siteurl+'ajax/store/cart.php';var data={'action':'add',sku:sku};jQuery.ajax({type:"POST",url:url,data:data,success:function(response){console.log(response);if(response.html&&response.target){jQuery(response.target).html(response.html);}
if(response.action){eval(response.action);}},complete:function(){jQuery('#'+sku+'_ajax').hide();}});};jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};if(typeof jQuery=='undefined'){}else{jQuery(document).ready(function(){if(typeof c!='undefined'){jQuery(c).each(function(s,index){console.log('here');var url=siteurl+'ajax/store/closet.php';var data={'action':'deal','token':index,'store':'stores'};if(jQuery.cookie("user")){data['user']=jQuery.cookie("user");}
if(jQuery.cookie("sess")){data['sess']=jQuery.cookie("sess");}
jQuery.ajax({url:url,data:data,dataType:'jsonp',jsonp:'callback',success:function(response){if(response.html&&response.target){jQuery(response.target).html(response.html);}
if(response.action){eval(response.action);}}});});}});function jsonpRun(response){if(response.html&&response.target){jQuery(response.target).html(response.html);}
if(response.action){eval(response.action);}}
function addToCloset(token){jQuery('#deal_'+token+'_ajax').fadeIn();url=siteurl+'ajax/store/closet.php';var data={'action':'add','token':token}
if(jQuery.cookie("user")){data['user']=jQuery.cookie("user");}
if(jQuery.cookie("sess")){data['sess']=jQuery.cookie("sess");}
jQuery.ajax({url:url,data:data,dataType:'jsonp',jsonp:'callback',success:function(response){jQuery('#deal_'+token+'_ajax').hide();if(response.html&&response.target){jQuery(response.target).html(response.html);}
if(response.action){eval(response.action);}}});}
function tellAFriend(token){jQuery('#deal_'+token+'_ajax').fadeIn();url=siteurl+'ajax/store/closet.php';var data={'action':'tell','token':token}
if(jQuery.cookie("user")){data['user']=jQuery.cookie("user");}
if(jQuery.cookie("sess")){data['sess']=jQuery.cookie("sess");}
jQuery.ajax({url:url,data:data,dataType:'jsonp',jsonp:'callback',success:function(response){jQuery('#deal_'+token+'_ajax').hide();if(response.html&&response.target){jQuery(response.target).html(response.html);}
if(response.action){eval(response.action);}}});}
function tellAFriendPublish(token){jQuery('#publish_'+token+'_ajax').fadeIn();url=siteurl+'ajax/store/closet.php';var data={'action':'publish','token':token,'twitter':jQuery('#twitter_'+token).val(),'facebook':jQuery('#facebook_'+token).val(),'facebook_page':jQuery('#facebook_page_'+token).val(),}
if(jQuery.cookie("user")){data['user']=jQuery.cookie("user");}
if(jQuery.cookie("sess")){data['sess']=jQuery.cookie("sess");}
jQuery.ajax({url:url,data:data,dataType:'jsonp',jsonp:'callback',success:function(response){jQuery('#publish_'+token+'_ajax').hide();if(response.html&&response.target){jQuery(response.target).html(response.html);}
if(response.action){eval(response.action);}}});}
function addEmail(email,id){if(isValidEmailAddress(email)){var data={email:email,token:id};url=siteurl+'ajax/store/closet.php';jQuery.ajax({url:url,data:data,dataType:'jsonp',jsonp:'callback',success:function(response){if(response.html&&response.target){jQuery(response.target).html(response.html);}
if(response.action){eval(response.action);}},complete:function(){}});}}
function isValidEmailAddress(emailAddress){var pattern=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return pattern.test(emailAddress);}};function setWidget(id){console.log(id);var url=siteurl+'ajax/widget.php';$(id).toggle();$(id+'_btn').toggleClass("collapse expand");console.log($(id).is(':hidden'));if($(id).is(':visible')){var state='show';}else{var state='hide';}
var data={'action':'set','name':id,'state':state};jQuery.ajax({type:"POST",url:url,data:data,success:function(response){console.log(response);if(response.action){}},complete:function(){}});};
/*
 * jQuery postMessage - v0.5 - 9/11/2009
 * http://benalman.com/projects/jquery-postmessage-plugin/
 * 
 * Copyright (c) 2009 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($){'$:nomunge';var interval_id,last_hash,cache_bust=1,rm_callback,window=this,FALSE=!1,postMessage='postMessage',addEventListener='addEventListener',p_receiveMessage,has_postMessage=window[postMessage]&&!$.browser.opera;$[postMessage]=function(message,target_url,target){if(!target_url){return;}
message=typeof message==='string'?message:$.param(message);target=target||parent;if(has_postMessage){target[postMessage](message,target_url.replace(/([^:]+:\/\/[^\/]+).*/,'$1'));}else if(target_url){target.location=target_url.replace(/#.*$/,'')+'#'+(+new Date)+(cache_bust++)+'&'+message;}};$.receiveMessage=p_receiveMessage=function(callback,source_origin,delay){if(has_postMessage){if(callback){rm_callback&&p_receiveMessage();rm_callback=function(e){if((typeof source_origin==='string'&&e.origin!==source_origin)||($.isFunction(source_origin)&&source_origin(e.origin)===FALSE)){return FALSE;}
callback(e);};}
if(window[addEventListener]){window[callback?addEventListener:'removeEventListener']('message',rm_callback,FALSE);}else{window[callback?'attachEvent':'detachEvent']('onmessage',rm_callback);}}else{interval_id&&clearInterval(interval_id);interval_id=null;if(callback){delay=typeof source_origin==='number'?source_origin:typeof delay==='number'?delay:100;interval_id=setInterval(function(){var hash=document.location.hash,re=/^#?\d+&/;if(hash!==last_hash&&re.test(hash)){last_hash=hash;callback({data:hash.replace(re,'')});}},delay);}}};})(jQuery);;;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
