(function($){
  
  $.fn.simplySmartLoginFields = function(options){
    
    options = $.extend({
      searchfldSelector: 'input[name="searchfield"]',
      searchfldValue:    'SEARCH ',
      newsletterfldSelector: 'input[id="ctl00_nname"]',
      newsletterfldValue:    'YOUR NAME',
      cformfldSelector: 'input[name="ctl00$PublicContentPlaceHolder$cname"]',
      cformfldValue:    'NAME',
      cformfld2Selector: 'input[name="ctl00$PublicContentPlaceHolder$cemail"]',
      cformfld2Value:    'EMAIL',
      cformfld3Selector: 'input[name="ctl00$PublicContentPlaceHolder$cmob"]',
      cformfld3Value:    'CONTACT NUMBER',
      cformfld4Selector: 'input[name="ctl00$PublicContentPlaceHolder$ctarea"]',
      cformfld4Value:    'MESSAGE',
      newsletterfld2Selector: 'input[id="ctl00_nemail"]',
      newsletterfld2Value:    'YOUR EMAIL ',
      usernameSelector: 'input[id="ctl00_LoginControl_txtUsername"]',
      passwordSelector: 'input[id="ctl00_LoginControl_txtPassword"]',
      usernameValue:    'USERNAME',
      passwordValue:    'PASSWORD',
      cformfld5Selector: 'input[name="ctl00$PublicContentPlaceHolder$TxtOCCUPATION"]',
      cformfld5Value:    'OCCUPATION',
      cformfld6Selector: 'input[name="ctl00$PublicContentPlaceHolder$TxtOrganization"]',
      cformfld6Value: 'ORGANIZATION'

    }, options);
    
    var searchfld = this.find(options.searchfldSelector);
    searchfld.val(options.searchfldValue);
    searchfld.focus(function(){ if ($(this).val() == options.searchfldValue){$(this).val('');} });
    searchfld.blur(function(){ if ($(this).val() == ''){$(this).val(options.searchfldValue);} });
    
	var newsletterfld2 = this.find(options.newsletterfld2Selector);
    newsletterfld2.val(options.newsletterfld2Value);
    newsletterfld2.focus(function(){ if ($(this).val() == options.newsletterfld2Value){$(this).val('');} });
    newsletterfld2.blur(function(){ if ($(this).val() == ''){$(this).val(options.newsletterfld2Value);} });
	
	var newsletterfld = this.find(options.newsletterfldSelector);
    newsletterfld.val(options.newsletterfldValue);
    newsletterfld.focus(function(){ if ($(this).val() == options.newsletterfldValue){$(this).val('');} });
    newsletterfld.blur(function(){ if ($(this).val() == ''){$(this).val(options.newsletterfldValue);} });
	
	var cformfld = this.find(options.cformfldSelector);
    cformfld.val(options.cformfldValue);
    cformfld.focus(function(){ if ($(this).val() == options.cformfldValue){$(this).val('');} });
    cformfld.blur(function(){ if ($(this).val() == ''){$(this).val(options.cformfldValue);} });
	
	var cformfld2 = this.find(options.cformfld2Selector);
    cformfld2.val(options.cformfld2Value);
    cformfld2.focus(function(){ if ($(this).val() == options.cformfld2Value){$(this).val('');} });
    cformfld2.blur(function(){ if ($(this).val() == ''){$(this).val(options.cformfld2Value);} });
	
	var cformfld3 = this.find(options.cformfld3Selector);
    cformfld3.val(options.cformfld3Value);
    cformfld3.focus(function(){ if ($(this).val() == options.cformfld3Value){$(this).val('');} });
    cformfld3.blur(function(){ if ($(this).val() == ''){$(this).val(options.cformfld3Value);} });
	
	var cformfld4 = this.find(options.cformfld4Selector);
    cformfld4.val(options.cformfld4Value);
    cformfld4.focus(function(){ if ($(this).val() == options.cformfld4Value){$(this).val('');} });
    cformfld4.blur(function(){ if ($(this).val() == ''){$(this).val(options.cformfld4Value);} });

   
	var cformfld5 = this.find(options.cformfld5Selector);
    cformfld5.val(options.cformfld5Value);
    cformfld5.focus(function(){ if ($(this).val() == options.cformfld5Value){$(this).val('');} });
    cformfld5.blur(function(){ if ($(this).val() == ''){$(this).val(options.cformfld5Value);} });



    var cformfld6 = this.find(options.cformfld6Selector);
    cformfld6.val(options.cformfld6Value);
    cformfld6.focus(function () { if ($(this).val() == options.cformfld6Value) { $(this).val(''); } });
    cformfld6.blur(function () { if ($(this).val() == '') { $(this).val(options.cformfld6Value); } });

   
	
	var username = this.find(options.usernameSelector);
    var password = this.find(options.passwordSelector);
    username.val(options.usernameValue);
    password.hide().after('<input type="text" class="txtfld" id="fakepassword" value="'+options.passwordValue+'" />');
    var fakepassword = $('#fakepassword');
    username.focus(function(){ if ($(this).val() == options.usernameValue){$(this).val('');} });
    username.blur(function(){ if ($(this).val() == ''){$(this).val(options.usernameValue);} });
    fakepassword.focus(function(){
      $(this).hide();
      password.show().focus();
    });
    password.blur(function(){
      if ($(this).val() == ''){
        $(this).hide();
        fakepassword.show();
      }
    });
  };
  
})(jQuery);	



