
$(document).ready( function()
					{
		
						$(".inputBg input").focus( function()
							{	
								$(this).parent("span").addClass("inputBgH");								
								$(this).next("span#worng").fadeIn("slow");	
							}						
							)
						$(".inputBg input").blur(function()
							{	
								
								$(this).parent("span").removeClass("inputBgH");
								$(this).next("span#worng").fadeOut("slow");	
								
							}						
							)
					}					
							
				  )


$( function ()
	{
			$('#subBut').click (function()
				{
				  var name = $("input#fname").val();
					if (name == "") 
						{							
						  $("span#fname_error").fadeIn('slow');
						  $("input#fname").focus();
						  return false;
						}
	
			
				}
			);

			$('#subBut').click (function()
				{
				  var lname = $("input#lname").val();
					if (lname == "") 
						{
						  $("span#lname_error").fadeIn('slow');
						}						
				}
			);

			$('#subBut').click (function()
				{
				  var email = $("input#email").val();	
				  
					if (!emailCheck(email)) 
						{						  
						  $("span#email_invalid_error").fadeIn('slow');
						  //$("input#email").focus();
						  //return false;
						}
				
					else
						{
							$("span#email_invalid_error").fadeOut();
							
						}
			
				}
			);


			$('#subBut').click (function()
				{
				  var reemailAdd = $("input#remail").val();
					if (reemailAdd == "") 
						{							
						  $("span#remail_error").fadeIn('slow');
						
						}	
			
				}
			);

			$('#subBut').click (function()
				{					
				  var pass = $("input#pws").val();
					if (pass == "") 						
						{							
						  $("span#pws_error").fadeIn('slow');
						}					
			
				}
			);
			
			

		$('#subBut').click (function()
				{
				
				  var repass = $("input#repws").val();
				  
					if (repass=="") 
						{
						$("span#repwserror").fadeIn('slow');
						}
			
				}
			);
			
			
			
			
			$('#subBut').click (function()
				{
				  var secQues = $("select#captcha").val();
					if (secQues  == "") 
						{
						  $("span#captcha").fadeIn('slow');
						  //$("input#secQ").focus();
						 // return false;
						}
					else
						{
							$("span#secQ_error").fadeOut();
						}
			
				}
			);


			$('#subBut').click (function()
				{
				  var secAns = $("input#secA").val();
					if (secAns  == "") 
						{
						  $("span#secA_error").fadeIn('slow');
						 // $("input#secA").focus();
						 // return false;
						}
					else
						{
							$("span#secA_error").fadeOut();
						}
			
				}
			);


	

	}

)

/* dropdown */

$(document).ready(function(){
	$("li.subnav").hover(function() { 
		$(this).find("ul").slideDown('fast');
		$(this).find("ul li.subnav ul").slideUp(-10000); /* 2nd label */
			
		}, function(){	
			$(this).find("ul").slideUp('fast');
		});

});

function openSignIn() { 

		 //$('span.forgetContainer').fadeOut('slow');		 
		$("ul#signBox").fadeIn('slow');		
			
								  }


function openForgotPassword()
{

					$('span.forgetContainer').fadeIn('slow');
					$('span.sign').fadeIn('slow');
}
/* sign in */
$(document).ready(function(){
	$("input#password").click(function() { 
				 
			$('span.forgetContainer').css('display','none');			
			$('span.sign').fadeIn('slow');	
			
		});
		
		$('a').click(function()									   
			 {
				  
					
					
		});
		
	$("a.forget").click(function() { 
		$('span.sign').css('display','none');	
		$('span.forgetContainer').fadeIn('slow');	
			
		});
	
});


