function clearbox(box) {
		 if(box.value==box.defaultValue) {
	 	 	 box.value = "";
	 	 }
	 }
	 
/* CHAR COUNT */
(function($) {

	$.fn.charCount = function(options){
	  
		// default configuration properties
		var defaults = {	
			allowed: 140,		
			warning: 25,
			css: 'counter',
			counterElement: 'span',
			cssWarning: 'warning',
			cssExceeded: 'exceeded',
			counterText: ''
		}; 
			
		var options = $.extend(defaults, options); 
		
		function calculate(obj){
			var count = $(obj).val().length;
			var available = options.allowed - count;
			if(available <= options.warning && available >= 0){
				$(obj).next().addClass(options.cssWarning);
			} else {
				$(obj).next().removeClass(options.cssWarning);
			}
			if(available < 0){
				$(obj).next().addClass(options.cssExceeded);
			} else {
				$(obj).next().removeClass(options.cssExceeded);
			}
			$(obj).next().html(options.counterText + available);
		};
				
		this.each(function() {  			
			$(this).after('<'+ options.counterElement +' class="' + options.css + '">'+ options.counterText +'</'+ options.counterElement +'>');
			calculate(this);
			$(this).keyup(function(){calculate(this)});
			$(this).change(function(){calculate(this)});
		});
	  
	};

})(jQuery);
/* CHAR COUNT */
	 
/* LIMIT CHARACTERS */
	$(document).ready(function(){	
		//default usage

		$("#description").charCount({
			allowed: 250,		
			warning: 20,
			counterText: 'Characters left: '	
		});
		$("#anchorone").charCount({
			allowed: 50,		
			warning: 20,
			counterText: 'Characters left: '	
		});
			$("#anchortwo").charCount({
			allowed: 50,		
			warning: 20,
			counterText: 'Characters left: '	
		});
	});
/* LIMIT CHARACTERS */

/* PREVIEW */
$(function(){
 
$(".text").keyup(function(){
var word=$(this).val();
$(".text_preview").html(word);
return false;
});

$("#company").keyup(function(){
var weburl=$(this).val();
$(".addcompany").html(weburl);
return false;
});

$("#description").keyup(function(){
var desc=$(this).val();
$(".adddesc").html(desc);
return false;
});
 
$("#website").keyup(function(){
var weburl=$(this).val();
$(".addurl").html(weburl);
return false;
});

$("#anchorone").keyup(function(){
var weburl=$(this).val();
$(".ancone").html(weburl);
return false;
});

$("#anchortwo").keyup(function(){
var weburl=$(this).val();
$(".anctwo").html(weburl);
return false;
});
 
});
/* PREVIEW */

/* TOOL */
(function($) {
    $.fn.tipsy = function(options) {

        options = $.extend({}, $.fn.tipsy.defaults, options);
        
        return this.each(function() {
            
            var opts = $.fn.tipsy.elementOptions(this, options);
            
            $(this).hover(function() {

                $.data(this, 'cancel.tipsy', true);

                var tip = $.data(this, 'active.tipsy');
                if (!tip) {
                    tip = $('<div class="tipsy"><div class="tipsy-inner"></div>');
                    tip.css({position: 'absolute', zIndex: 100000});
                    $.data(this, 'active.tipsy', tip);
                }

                if ($(this).attr('title') || typeof($(this).attr('original-title')) != 'string') {
                    $(this).attr('original-title', $(this).attr('title') || '').removeAttr('title');
                }

                var title;
                if (typeof opts.title == 'string') {
                    title = $(this).attr(opts.title == 'title' ? 'original-title' : opts.title);
                } else if (typeof opts.title == 'function') {
                    title = opts.title.call(this);
                }

                tip.find('.tipsy-inner')[opts.html ? 'html' : 'text'](title || opts.fallback);

                var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
                tip.get(0).className = 'tipsy'; // reset classname in case of dynamic gravity
                tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
                var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;
                var gravity = (typeof opts.gravity == 'function') ? opts.gravity.call(this) : opts.gravity;

                switch (gravity.charAt(0)) {
                    case 'n':
                        tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');
                        break;
                    case 's':
                        tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south');
                        break;
                    case 'e':
                        tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east');
                        break;
                    case 'w':
                        tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west');
                        break;
                }

                if (opts.fade) {
                    tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 0.8});
                } else {
                    tip.css({visibility: 'visible'});
                }

            }, function() {
                $.data(this, 'cancel.tipsy', false);
                var self = this;
                setTimeout(function() {
                    if ($.data(this, 'cancel.tipsy')) return;
                    var tip = $.data(self, 'active.tipsy');
                    if (opts.fade) {
                        tip.stop().fadeOut(function() { $(this).remove(); });
                    } else {
                        tip.remove();
                    }
                }, 100);

            });
            
        });
        
    };
    
    // Overwrite this method to provide options on a per-element basis.
    // For example, you could store the gravity in a 'tipsy-gravity' attribute:
    // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
    // (remember - do not modify 'options' in place!)
    $.fn.tipsy.elementOptions = function(ele, options) {
        return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
    };
    
    $.fn.tipsy.defaults = {
        fade: false,
        fallback: '',
        gravity: 'n',
        html: false,
        title: 'title'
    };
    
    $.fn.tipsy.autoNS = function() {
        return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
    };
    
    $.fn.tipsy.autoWE = function() {
        return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
    };
    
})(jQuery);
/* TOOL */

/* CALL TOOL */
  $(function() {
    $('#tips [title]').tipsy({trigger: 'focus', gravity: 'e'});
  });
/* CALL TOOL */


// SHOW HIDE DIV
window.onload=function() { 
spn=document.getElementsByTagName('span'); 
for(c=0;c<spn.length;c++) { 
spn[c].onclick=function() { 
if(this.id!='') { 
stuff(this.id.split('s')[1]); 
} 
} 
} 
} 
function stuff(n) { 

dvs=document.getElementsByTagName('div'); 
ims=document.getElementById('faqwrap').getElementsByTagName('img');
info=document.getElementById('div'+n); 
//pic=document.getElementById('img'+n);// 

for(c=0;c<dvs.length;c++) { 
if((dvs[c].className=='on')&&(dvs[c].id!='div'+n)) { 
dvs[c].className='off'; 
} 
} 
for(c=0;c<ims.length;c++) { 
ims[c].src='images/assets/faqplus.gif'; 
} 
if(info.className=='on') { 
info.className='off'; 
//pic.src='images/assets/faqplus.gif'; //
} 
else { 
info.className='on'; 
//pic.src='images/assets/faqminus.gif'; //
} 
}
// SHOW HIDE DIV