$(document).ready(function()
		{
		  $('.searchfld').simplySmartLoginFields();
		  $('.loginbox').simplySmartLoginFields();
		  $('.newsletterbox').simplySmartLoginFields();
		  $('.cform').simplySmartLoginFields();
		  $('textarea').toggleValue();
		  //$('input').toggleValue();
        });



/******************************** fancybox**********/
		$(document).ready(function() {
			/*
			*   Examples - images
			*/

			$("a#example1").fancybox();

			$("a#example2").fancybox({
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});

			$("a#example3").fancybox({
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'	
			});

			$("a#example4").fancybox({
				'opacity'		: true,
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'none'
			});

			$("a#example5").fancybox();

			$("a#example6").fancybox({
				'titlePosition'		: 'outside',
				'overlayColor'		: '#000',
				'overlayOpacity'	: 0.9
			});

			$("a#example7").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#example8").fancybox({
				'titlePosition'	: 'over'
			});

			$("a[rel=picsgroup]").fancybox({
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			$("a[rel=picsgroup2]").fancybox({
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			/*
			*   Examples - various
			*/

			$("#various1").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});

			$("#various2").fancybox();

			$("a.videopl").fancybox({
				'width'				: 355,
				'height'			: 215,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});

			$("#various4").fancybox({
				'padding'			: 0,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});


            $("a.zoomPic").fancybox({
				'titleShow'		: true,
				'opacity'		: true,
				'titlePosition'	: 'over',
                'transitionIn'	: 'elastic',
                'transitionOut'	: 'elastic'
			});
            $("a.watchVideo").fancybox({
			  
               'width' : 360, 
               'height' : 230,
				'autoScale'			: false,
               'titleShow'		: true,
				'transitionIn'	: 'elastic',
				'titlePosition'	: 'inside',
				'type'				: 'iframe' 
			});
			
		$("#sendtofriend").fancybox({
			'transitionIn'	: 'elastic',
			'transitionOut'		: 'elastic',
			'modal' : true
	});
		$("#sendtofriend2").fancybox({
			'transitionIn'	: 'elastic',
			'transitionOut'		: 'elastic',
			'modal' : true
	});

			
			
		});
/*****************************************************/
function sendtodone()
{
  $("#sendtofrm").hide();
  $("#sendtofrm2").hide();
  $('#sendtofeed').animate({'opacity':'show'},{'duration':'slow'});

  
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/******************************************************************************************************
/*************************** nav animation**************************************************
/*

Main Javascript for jQuery Realistic Hover Effect
Created by Adrian Pelletier
http://www.adrianpelletier.com

*/

/* =Realistic Navigation
============================================================================== */

	// Begin jQuery
	
	$(document).ready(function() {

	/* =Reflection Nav
	-------------------------------------------------------------------------- */	
		
		// Append span to each LI to add reflection
		
		$("#nav-reflection li").append("<span></span>");	
		
		// Animate buttons, move reflection and fade
		
		$("#nav-reflection a").hover(function() {
		    $(this).stop().animate({ marginTop: "-10px" }, 200);
		    $(this).parent().find("span").stop().animate({ marginTop: "18px", opacity: 0.25 }, 200);
		},function(){
		    $(this).stop().animate({ marginTop: "0px" }, 300);
		    $(this).parent().find("span").stop().animate({ marginTop: "1px", opacity: 1 }, 300);
		});
				
	/* =Shadow Nav
	-------------------------------------------------------------------------- */
	
		// Append shadow image to each LI
		
		$("#nav-shadow li").append('<img class="shadow" src="images/icons-shadow.jpg" width="81" height="27" alt="" />');
	
		// Animate buttons, shrink and fade shadow
		
		$("#nav-shadow li").hover(function() {
			var e = this;
		    $(e).find("a").stop().animate({ marginTop: "-14px" }, 250, function() {
		    	$(e).find("a").animate({ marginTop: "-10px" }, 250);
		    });
		    $(e).find("img.shadow").stop().animate({ width: "80%", height: "20px", marginLeft: "8px", opacity: 0.25 }, 250);
		},function(){
			var e = this;
		    $(e).find("a").stop().animate({ marginTop: "4px" }, 250, function() {
		    	$(e).find("a").animate({ marginTop: "0px" }, 250);
		    });
		    $(e).find("img.shadow").stop().animate({ width: "100%", height: "27px", marginLeft: "0", opacity: 1 }, 250);
		});
						
	// End jQuery
	
	});
	
	//------------------------------------------------------------------------
	
	
jQuery(document).ready(function() {
      jQuery('#evcarousel').jcarousel({
        vertical: true,
        scroll: 3
    });
  jQuery('#imgscar').jcarousel({
        vertical: false,
        scroll: 1
    });
});
		
		
	$(function() {
		$( "#tabs" ).tabs();
	});







/* =Realistic Navigation
============================================================================== */

	// Begin jQuery
	
	$(document).ready(function() {

	/* =Reflection Nav
	-------------------------------------------------------------------------- */	
		
		// Append span to each LI to add reflection
		
		$("#micons li").append("<span></span>");	
		
		// Animate buttons, move reflection and fade
		
		$("#micons a").hover(function() {
		    $(this).stop().animate({ marginTop: "-7px" }, 200);
		    $(this).parent().find("span").stop().animate({ marginTop: "7px", opacity: 0.25 }, 200);
		},function(){
		    $(this).stop().animate({ marginTop: "0px" }, 300);
		    $(this).parent().find("span").stop().animate({ marginTop: "-5px", opacity: 1 }, 300);
		});
				
	
	});