$(document).ready(function(){
	/* light box show */					   
	$("a.open").click( function() {	
		$("div.on").fadeIn("slow");
		$(".overOuter").fadeIn("slow");	
						 
	});
	/* light box hide */
	$(".ClickClose").click( function() {	
		$("div.on").fadeOut("slow");
		$(".overOuter").fadeOut("slow");							 
	});
	
	/* delete light box suggest a show */
	$("a.open").click( function() {			
		$(".deletePopup").fadeIn("slow");	
						 
	});
	/* delete light box suggest a hide */
	$(".ClickClose").click( function() {		
		$(".deletePopup").fadeOut("slow");					 
	});
	
	/* sucessfull upload div */
	$("#sub").click( function() {	
		$("div.right").slideDown("slow");		
		setTimeout("$('div.right').slideUp('slow');",5000);		
	});
	/* phone no div toogle */
	$('input:radio.mobile').click( function() {	
		if (this.value == "yes")
			{
				
				$(".phoneShow").slideDown("slow");
			}
		else (    $(".phoneShow").slideUp("slow")
			);
		
	});
	
	
	
	
	/* Invited all friend*/
	$('input:image.inviteBtnAll').click( function() {			
		$(".invitedDiv").fadeIn("slow");	
		
	});

	$('input:image.inviteBtn').click( function() {			
		$(this).parents().next(".invitedDiv").fadeIn("slow");			
		
	});
	
	$('input:image.inviteBtned').click( function() {			
		$(this).parents(".invitedDiv").fadeOut("slow");	
		/*$(this).parents(".invitedDiv").append("<span>slow</span>");*/
			
	});
	
	
	/* inbox functions */
	$('a.mesgShow').click( function() {		
		
		$(this).parent().nextAll(".message").slideToggle("slow");	
		
	});
	
	/* reply div */
	$('a.reply').click( function() {			
		$(this).parents().next(".replyDiv").slideToggle("slow");	
		
	});
	
	/* account settings */
	$('div.accountHeading').click( function() {			
		$(this).next(".accountData").slideToggle("slow");	
		$(this).toggleClass("accountHeadingDown");
		
	});
	
	/* home page comments */
	$('a.comment').click( function() {			
		$(this).parents().nextAll("span.comments").slideToggle("slow");		
				
	});
	
		/* home page comments */
	$('a.adviwer').click( function() {								   
		$("span.adviwer1").slideUp("slow");		
		$(this).nextAll("span.adviwer1").slideToggle("slow");		
				
	});
	$('span.adClose').click( function() {							
	$(this).parents("span.adviwer1").slideUp("slow")			
	});
	
	/* adviwer dropdown*/
	$("li.advNav").hover(function() { 
		 $(this).find("span.aero").removeClass("aero");
		 $(this).css("position","relative");
		 $(this).find("span").addClass("aeroDown");		
		 $(this).find("ul").slideDown('fast');
					
		}, function(){			
			$(this).find("ul").slideUp('fast');			
			$(this).find("span.aeroDown").removeClass("aeroDown");
			$(this).find("span").addClass("aero");
			/*$(this).css("position","static");*/
			
		});
	
	
	/*Edit profile page*/
	$('a.editOpen').click( function() {		
								
		$("div.editScroll").slideUp("slow");	
		$("span.blank").removeClass("editAero");
		$("span.blank").addClass("editAeroDown");
		
		$(this).parent().next("div.editScroll").slideDown("slow");
		$(this).next("span.blank").removeClass("editAeroDown");
		$(this).next("span.blank").addClass("editAero");
		
				
	});
	
	
	/* light box for show view friends page */					   
	$("input.open").click( function() {	
		$("div.on").fadeIn("slow");
		$(".overOuter").fadeIn("slow");	
						 
	});
	
	$("span.addG").click( function() {	
		$("div.groupListing").css("display", "none");
		$("div.groupAdd").fadeIn("slow");
		
						 
	});	
	$("span.hide").click( function() {			
		$("div.groupAdd").css("display", "none");
		$("div.groupListing").fadeIn("slow");
						 
			
	});
	
	
	/* light box show */					   
	$("a.delete").click( function() {	
		$("div.on").fadeIn("slow");
		$(".overOuterDelete").fadeIn("slow");	
						 
	});
	/* light box hide */
	$(".ClickClose").click( function() {	
		$("div.on").fadeOut("slow");
		$(".overOuterDelete").fadeOut("slow");							 
	});
	
	/* rsvp */
	
	$('a.rsvpOpen').click( function() {	
		$("span.rsvp").slideUp("slow");		
		$(this).parent().next("span.rsvp").slideToggle("slow");		
				
	});
	
	$('a.rsvpClose').click( function() {		
		$(this).parents("span.rsvp").slideUp("slow");		
				
	});
	
	/* rsvp new */
	
	$('a.rsvpOpenn').click( function() {	
		$("span.rsvpnew").slideUp("slow");		
		$(this).parent().next("span.rsvpnew").slideToggle("slow");		
				
	});
	
	$('a.rsvpClosen').click( function() {		
		$(this).parents("span.rsvpnew").slideUp("slow");		
				
	});
	
	/* manage brand page*/
	$('li#c1').click( function() {		
		$(this).addClass("active");	
		$("li#c2").removeClass("active");
		$("#b1").css("display","block");
		$("#b2").css("display","none");
	});
	$('li#c2').click( function() {		
		$(this).addClass("active");	
		$("li#c1").removeClass("active");
		$("#b2").css("display","block");
		$("#b1").css("display","none");
	});
	$("div.viewFriendRowNew").hover(function() { 
		 $(this).css("background-color", "#D7EEF4");
		 $(this).find("span.removeFriends").css("display","block");
					
		}, function(){			
			
			$(this).css("background-color", "#fff");
			$(this).find("span.removeFriends").css("display","none");
			
		});
	/* No Friend */
	$("div.noFriendRowNew").hover(function() { 
		 //$(this).css("background-color", "#D7EEF4");
					
		}, function(){			
			
			//$(this).css("background-color", "#fff");
			
		});
	/* home page left menu */
	
	$('ul.leftMenu li').click( function() {	
		$(this).parents().find("li.active") .removeClass("active");								
		$(this).addClass("active");		
	});
	
	$('ul.leftMenu li.network').click( function() {	
		$('#network').slideDown("slow");
		$('#friends').slideDown("slow");
		$('#love').slideDown("slow");
		$('#category').slideDown("slow");
	});
	$('ul.leftMenu li.brandsLeft').click( function() {	
		$('#network').slideDown("slow");
		$('#friends').slideUp("slow");
		$('#love').slideUp("slow");
		$('#category').slideUp("slow");
	});
	$('ul.leftMenu li.friendsFind').click( function() {	
		$('#network').slideUp("slow");
		$('#friends').slideDown("slow");
		$('#love').slideUp("slow");
		$('#category').slideUp("slow");
	});
	$('ul.leftMenu li.local').click( function() {	
		$('#network').slideUp("slow");
		$('#friends').slideUp("slow");
		$('#love').slideDown("slow");
		$('#category').slideUp("slow");
	});
	$('ul.leftMenu li.category').click( function() {	
		$('#network').slideUp("slow");
		$('#friends').slideUp("slow");
		$('#love').slideUp("slow");
		$('#category').slideDown("slow");
	});
	
	/* marketer section left menu home page */
	$('ul.leftMenu li.community').click( function() {	
		$('#community').slideDown("slow");
		$('#compaign').slideUp("slow");		
		$('#network').slideUp("slow");
	});
	$('ul.leftMenu li.campaign').click( function() {	
		$('#community').slideUp("slow");
		$('#compaign').slideDown("slow");		
		$('#network').slideUp("slow");
	});
	$('ul.leftMenu li.networkMarketer').click( function() {	
		$('#community').slideUp("slow");
		$('#compaign').slideUp("slow");		
		$('#network').slideDown("slow");
	});
	
	
	/* find friend remove */
	
	$("a.remove").click( function() {	
		$(this).parents(".viewFriendRowNew").slideUp("slow");
							 
	});
	
	
	/* tooltip */
	$(".imageToolTip").hover(function()
					{
						var imgPath = $(this).find('img').attr('src');
						$(this).append('<span class="toolTip"> <img src=\''+imgPath+'\'> </span>');
						$(this).find('span').css('display','none');
						$(this).find('span').fadeIn('slow');
					}, function()
					{
						$(this).find('span').remove('');
											
						});
	
	
	/* marketer create campaign  actions */
	
	$(".campaignInputContainer input:checkbox").click( function ()
														 
		{		
		$(this).nextAll(".cActions").slideDown("slow");
		
		});
		
		

	$("select").change(function () {
          var str = "";
          $("select option:selected").each(function () {
                str += $(this).text() + " ";
              });
          $("span#selectValue").text(str);
		
        })
        .trigger('change');


});





