');
$("#log_pwd_p").css({'background':'yellow', color : '#333'});
}
if($("#log_pwd_p").val() != "") {
var username_length;
pwd_length = $("#log_pwd_p").val().length;
if (pwd_length < 6) hasError = true;
}
if (hasError == undefined) { $(this).closest('form').trigger('submit'); }
else { //alert('i cant go in!');
}
});
/* recover */
if ($('body#recover').length){
var resUsernameVal = $("#reset_username").val();
var resNameVal = $("#reset_name").val();
$('.login').each(function() {
$(this).css("color","#CCC");
var default_value = this.value;
$(this).focus(function() {
$(this).css("color","black");
if(this.value == default_value) { this.value = ''; }
});
$(this).blur(function() {
$(this).css("color","#CCC");
$("#reset_search").not('click').click(function(e) {
if(this.value == '') { this.value = default_value; }
});
});
});
$("#reset_username").blur(function() {
hasError = true;
var username_length;
username_length = $("#reset_username").val().length;
if (username_length < 4) $("#err_username").append("Give a proper email or name"); $('#reset_name').attr('disabled', 'disabled');
$(this).blur(function() {
$('#login').removeAttr('disabled');
});
});
$("#reset_username").click(function() {
$("#reset_username").val(''); $('#reset_username').focus();
$("#reset_name").val('');
$('#reset_name').attr('disabled', 'disabled');
$("#reset_username").blur(function() {
$('#reset_username').removeAttr('disabled');
$('#reset_name').removeAttr('disabled');
});
});
$("#reset_name").click(function() {
$("#reset_name").val(''); $('#reset_name').focus();
$("#reset_username").val('');
$('#reset_username').attr('disabled', 'disabled');
$("#reset_name").blur(function() {
$('#reset_username').removeAttr('disabled');
$('#reset_name').removeAttr('disabled');
});
});
$("#reset_search").click(function(e) {
var newUsernameVal = $("#reset_username").val();
var newNameVal = $("#reset_name").val();
if(resUsernameVal === newUsernameVal || resNameVal === newNameVal) {
$("#err_reset").show();
e.preventDefault();
}
if(resUsernameVal != newUsernameVal || resNameVal != newNameVal) {
$("#err_reset").hide();
e.preventDefault();
var dataString = 'newUsernameVal='+ newUsernameVal + '&newNameVal=' + newNameVal;
if(newUsernameVal == '' && newNameVal == '') { $("#err_reset").show(); }
else {
$.ajax({
type: "POST",
url: "/include/process/recover.inc.php",
data: dataString,
dataType:'json',
success: function(data) {
$('#err_recover').fadeIn(200).show();
if(data.active == "N") {
var error_active = '1';
var suck = '--Not active';
}
if(data.active == "J") {
var error_active = '0';
var suck = '';
}
if(data.email != undefined && data.active == "J") {
$('.log_error').hide();
$("#err_recover").html(
'We found an account that matches your search on this email: '
+ data.email + ''
+ '
Is this your current email address?'
+ '
Yes, this is me!
You have to confirm this is you. You will then receive an email with a link to reset your password.'
+ ' '
+ '
No, I don\'t use this email address anymore.
'
+ ' Sorry, but we cannot reset your account when you don\'t have acces to an out-of-use mail account.'
+ '
The good news is that you can re-register here with your current email or through Facebook. You can then add other email addresses as well, so you will never lose access again.'
+ '
'
);
}
if(data.email != undefined && data.active == "N") {
$('.log_error').hide();
$("#err_recover").html(
'We found an account but it is not activated yet: '
+ data.email + ''
+ '
Is this your current email address?'
+ '
username password Yes, this is me!
You have to confirm this is you. You will then receive an email with a link to reset your password.'
+ ' '
+ '
No, this is not my current email address.
'
+ ' Sorry, but we cannot reset your account when you don\'t have acces to an out-of-use mail account.'
+ '
The good news is that you can re-register here with your current email. You can then add other email addresses as well, so you will never lose access again.'
);
}
if(data.email == undefined) {
$("#err_recover").html('
There is no account matching your search.
Please use your email, full name or screen name.');
}
}
});
}
}
});
$('#reset_pass').live('click',function(){
var mail = $(this).attr('data');
if(!$('#confirm_acc').is(':checked')) { $(".regerror").hide(); $("#reset_pass").after('
'); }
else {
var hasError = hasError;
var reg_password = $('#reg_pwdConf').val();
if(reg_password == '') {
hasError = true;
$(".s_opt_delete_mail").after('
Enter your current password
');
}
var reg_delete = $("#reg_del").val();
var dataString = 'reg_delete='+ reg_delete + '®_password=' + reg_password;
$.ajax({
type: "POST",
url: "/include/process/sp.acc.del.inc.php",
data: dataString,
success: function(data){
if(data == 1) {
window.location = "?logout=1&status=delete";
}
if(data == 2) {
$(".s_opt_delete_err").show('slow');
}
if(data == 3) {
$(".s_opt_delete_err").show('slow');}
},
error : function(data) { }
});
}
});
}
/* VIDEOS HOME */
$(".vhome_block, .viditem").live('click',function(){
var channelVar = $(this).attr('id');
/* alert(channelVar); */
});
$('.svc_main_more').mouseover(function() {
$('.svc_main_more').effect("bounce", { times:3 }, 300);
});
$('.svc_main_more').click(function() {
$('.svc_main_sec').slideDown('slow', function() {
$('.svc_main_more').hide('slow');
});
});
var timer = setTimeout(function() { $(".svc_main_more").click(); }, 15000);
$(".svc_main_more").click(function(){
clearTimeout(timer);
$('.svc_main_sec').slideDown('slow');
});
jQuery(function($){
'use strict';
// -------------------------------------------------------------
// Basic Navigation
// -------------------------------------------------------------
(function () {
var $frame = $('#basic');
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
forward: $wrap.find('.forward'),
backward: $wrap.find('.backward'),
prev: $wrap.find('.prev'),
next: $wrap.find('.next'),
prevPage: $wrap.find('.prevPage'),
nextPage: $wrap.find('.nextPage')
});
// To Start button
$wrap.find('.toStart').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the start of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toStart', item);
});
// To Center button
$wrap.find('.toCenter').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the center of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toCenter', item);
});
// To End button
$wrap.find('.toEnd').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the end of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toEnd', item);
});
// Add item
$wrap.find('.add').on('click', function () {
$frame.sly('add', '
' + $slidee.children().length + '
');
});
// Remove item
$wrap.find('.remove').on('click', function () {
$frame.sly('remove', -1);
});
}());
(function () {
var $frame = $('#basic_os');
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
forward: $wrap.find('.forward'),
backward: $wrap.find('.backward'),
prev: $wrap.find('.prev'),
next: $wrap.find('.next'),
prevPage: $wrap.find('.prevPage'),
nextPage: $wrap.find('.nextPage')
});
// To Start button
$wrap.find('.toStart').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the start of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toStart', item);
});
// To Center button
$wrap.find('.toCenter').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the center of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toCenter', item);
});
// To End button
$wrap.find('.toEnd').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the end of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toEnd', item);
});
// Add item
$wrap.find('.add').on('click', function () {
$frame.sly('add', '
' + $slidee.children().length + '
');
});
// Remove item
$wrap.find('.remove').on('click', function () {
$frame.sly('remove', -1);
});
}());
(function () {
var $frame = $('#basic_br');
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
forward: $wrap.find('.forward'),
backward: $wrap.find('.backward'),
prev: $wrap.find('.prev'),
next: $wrap.find('.next'),
prevPage: $wrap.find('.prevPage'),
nextPage: $wrap.find('.nextPage')
});
// To Start button
$wrap.find('.toStart').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the start of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toStart', item);
});
// To Center button
$wrap.find('.toCenter').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the center of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toCenter', item);
});
// To End button
$wrap.find('.toEnd').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the end of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toEnd', item);
});
// Add item
$wrap.find('.add').on('click', function () {
$frame.sly('add', '
' + $slidee.children().length + '
');
});
// Remove item
$wrap.find('.remove').on('click', function () {
$frame.sly('remove', -1);
});
}());
(function () {
var $frame = $('#basic_dz');
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
forward: $wrap.find('.forward'),
backward: $wrap.find('.backward'),
prev: $wrap.find('.prev'),
next: $wrap.find('.next'),
prevPage: $wrap.find('.prevPage'),
nextPage: $wrap.find('.nextPage')
});
// To Start button
$wrap.find('.toStart').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the start of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toStart', item);
});
// To Center button
$wrap.find('.toCenter').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the center of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toCenter', item);
});
// To End button
$wrap.find('.toEnd').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the end of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toEnd', item);
});
// Add item
$wrap.find('.add').on('click', function () {
$frame.sly('add', '
' + $slidee.children().length + '
');
});
// Remove item
$wrap.find('.remove').on('click', function () {
$frame.sly('remove', -1);
});
}());
if(("[id^=basic-]").lenght) {
var num = this.id.slice(6);
}
var conveniancecount = $("[id^=basic-]").length;
$( document ).ready(function() {
var $frame = $("[id^=basic-]").load();
var num = $frame.slice(6);
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
$("[id^=basic-]").each(function() {
var num = this.id.slice(6);
$frame = $("#basic-"+num);
var frame = $("#basic-"+num);
//alert(num);
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
forward: $wrap.find('.forward'),
backward: $wrap.find('.backward'),
prev: $wrap.find('.prev'),
next: $wrap.find('.next'),
prevPage: $wrap.find('.prevPage'),
nextPage: $wrap.find('.nextPage')
});
// To Start button
$wrap.find('.toStart').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the start of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toStart', item);
});
// To Center button
$wrap.find('.toCenter').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the center of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toCenter', item);
});
// To End button
$wrap.find('.toEnd').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the end of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toEnd', item);
});
// Add item
$wrap.find('.add').on('click', function () {
$frame.sly('add', '
' + $slidee.children().length + '
');
});
// Remove item
$wrap.find('.remove').on('click', function () {
$frame.sly('remove', -1);
});
});
}());
// -------------------------------------------------------------
// Centered Navigation
// -------------------------------------------------------------
(function () {
var $frame = $('#centered');
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'centered',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 4,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
prev: $wrap.find('.prev'),
next: $wrap.find('.next')
});
}());
// -------------------------------------------------------------
// Force Centered Navigation
// -------------------------------------------------------------
(function () {
var $frame = $('#forcecentered');
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'forceCentered',
smart: 1,
activateMiddle: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
prev: $wrap.find('.prev'),
next: $wrap.find('.next')
});
}());
// -------------------------------------------------------------
// Cycle By Items
// -------------------------------------------------------------
(function () {
var $frame = $('#cycleitems');
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Cycling
cycleBy: 'items',
cycleInterval: 1000,
pauseOnHover: 1,
// Buttons
prev: $wrap.find('.prev'),
next: $wrap.find('.next')
});
// Pause button
$wrap.find('.pause').on('click', function () {
$frame.sly('pause');
});
// Resume button
$wrap.find('.resume').on('click', function () {
$frame.sly('resume');
});
// Toggle button
$wrap.find('.toggle').on('click', function () {
$frame.sly('toggle');
});
}());
// -------------------------------------------------------------
// Cycle By Pages
// -------------------------------------------------------------
(function () {
var $frame = $('#cyclepages');
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Cycling
cycleBy: 'pages',
cycleInterval: 1000,
pauseOnHover: 1,
startPaused: 1,
// Buttons
prevPage: $wrap.find('.prevPage'),
nextPage: $wrap.find('.nextPage')
});
// Pause button
$wrap.find('.pause').on('click', function () {
$frame.sly('pause');
});
// Resume button
$wrap.find('.resume').on('click', function () {
$frame.sly('resume');
});
// Toggle button
$wrap.find('.toggle').on('click', function () {
$frame.sly('toggle');
});
}());
// -------------------------------------------------------------
// One Item Per Frame
// -------------------------------------------------------------
(function () {
var $frame = $('#oneperframe');
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'forceCentered',
smart: 1,
activateMiddle: 1,
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 0,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
prev: $wrap.find('.prev'),
next: $wrap.find('.next')
});
}());
// -------------------------------------------------------------
// Crazy
// -------------------------------------------------------------
(function () {
var $frame = $('#crazy');
var $slidee = $frame.children('ul').eq(0);
var $wrap = $frame.parent();
// Call Sly on frame
$frame.sly({
horizontal: 1,
itemNav: 'basic',
smart: 1,
activateOn: 'click',
mouseDragging: 1,
touchDragging: 1,
releaseSwing: 1,
startAt: 1,
scrollBar: $wrap.find('.scrollbar'),
scrollBy: 1,
pagesBar: $wrap.find('.pages'),
activatePageOn: 'click',
speed: 300,
elasticBounds: 1,
easing: 'easeOutExpo',
dragHandle: 1,
dynamicHandle: 1,
clickBar: 1,
// Buttons
forward: $wrap.find('.forward'),
backward: $wrap.find('.backward'),
prev: $wrap.find('.prev'),
next: $wrap.find('.next'),
prevPage: $wrap.find('.prevPage'),
nextPage: $wrap.find('.nextPage')
});
// To Start button
$wrap.find('.toStart').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the start of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toStart', item);
});
// To Center button
$wrap.find('.toCenter').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the center of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toCenter', item);
});
// To End button
$wrap.find('.toEnd').on('click', function () {
var item = $(this).data('item');
// Animate a particular item to the end of the frame.
// If no item is provided, the whole content will be animated.
$frame.sly('toEnd', item);
});
// Add item
$wrap.find('.add').on('click', function () {
$frame.sly('add', '
' + $slidee.children().length + '
');
});
// Remove item
$wrap.find('.remove').on('click', function () {
$frame.sly('remove', -1);
});
}());
});
/* VIDEO CHANNELS */
/***** use for showing channels in pannels + update right video navigation ****
$("#s_panel").load("/members/inc.s.likes.main.php", {}, function(){
$("#l_panel").load("/members/inc.s.likes.artists.php");
});
*/
/* store likes, dislikes etc */
$('#vid_acts li').click(function() {
var vidData = $(this).attr('data-name');
var dataString = 'vidData='+ vidData;
vidSect = vidData.split('-');
var like_action = vidSect[0];
var like_channel_type = vidSect[1];
var like_artist_id = vidSect[2];
var like_book_id = vidSect[3];
var like_video_id = vidSect[4];
var like_XXXXX = vidSect[5];
$.ajax({
type: "POST",
url: "/include/process/like_media.php",
data: dataString,
success: function(data){
dataVars = data.split('-');
var dv_action = dataVars[0];
var dv_views = dataVars[1];
var dv_likes = dataVars[2];
var dv_dislikes = dataVars[3];
if(dv_action == "11") {
$("#vid_act-11").attr('class', 'hidden');
$("#vid_act-10").attr('class', 'blue');
$(".vp_sub").html(dv_views + ' views | ❤ ' + dv_likes + ' | 👎 ' + dv_dislikes );
}
if(dv_action == "10") {
$("#vid_act-10").attr('class', 'hidden');
$("#vid_act-11").attr('class', '');
$(".vp_sub").html(dv_views + ' views | ❤ ' + dv_likes + ' | 👎 ' + dv_dislikes );
}
if(dv_action == "21") {
$("#vid_act-21").attr('class', 'hidden');
$("#vid_act-20").attr('class', 'blue');
}
if(dv_action == "20") {
$("#vid_act-20").attr('class', 'hidden');
$("#vid_act-21").attr('class', '');
}
if(dv_action == "31") {
$("#vid_act-31").attr('class', 'hidden');
$("#vid_act-30").attr('class', 'blue');
$(".vp_sub").html(dv_views + ' views | ❤ ' + dv_likes + ' | 👎 ' + dv_dislikes );
}
if(dv_action == "30") {
$("#vid_act-30").attr('class', 'hidden');
$("#vid_act-31").attr('class', '');
$(".vp_sub").html(dv_views + ' views | ❤ ' + dv_likes + ' | 👎 ' + dv_dislikes );
}
else { //alert('errorNEE');
}
},
error : function(data) { //alert(data);
}
});
});
/* LIKE / UNLIKE ARTISTS & VIDEOS
==============================================*/
$(document).on( "click", ".likeArtist", function() {
var string = $(this).attr('data');
string = string.split('-'); var artistID = string[0]; var device = string[1];
var dataString = 'likeid='+ artistID + '&act=' + device;
if(device == "1") { $(this).toggleClass("likeArtist likedArtist_mob").attr("src","/img/icons/heart_liked.png"); }
if(device == "2") { $(this).removeClass("likeArtist").addClass("likedArtist").attr("src","/img/icons/heart_liked.png"); }
$.ajax({
type: "POST",
url: "/include/process/artist_like.php",
data: dataString,
success: function(data){ //alert(data);
$("#likesview-"+artistID).attr("class", "block set");
$("#likesview-"+artistID).show().html(data);
},
error : function(data) { //alert('nope');
$(this).attr("src", "/img/icons/heart_active.png");
}
});
});
$(document).on("click", ".likedArtist, .likedArtist_mob", function (){
var string = $(this).attr('data');
string = string.split('-'); var artistID = string[0]; var device = string[1];
var dataString = 'likeid='+ artistID + '&act=' + device;
$(this).removeClass("likedArtist").addClass("likeArtist").attr("src","/img/icons/heart_active.png");
$.ajax({
type: "POST",
url: "/include/process/artist_un_like.php",
data: dataString,
success: function(data){ //alert(data);
$("#likesview-"+artistID).attr("class", "block set");
$("#likesview-"+artistID).html(data);
},
error : function(data) { //alert('nope');
$(this).attr("src", "/img/icons/heart_active.png");
}
});
});
/* unlike for mobile versions / jquery.mobile is loaded */
$(document).on('vclick', '.likedArtist_mob', function(ev){
ev.preventDefault(); /* does not fire twice! */
var string = $(this).attr('data');
string = string.split('-'); var artistID = string[0]; var device = string[1];
var dataString = 'likeid='+ artistID + '&act=' + device;
if(device == "1") { $(this).toggleClass("likedArtist_mob likeArtist").attr("src","/img/icons/heart_active.png"); }
if(device == "2") { $(this).removeClass("likedArtist").addClass("likeArtist").attr("src","/img/icons/heart_active.png"); }
$.ajax({
type: "POST",
url: "/include/process/artist_un_like.php",
data: dataString,
success: function(data){ //alert(data);
$(this).attr("src", "/img/icons/heart_active.png");
$("#likesview-"+artistID).attr("class", "block set");
$("#likesview-"+artistID).html(data);
},
error : function(data) { //alert('nope');
$(this).attr("src", "/img/icons/heart_active.png");
}
});
});
/* ### VIDEOS */
$(document).on( "click", ".likeVid", function() {
var string = $(this).attr('data');
string = string.split('-'); var mainID = string[0]; var device = string[1];
var dataString = 'likeid='+ mainID + '&act=' + device;
if(device == "1") { $(this).toggleClass("likeVid likedVid_mob").attr("src","/img/icons/heart_liked.png"); }
if(device == "2") { $(this).removeClass("likeVid").addClass("likedVid").attr("src","/img/icons/heart_liked.png"); }
$.ajax({
type: "POST",
url: "/include/process/media_like.php",
data: dataString,
success: function(data){ //alert(data);
$("#likesview-"+mainID).attr("class", "block set");
$("#likesview-"+mainID).show().html(data);
},
error : function(data) { // alert('nope');
$(this).attr("src", "/img/icons/heart_active.png");
}
});
});
$(document).on("dblclick", ".likedVid", function (){
var string = $(this).attr('data');
string = string.split('-'); var mainID = string[0]; var device = string[1];
var dataString = 'likeid='+ mainID + '&act=' + device;
$(this).removeClass("likedVid").addClass("likeVid").attr("src","/img/icons/heart_active.png");
$.ajax({
type: "POST",
url: "/include/process/media_un_like.php",
data: dataString,
success: function(data){ //alert(data);
$("#likesview-"+mainID).attr("class", "block set");
$("#likesview-"+mainID).html(data);
},
error : function(data) { //alert('nope dblClick');
$(this).attr("src", "/img/icons/heart_liked.png");
}
});
});
/* unlike for mobile versions / jquery.mobile is loaded */
$(document).on('vclick', '.likedVid_mob', function(ev){
ev.preventDefault(); /* does not fire twice! */
var string = $(this).attr('data');
string = string.split('-'); var mainID = string[0]; var device = string[1];
var dataString = 'likeid='+ mainID + '&act=' + device;
if(device == "1") { $(this).toggleClass("likedVid_mob likeVid").attr("src","/img/icons/heart_active.png"); }
if(device == "2") { $(this).removeClass("likedVid").addClass("likeVid").attr("src","/img/icons/heart_active.png"); }
$.ajax({
type: "POST",
url: "/include/process/media_un_like.php",
data: dataString,
success: function(data){ //alert(data);
$(this).attr("src", "/img/icons/heart_active.png");
$("#likesview-"+mainID).attr("class", "block set");
$("#likesview-"+mainID).html(data);
},
error : function(data) { //alert('nope vClick');
$(this).attr("src", "/img/icons/heart_liked.png");
}
});
});
/* END LIKE / UNLIKE ARTISTS & VIDEOS
==============================================*/
/* # LIVE SEARCH ALL
================================================== */
$('#search').each(function(){
$(this).val( $(this).attr('rel') );
});
$('#search').focus( function(){
if( $(this).val() == $(this).attr('rel') ){
$(this).val('').addClass('not-empty');
}
$('.clearimg img'). show();
});
$('#search').blur(function(){
$('#ajaxLoader').hide();
if( $(this).val() =='' ){
$(this).val( $(this).attr('rel') ).removeClass('not-empty');
}
});
/* DO NAME SEARCH */
var $input = $('#search'),
$output = $('#charCount'),
re_strip = /\{.*?\}/g;
$input.keyup(function () {
var val = $(this).val();
var valCount = $('#search').val().replace(/ /g,'').length;
if(valCount == "4") { $(".search_output").after(''); }
if(valCount >= "4") {
var searchType = $('#search').attr('data');
if(searchType === "brands") { var searchFile = '/search/searchbrands.php'; }
else if(searchType === "video") { var searchFile = '/search/searchvideos.php'; }
else { var searchFile = '/include/process/search.artists.listing.php'; }
$('.search_value').val($(this).val());
var dataString = 'search_value='+ val + '&search_type=' + 'live';
/*alert(searchType + ' ' + dataString + ' ' + searchFile);*/
$.ajax({
type: "POST",
url: searchFile,
data: dataString,
success: function(data){ //alert(data);
$('.content_output').hide(); $('#ajaxLoader').hide();
$('.search_output').html(data);
$(".search_output").after('');
$('.vidresscroll').hide('slow');
},
error : function(data) { //alert('nope');
if(data == "2") {
}
}
});
}
if(valCount < "4") { $('.search_output').html(); }
});
$(".clearimg").click(function(){
$('.content_output').show();
$('.search_output').html('');
$('#search').val( $('#search').attr('rel') );
});
/* DO SCROLL SEARCH */
/*
$(document).ready(function(){
function last_msg_funtion() {
$('.notfound, #ajaxLoader').hide();
// $(".message_box:last").after('');
var getRows=$(".message_box:last").attr("id");
getRows = getRows.split('-'); var ID = getRows[0]; var search_entr = getRows[1];
var dataString = 'search_nr='+ ID + '&search_value=' + search_entr;
$.ajax({
type: "POST",
url: '/include/process/search.artists.listingXXX.php',
data: dataString,
success: function(data){ //alert(data);
if (data != "") { $(".message_box:last").after(data); $('#ajaxLoader').hide(); }
},
error : function(data) { //alert('nope');
if(data == "2") {
}
}
});
};
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
last_msg_funtion();
}
});
});
*/
$("#passsearch").live('click',function(){
var search_data = $('#search').val();
$('form#vidzsrch').trigger('submit');
});
var $vsDiv = $('.vidresscroll');
if($vsDiv.length) {
$("#lmore").live('click',function(){
$(this).hide();
$('#ajaxLoader').hide();
function last_msg_funtion() {
$('.notfound, #ajaxLoader').hide();
$(".message_box:last").after('');
var getRows=$(".message_box:last").attr("id");
getRows = getRows.split('-'); var ID = getRows[0]; var search_entr = getRows[1];
if(ID === "no") {
$(".message_box:last").after('Snap! No more videos, but we hope you enjoyed them!');
$('#ajaxLoader').hide();
}
if(ID != "no") {
var dataString = 'search_nr='+ ID + '&search_value=' + search_entr;
$.ajax({
type: "POST",
url: '/search/searchvideos.php',
data: dataString,
success: function(data){ //alert(data);
if (data != "") { $(".message_box:last").after(data); $('#ajaxLoader').hide(); }
},
error : function(data) { //alert('nope');
if(data == "2") {
}
}
});
}
};
last_msg_funtion();
});
/*
$(window).scroll(function() {
var top_of_element = $(".footer").offset().top;
var bottom_of_element = $(".footer").offset().top + $(".footer").outerHeight();
var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight();
var top_of_screen = $(window).scrollTop();
if ((bottom_of_screen > top_of_element) && (top_of_screen < bottom_of_element)){
last_msg_funtion();
} else {
}
});
*/
/*
function last_msg_funtion() {
$('.notfound, #ajaxLoader').hide();
$(".message_box:last").after('');
var getRows=$(".message_box:last").attr("id");
getRows = getRows.split('-'); var ID = getRows[0]; var search_entr = getRows[1];
if(ID === "no") {
$(".message_box:last").after('Snap! No more videos, but we hope you enjoyed them!');
$('#ajaxLoader').hide();
}
if(ID != "no") {
var dataString = 'search_nr='+ ID + '&search_value=' + search_entr;
$.ajax({
type: "POST",
url: '/search/searchvideos.php',
data: dataString,
success: function(data){ //alert(data);
if (data != "") { $(".message_box:last").after(data); $('#ajaxLoader').hide(); }
},
error : function(data) { //alert('nope');
if(data == "2") {
}
}
});
}
};
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
}
});
$(window).scroll(function() {
var top_of_element = $(".footer").offset().top;
var bottom_of_element = $(".footer").offset().top + $(".footer").outerHeight();
var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight();
var top_of_screen = $(window).scrollTop();
if ((bottom_of_screen > top_of_element) && (top_of_screen < bottom_of_element)){
last_msg_funtion();
} else {
}
});
*/
}
/* LIVE SEARCH
$("input.searchnav").click(function(){
var searchtxt = $(this).val();
$('input.searchnav').val(''); $('.searchtip').show('slow');
});
$("input.searchnav").focusout(function() {
$(this).val(searchtxt);
});
$('input.searchnav').each(function() {
var searchtxt = $(".searchnav").val();
$(this).css("color","#CCC");
var default_value = this.value;
$(this).focus(function() {
$(this).css("color","#0080BC");
if(this.value == default_value) { this.value = ''; }
$('.searchtip').fadeIn('slow');
});
$('html').not(this).click(function() {
if(this.value == '') { this.value = default_value; }
$(this).css("color","#CCC");
$('.searchtip').fadeOut('slow');
});
});
$("#searchfld").click(function() {
$('input.searchnav').val(''); $(this).css("color","#0080BC"); $('.searchtip').fadeIn('slow');
});
$('input.searchnav').on('mouseleave', function() {
if($('input.searchnav').is(":focus")) {
}
});
$("#searchfld").click(function() {
$(this).attr('clicked', 'yes');
$("#searchfld").val(''); $('.searchnav').focus();
});
*/
$('input.searchnav').keypress(function (e) {
var formName = $(this).attr('id');
if (e.which == 13) {
if (formName == "searchNws") { $('form#s_news').submit(); }
if (formName == "searchArtists") { $('form#s_artists').submit(); }
if (formName == "searchMembers") { $('form#s_members').submit(); }
if (formName == "searchVid") { $('form#s_vid').submit(); }
if (formName == "searchMusic") { $('form#s_music').submit(); }
}
});
$("input.searchnav").click(function(){
var searchtxt = $(this).val();
$('input.searchnav').val(''); $('.searchtip').show('slow');
});
$("input.searchnav").focusout(function() {
$(this).val(searchtxt);
});
$(".searchbrand").live('keyup',function(){
var searchbox = $(this).val();
var dataString = 'searchword='+ searchbox;
if(searchbox=='') {}
else {
$.ajax({
type: "POST",
url: "/search/searchbrands.php",
data: dataString,
cache: false,
success: function(html) {
$("#display, #display_usr").html(html).show();
}
});
}
return false;
});
$('html').click(function() {
$('.display_box').hide();
$('.searchbrand').val('');
});
$(".searchbrand_usr").live('keyup',function(){
$('.searchbrand_usr').css("color","#333");
var searchbox = $(this).val();
var searchbox_length = $(".searchbrand_usr").val().length;
var dataString = 'searchword='+ searchbox;
if(searchbox=='') {}
if(searchbox_length > 3) {
$('.srl_loader').show();
$.ajax({
type: "POST",
url: "/search/searchbrands_live.php",
data: dataString,
cache: false,
success: function(html) {
$('#srl_success, .srl_loader').hide();
$("#display_usr").html(html).show();
}
});
}
return false;
});
$(".srl_addBrand").live('click',function(){
$(this).tooltip().hide();
var brandID = $(this).attr('id');
var dataString = 'brandID='+ brandID;
$.ajax({
type: "POST",
url: "/include/process/like_brands_live.php",
data: dataString,
success: function(data){
if(data == 1) {
$("#s_panel").load("/members/inc.s.gear.php", {}, function(){
$("#srl_success").show().html("Your brand has been added to your gear list. You can set the gear status of your brands below.");
$('.srl_r img[title]').tooltip().hide();
});
}
if(data == 2) {
}
},
error : function(data) { }
});
});
$('html').live('click', function() {
$('#display_usr').slideUp();
$('.searchbrand_usr').val('');
});
$(".searchartists_usr").live('keyup',function(e){
$(this).css('color', '#333');
var searchbox = $(this).val();
var searchbox_length = $(".searchartists_usr").val().length;
var dataString = 'searchword='+ searchbox;
if(searchbox=='') {}
if(searchbox_length > 3) {
$('.srl_loader').show();
$.ajax({
type: "POST",
url: "/search/search.artists_live.php",
data: dataString,
cache: false,
success: function(html) {
$('#srl_success, .srl_loader').hide();
$("#display_usr").html(html).show();
},
error : function(html) {
$("#srl_success").show().html("Nope.");
}
});
}
return false;
});
$(".srl_addArtist").live('click',function(){
$(this).tooltip().hide();
var brandID = $(this).attr('id');
var dataString = 'brandID='+ brandID;
$.ajax({
type: "POST",
url: "/include/process/like_artists_live.php",
data: dataString,
success: function(data){
if(data == 1) {
$("#s_panel").load("/members/inc.s.likes.main.php", {}, function(){
$("#l_panel").load("/members/inc.s.likes.artists.php", {}, function(){
$("#srl_success").show().html("The artist is added to your artist roster. You can rate and put him or her in your personal Artist Top 10.");
$this.tooltip().hide();
});
});
}
if(data == 2) {
}
},
error : function(data) { }
});
});
$('html').live('click', function() {
$('#display_usr').slideUp();
$('.searchartists_usr, .searchmusic_usr, .searchrel_usr, .searchmem_usr').val('');
});
/*music*/
$(".searchmusic_usr").live('keyup',function(e){
$(this).css('color', '#333');
var searchbox = $(this).val();
var searchbox_length = $(".searchmusic_usr").val().length;
var dataString = 'searchword='+ searchbox;
if(searchbox=='') {}
if(searchbox_length > 3) {
$('.srl_loader').show();
$.ajax({
type: "POST",
url: "/search/search.music_live.php",
data: dataString,
cache: false,
success: function(html) {
$('#srl_success, .srl_loader').hide();
$("#display_usr").html(html).show();
},
error : function(html) {
$("#srl_success").show().html("Nope.");
}
});
}
return false;
});
$(".srl_addMusic").live('click',function(){
$(this).tooltip().hide();
var brandID = $(this).attr('id');
var dataString = 'brandID='+ brandID;
$.ajax({
type: "POST",
url: "/include/process/like_music_live.php",
data: dataString,
success: function(data){
if(data == 1) {
$("#s_panel").load("/members/inc.s.likes.main.php", {}, function(){
$("#l_panel").load("/members/inc.s.likes.music.php", {}, function(){
$("#srl_success").show().html("The musical group / artist / project is added to your music roster.");
$this.tooltip().hide();
});
});
}
if(data == 2) { }
},
error : function(data) { }
});
});
/*releases*/
$(".searchrel_usr").live('keyup',function(e){
$(this).css('color', '#333');
var searchbox = $(this).val();
var searchbox_length = $(".searchrel_usr").val().length;
var dataString = 'searchword='+ searchbox;
if(searchbox=='') {}
if(searchbox_length > 3) {
$('.srl_loader').show();
$.ajax({
type: "POST",
url: "/search/search.releases_live.php",
data: dataString,
cache: false,
success: function(html) {
$('#srl_success, .srl_loader').hide();
$("#display_usr").html(html).show();
},
error : function(html) {
$("#srl_success").show().html("The search could not be completed. Please try again.");
$('#srl_success, .srl_loader').hide();
}
});
}
return false;
});
$(".srl_addRel").live('click',function(){
$(this).tooltip().hide();
var brandID = $(this).attr('id');
var dataString = 'brandID='+ brandID;
$.ajax({
type: "POST",
url: "/include/process/like_releases_live.php",
data: dataString,
success: function(data){
if(data == 1) {
$("#s_panel").load("/members/inc.s.likes.main.php", {}, function(){
$("#l_panel").load("/members/inc.s.likes.releases.php", {}, function(){
$("#srl_success").show().html("The release is added to your favorite list.");
$this.tooltip().hide();
});
});
}
if(data == 2) { }
},
error : function(data) { }
});
});
/*members*/
$(".searchmem_usr").live('keyup',function(e){
$(this).css('color', '#333');
var searchbox = $(this).val();
var searchbox_length = $(".searchmem_usr").val().length;
var dataString = 'searchword='+ searchbox;
if(searchbox=='') {}
if(searchbox_length > 3) {
$('.srl_loader').show();
$.ajax({
type: "POST",
url: "/search/search.members_live.php",
data: dataString,
cache: false,
success: function(html) {
$('#srl_success, .srl_loader').hide();
$("#display_usr").html(html).show();
},
error : function(html) {
$("#srl_success").show().html("The search could not be completed. Please try again.");
$('#srl_success, .srl_loader').hide();
}
});
}
return false;
});
$(".srl_addMem").live('click',function(){
$(this).tooltip().hide();
var brandID = $(this).attr('id');
var dataString = 'brandID='+ brandID;
$.ajax({
type: "POST",
url: "/include/process/like_member_live.php",
data: dataString,
success: function(data){
if(data == 1) {
$("#s_panel").load("/members/inc.s.likes.friends.php", {}, function(){
$("#srl_success").show().html("This member is added to your favorite list and showing in your list below.");
});
}
if(data == 2) {
//alert('nope');
}
},
error : function(data) {
//alert('nope2');
}
});
});
/* FORMS */
$('#country').change(
function(){
$(this).closest('form').trigger('submit');
/* or:
$('#formElementId').trigger('submit');
or:
$('#formElementId').submit();
*/
});
$('.grid').isotope({
percentPosition: true,
itemSelector: '.grid-itemi',
masonry: {
columnWidth: '.grid-sizer'
}
})
/*
*** EDUCATION ***
*/
/* store in MEDIA_SESSIONS */
if($("#channelplayer").length > 0) {
var getvidid = $('.edu_status').attr('data');
var action = 99;
var dataString = 'call='+ action + '&mediaid=' + getvidid;
$.ajax({
type: "POST",
url: "/include/process/inc.videos.sessions.php",
data: dataString,
success: function(data){
if(data == "1-1") { //alert('yep: equal');
}
if(data == "1-2") {}
if(data == "1-2-3") {
$(".contest_form").hide("slow");
$(".contest_succes").show("slow");
}
},
error : function(data) {
//alert('nope');
}
});
}
/* store MEDIA VIEWS
- as above */
/* end store MEDIA VIEWS */
/* store EDUCATION ACTIONS */
$("#edu_act").live('click',function(){
var getaction = $(this).attr('data');
getaction = getaction.split('-'); var action = getaction[0]; var edu_bookID = getaction[1]; var edu_artistID = getaction[2]; var mediaNR = getaction[3];
var dataString = 'action='+ action + '&edu_bookID=' + edu_bookID + '&edu_artistID=' + edu_artistID + '&mediaNR=' + mediaNR;
$.ajax({
type: "POST",
url: "/include/process/edu_video_actions.php",
data: dataString,
success: function(data){
if(data == 1) { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "']").css("background-color", "#0080BC"); }
if(data == 2) { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "']").css("background-color", "#0080BC").html("✔ finished"); }
if(data == "2-2") { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "']").css("background-color", "#333").html("✔ mark finished"); }
if(data == 3) { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "']").css("background-color", "#0080BC").html("❤ my favorite"); }
if(data == "3-3") { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "']").css("background-color", "#333").html("❤ ad to favorites"); }
if(data == 4) { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "']").css("background-color", "#0080BC").html(" saved"); }
if(data == "4-4") { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "']").css("background-color", "#333").html(" save for later"); }
},
error : function(data) {
}
});
});
/* EMPTY EDUCATION ACTIONS */
$("#edu_act_del").live('click',function(){
var getaction = $(this).attr('data');
getaction = getaction.split('-'); var action = getaction[0]; var edu_bookID = getaction[1]; var edu_artistID = getaction[2]; var mediaNR = getaction[3]; var mediaAction = getaction[4];
var dataString = 'action='+ action + '&edu_bookID=' + edu_bookID + '&edu_artistID=' + edu_artistID + '&mediaNR=' + mediaNR + '&mediaAction=' + mediaAction;
$.ajax({
type: "POST",
url: "/include/process/edu_video_actions_delete.php",
data: dataString,
success: function(data){
if(data == 2) { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "-" + mediaAction + "']").css("background-color", "#333").html("✔ mark finished"); }
if(data == 3) { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "-" + mediaAction + "']").css("background-color", "#333").html("❤ ad to favorites"); }
if(data == 4) { $("li[data='" + action + "-" + edu_bookID + "-" + edu_artistID + "-" + mediaNR + "-" + mediaAction + "']").css("background-color", "#333").html(" save for later"); }
},
error : function(data) { }
});
});
/* CONTESTS */
$("#show_tandc").click(function() { $("#tandc").toggle(); });
$('input[name=reg_bdate]').focus(function() {
if (!$(this).data("DefaultText")) $(this).data("DefaultText", $(this).val());
if ($(this).val() != "" && $(this).val() == $(this).data("DefaultText")) $(this).val("");
}).blur(function(){
if ($(this).val() == "") $(this).val($(this).data("DefaultText"));
});
$(".c_line").click(function() { $(this).css({'background-color' : '#FFF'}); });
$('#reg_agree').change(function() {
if($(this).is(":checked")) {
$("#reg_agree").prev('div').remove();
}
});
$('select[name=reg_cntry]').change(function() { $('select[name=reg_cntry]').css({'background-color' : '#FFF'});
if($('select[name=reg_cntry]').val() == '') $('select[name=reg_cntry]').css({'background-color' : 'yellow'});
});
$("#enterContest").click(function() {
$("#reg_agree").prev('div').remove();
var hasError = hasError;
var contestNo = $("#contestNo").val();
var answer = $('input[name=contestA]:checked', '#contest_form').attr('value')
var firstname = $("#reg_fn").val();
var lastname = $("#reg_ln").val();
var reg_bdateDat = $("#reg_bdateDat").val();
var reg_bdateMonth = $("#reg_bdateMonth").val();
var reg_bdateYear = $("#reg_bdateYear").val();
var reg_email = $("#reg_email").val();
var reg_address = $("#reg_address").val();
var reg_city = $("#reg_city").val();
var reg_state = $("#reg_state").val();
var reg_zip = $("#reg_zip").val();
var reg_cntry = $('select[name=reg_cntry]').val();
var reg_phone = $("#reg_phone").val();
var agree = $('input[name=reg_agree]:checked', '#contest_form').attr('value')
if(answer == undefined) { hasError = true; $("#answer_err").css({'background-color' : 'yellow'});} else $("#answer_err").css({'background-color' : '#FFF'});
if(firstname == '') { hasError = true; $("#reg_fn").css({'background-color' : 'yellow'});}
if(lastname == '') { hasError = true; $("#reg_ln").css({'background-color' : 'yellow'});}
if(reg_email == '') { hasError = true; $("#reg_email").css({'background-color' : 'yellow'});}
if(reg_address == '' || reg_address == ' ') { hasError = true; $("#reg_address").css({'background-color' : 'yellow'});}
if(reg_city == '') { hasError = true; $("#reg_city").css({'background-color' : 'yellow'});}
if(reg_state == '') { hasError = true; $("#reg_state").css({'background-color' : 'yellow'});}
if(reg_zip == '') { hasError = true; $("#reg_zip").css({'background-color' : 'yellow'});}
if(reg_cntry == '') { hasError = true; $('select[name=reg_cntry]').css({'background-color' : 'yellow'});}
if(reg_phone == '') { hasError = true; $("#reg_phone").css({'background-color' : 'yellow'});}
if(agree == undefined) { hasError = true; $("#reg_agree").before('
✘
');}
var date = $('#reg_bdateYear').val() + '-' + $('#reg_bdateMonth').val() + '-' + $('#reg_bdateDat').val();
if(date.match(/^[0-9]{4}\-(0[1-9]|1[012])\-(0[1-9]|[12][0-9]|3[01])/)) { $("#reg_bdateDat,#reg_bdateMonth, #reg_bdateYear").css({'background-color' : '#FFF'}); }
else { $("#reg_bdateDat,#reg_bdateMonth, #reg_bdateYear").css({'background-color' : 'yellow'}); }
var dataString = 'answer='+ answer + '&contestNo=' + contestNo + '&firstname=' + firstname
+ '&lastname=' + lastname + '®_email=' + reg_email + '®_address=' + reg_address + '®_city=' + reg_city
+ '®_state=' + reg_state + '®_zip=' + reg_zip + '®_cntry=' + reg_cntry + '®_bdateDat=' + reg_bdateDat + '®_bdateMonth=' + reg_bdateMonth
+ '®_bdateYear=' + reg_bdateYear + '®_phone=' + reg_phone;
if (hasError == undefined) {
$.ajax({
type: "POST",
url: "/include/process/contest_submit.php",
data: dataString,
success: function(data){
if(data == "1-1") { //alert('yep: equal');
}
if(data == "1-2") {}
if(data == "1-2-3") {
$(".contest_form, #tandc").hide("slow");
$(".contest_succes").show("slow");
}
},
error : function(data) {
$(".contest_error").show("slow");
}
});
}
});
$("#map-canvas").click(function() {
var currMarker = $(document).data('currMarker');
if(currMarker) console.log(currMarker);
/*alert('goed:' + currMarker);*/
$.ajax({
type: "POST",
url: "/include/process/gmaps_brands.php",
data: "currMarker="+currMarker,
success: function(data){
$(".logobox"+currMarker).html(data);
},
error : function(data) {
$(".logobox"+currMarker).html('Unable to load brands.');
//alert('Unable to load brands.');
}
});
});
$("#gmap_brandclick").live('click',function(){
var ids = $(this).attr('data');
ids = ids.split('-'); var dealerNR = ids[0]; var brandNR = ids[1];
var geturl = $(this).attr('data');
geturl = geturl.split('-');
var urlParts = geturl.slice(2, geturl.length);
var url = urlParts.join('-');
var dataString = 'dealerNR='+ dealerNR + '&brandNR=' + brandNR + '&url=' + url;
$.ajax({
type: "POST",
url: "/include/process/gmaps_brands_click.php",
data: dataString,
success: function(data){
window.open(url);
},
error : function(data) {
$(".contest_error").show("slow");
}
});
});
/* SHOW POP-UP DIVS */
/* members home page / brands et more */
$('#showpopsignup, a#showpopsignup, #pblock_login').click(function(){ $('#popsignup').show(); return false; }); /* sign in */
$('#closepopsignup').click(function(){ $('#popsignup').hide(); return false; }); /* sign in */
/* members edit panel */
$('.mapdown').click(function(){ $('#m_admin_panel').show(); return false; }); /* member edit profile */
$('html').click(function() { $('#m_admin_panel, .pp_upl_overlay').hide(); });
$('#m_admin_panel, .pp_upl').click(function(event) { event.stopPropagation(); });
$('.mapup').click(function(event){ $('#m_admin_panel').toggle(); });
$('.bdx').click(function(){ $('.bdaybox').show(); return false; });
/* $('.anx').click(function(){ $('.anbox').show(); return false; });
$('.avx').click(function(){ $('.vidzbox').show(); return false; }); */
$('html').click(function() { $('.anbox,.vidzbox,.bdx, .contentBox,#popsignup').hide(); });
$('.anbox,#popsignup,#srl_results').click(function(event){ event.stopPropagation(); });
$('.pp_empty, .pp_set').click(function(){
$('.pp_upl_overlay, .pp_upl').show();
$("#upl_frm").attr("src", '/members/inc.upload.profile.photo.php');
return false;
});
$('.pp_img').hover(function () {
$('.pp_msg_overlay, .pp_msg_txt').show();
},
function () {
$('.pp_msg_overlay, .pp_msg_txt').hide();
}
);
$(".avx").live('click',function() {
$('.contentBox').hide();
var box = $(this).attr('id');
var boxid = '#' + box + '-content';
$(boxid).show();
});
$(".alikem").click(function() {
$('.contentBox').hide();
var box = $(this).attr('id');
var boxid = '#' + box + '-artists';
$.ajax({
type: "POST",
url: "/include/process/member.artistlikes.inc.php",
data:"boxID="+box ,
success : function(data) {
$(boxid).show();
$('#' + box + '-artists').html(data);
}
});
});
$(".mlikem").click(function() {
$('.contentBox').hide();
var box = $(this).attr('id');
var boxid = '#' + box + '-music';
$.ajax({
type: "POST",
url: "/include/process/member.musiclikes.inc.php",
data:"boxID="+box ,
success : function(data) {
$(boxid).show();
$('#' + box + '-music').html(data);
}
});
});
$(".clikem").click(function() {
$('.contentBox').hide();
var box = $(this).attr('id');
var boxid = '#' + box + '-comments';
$.ajax({
type: "POST",
url: "/include/process/member.comments.inc.php",
data:"boxID="+box ,
success : function(data) {
$(boxid).show();
$('#' + box + '-comments').html(data);
}
});
});
$(".bdays").click(function() {
$('.contentBox').hide();
var boxVars = $(this).attr('id');
boxVars = boxVars.split('-'); var box = boxVars[0]; var type = boxVars[1];
var boxid = '#' + box + '-birthdays';
var dataString = 'box='+ box + '&boxid=' + boxid;
if(type === "a") { var gourl = "/artists/inc.artists.birthdays.pu.php"; }
if(type === "m") { var gourl = "/include/process/member.pu.birthdaysm.inc.php"; }
$.ajax({
type: "POST",
url: gourl,
data: dataString,
success : function(data) {
$(boxid).show();
$('#' + box + '-birthdays').html(data);
}
});
});
$(".anx").click(function() {
$('.contentBox').hide();
var boxtype = $(this).attr('id');
var boxcontent = '#' + boxtype + '-box';
var dataString = 'boxtype='+ boxtype + '&boxcontent=' + boxcontent;
$.ajax({
type: "POST",
url: '/include/process/member.pu.artists.inc.php',
data: dataString,
success : function(data) {
$(boxcontent).show();
$('#' + boxtype + '-box').html(data);
},
error : function(data) { $(boxcontent).show().html('Oops! Something went wrong here. The error has been registered in our system and will be solved as soon as possible.'); }
});
});
$(".bnx").click(function() {
$('.contentBox').hide();
var boxtype = $(this).attr('id');
var boxcontent = '#' + boxtype + '-box';
var dataString = 'boxtype='+ boxtype + '&boxcontent=' + boxcontent;
$.ajax({
type: "POST",
url: '/include/process/member.pu.brands.inc.php',
data: dataString,
success : function(data) {
$(boxcontent).show();
$('#' + boxtype + '-box').html(data);
},
error : function(data) { $(boxcontent).show().html('Oops! Something went wrong here. The error has been registered in our system and will be solved as soon as possible.'); }
});
});
$(".mlx").click(function() {
$('.contentBox').hide();
var boxtype = $(this).attr('id');
var boxcontent = '#' + boxtype + '-box';
var dataString = 'boxtype='+ boxtype + '&boxcontent=' + boxcontent;
$.ajax({
type: "POST",
url: '/include/process/member.pu.members.inc.php',
data: dataString,
success : function(data) {
$(boxcontent).show();
$('#' + boxtype + '-box').html(data);
},
error : function(data) { $(boxcontent).show().html('Oops! Something went wrong here. The error has been registered in our system and will be solved as soon as possible.'); }
});
});
$("#btnShowSimple, #scnd, #upload").live('click',function (e) {
ShowDialog(false);
e.preventDefault();
var page = $(this).attr('data-section');
if(page == 'terms') {
$('.web_dialog_title').text("Terms of Use");
$(".web_dialog_content").load("/help/files/termsofuse.txt");
}
if(page == 'copyright') {
$('.web_dialog_title').text("Copyright");
$(".web_dialog_content").load("/help/files/copyright.txt");
}
if(page == 'privacy') {
$('.web_dialog_title').text("Privacy");
$(".web_dialog_content").load("/help/files/privacy.txt");
}
if(page == 'cookie-use') {
$('.web_dialog_title').text("Cookies");
$(".web_dialog_content").load("/help/files/cookie_use.txt");
}
if(page == 'youtube-err') {
$('.web_dialog_title').text("Missing video");
$(".web_dialog_content").load("/help/files/youtube_err.txt");
}
});
$("#btnShowModal").click(function (e) {
ShowDialog(true);
e.preventDefault();
});
$("#btnClose").click(function (e) {
HideDialog();
e.preventDefault();
});
function ShowDialog(modal)
{
$("#overlay").show();
$("#dialog").fadeIn(300);
if (modal) { $("#overlay").unbind("click"); }
else
{
$("#overlay").click(function (e)
{
HideDialog();
});
}
}
function HideDialog()
{
$("#overlay").hide();
$("#dialog").fadeOut(300);
}
/* .... */
/* var country = geoip_country_name(); alert(country);*/