$(document).ready( function()
	{
	var currentPosition = 0;
	var slides = $('.slide');
	var slideWidth = 137;       /* change image size (same size in css)*/
	var totalSlide = slides.length;	
	
	
	// remove scroller 	
	$('#slideCon').css('overflow', 'hidden');
	// wrape all slide	
	slides.wrapAll('<div id="slideInner"></div>');
	$('#slideInner').css( {'float' : 'left', 'width' : slideWidth * totalSlide});
	$(slides).css('float', 'left');	
	// insert left aero and right aero
	$('#slideContainer').prepend('<span id="left" class="control" > &nbsp; </span> <span id="leftdis" class="controldis"  > &nbsp; </span>')
	$('#slideContainer').append('<span id="right" class="control" > &nbsp; </span> <span id="rightdis" class="controldis" > &nbsp; </span>');
	manageControl(currentPosition);	
	
	$('.control').click(function()
		{
			currentPosition = ($(this).attr('id') == 'right') ? currentPosition-1 : currentPosition+1;			
			$('#slideInner').animate({'marginLeft': slideWidth * currentPosition});			
			manageControl(currentPosition);			
		});
		
	function manageControl(position)
		{
			if (position == 0)	
				{					
					$('#left').fadeOut("fast");	
					$('#leftdis').fadeIn("slow");	
					$('#leftdis').attr("disabled", true); 
									
				}
			else{
					$('#leftdis').fadeOut("slow");
					$('#left').fadeIn("fast");		
				}
				
			if (position == -(totalSlide)+5 )	
				{				
					$('#right').fadeOut("fast");
					$('#rightdis').fadeIn("slow");
					$('#rightdis').attr("disabled", true); 						
					return false;	
				}
				
			else {
					$('#rightdis').fadeOut("fast");
					$('#right').fadeIn("fast");		
				}		
			
			
			if (totalSlide == 4)	
				{					
					$('#right').fadeOut("fast");
					$('#rightdis').fadeIn("slow");						
				}
			else{
					$('#rightdis').fadeOut("slow");
					$('#right').fadeIn("fast");		
				}
			
			
			}
			
		$("#slideInner img").click( function()
					{
					$('#slideInner').find('img').removeClass('active' );
					$(this).addClass('active');
					var imgPathBig = $(this).attr('src');	
								
					$("#productBigPic").html(' <span> <img src=\''+imgPathBig+'\'> <span>')
					
					});
	
	})
				



/* rajeev*/

















/* URL Redirect Function */


function KeyPress(e)
{
	var code =(window.event)? event.keyCode : e.which;
	if(code==13) {
	//alert('Enter key');
	window.location="home.html";
	}
}


this.tooltip = function(){	
	/* CONFIG */		
		xOffset = -10;
		yOffset = 15;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};



// starting the script on page load
$(document).ready(function(){
	tooltip();
});

// End Tooltip 
function showDel(a){
	document.getElementById(a).style.display='block'
}
function hideDel(b){
	document.getElementById(b).style.display='none'
}



//////////////// Drop Down JS /////////////////

$.fn.customSelect = function() {
  // define defaults and override with options, if available
  // by extending the default settings, we don't modify the argument
 return this.each(function() {  
 obj = $(this);  
obj.after("<div id=\"selectoptions\"> </div>");
obj.find('option').each(function(i){ 
  $("#selectoptions").append("<div id=\"" + $(this).attr("value") + "\" class=\"selectitems\"><span>" + $(this).html() + "</span></div>");
});
obj.before("<input type=\"hidden\" value =\"\" name=\"" + this.name + "\" class=\"customselect\"/><div id=\"iconselect\">" + this.title + "</div><div id=\"iconselectholder\"> </div>")
.remove();
$("#iconselect").click(function(){
$("#iconselectholder").toggle("slow");});
	$("#iconselectholder").append( $("#selectoptions")[0] );
$(".selectitems").mouseover(function(){
	$(this).addClass("hoverclass");
});
	$(".selectitems").mouseout(function(){
	$(this).removeClass("hoverclass");
	});
	$(".selectitems").click(function(){
	$(".selectedclass").removeClass("selectedclass");
	$(this).addClass("selectedclass");
	var thisselection = $(this).html();
$(".customselect").val(this.id);
	$("#iconselect").html(thisselection);
	$("#iconselectholder").toggle("slow")
	});
    });  
  // do the rest of the plugin, using url and settings
}

 $( function ()
	{
	$('a.hideli').click ( function ()
	{
	//$( this).parent("li").hide();
	$(this).parents('.add').hide("slow");
	//$('li.add').hide();
	})
	})
	
	$( function ()
	{
	$('a.hideli').click ( function ()
	{
	//$( this).parent("li").hide();
	$(this).parents('.friendsView').hide("slow");
	//$('li.add').hide();
	})
	})
	
	$( function ()
	{
	$('a.hideli').click ( function ()
	{
	//$( this).parent("li").hide();
	$(this).parents('.viewProfileEdit').hide("slow");
	//$('li.add').hide();
	})
	})
