﻿//Input text hint
jQuery.fn.inputFieldText = function(string) {          
    this.each(function() { 
        $(this).val(string); 
        $(this).focus(function(){ 
            if ($(this).val() == string){ 
                $(this).val(''); 
            } 
        }); 
        $(this).blur(function(){ 
            if ($(this).val() == '' ){ 
                $(this).val(string); 
            } 
        });     
    }); 
}

//email hide
jQuery.fn.mailme = function() {
    var at = / at /;
    var dot = / dot /g;
    this.each( function() {
        var addr = jQuery(this).text().replace(at,"@").replace(dot,".");
        var title = jQuery(this).attr('title')
        $(this)
            .after('<a href="mailto:'+addr+'" title="'+title+'">'+ addr +'</a>')
            .remove();
    });
};


function linkage()
{
  $(".linkElement").click(function(){
	 window.location=$(this).find("a").attr("href");return false;
	});
}





Cufon.replace('#mainmenu a, #submenu a,.read_more, .tbl th, .slide_content, h1,h2,h3,h4,h5,h6,.iw_modulheader_heading, .cufonize, #footer_t', { fontFamily: 'anivers',
	hover: true
	
});



$(document).ready(function(){

 $(".linkElement").click(function(){
	 window.location=$(this).find("a").attr("href");return false;
	});
	
   
  
/*Print*/  

$("#print_page").click(function(){
	
	 window.print();

	});
	
	//---------------------------------------------------------------------
	
	$('.HintText').each(function(){
		var txt = $(this).val();
		if(!empty(txt)){
			$(this).HintText(txt);
		}
	});
	
	$('.EmailerSubscription input.textbox').each(function(){
		var hint = $(this).attr('title');
		if($(this).val() == ""){
			$(this).val(hint);
		}
		
		$(this).focus(function(){
			var hint = $(this).attr('title');
			if($(this).val() == hint){
				$(this).val('');
			}
		});
		
		$(this).blur(function(){
			var hint = $(this).attr('title');
			if($(this).val() == ""){
				$(this).val(hint);
			}
		});
	});

//---------------------------------------------------------------------
  
  	$(".carousel").jCarouselLite({
    	btnNext: ".next",
    	btnPrev: ".prev",
    	speed: 800,
    	visible: 1,
    	afterEnd: function(a) {
    		Cufon.refresh();
    	}
	});
 
//----------------------------------------------------------------
	
	$(function(){ //discus
		var dhtml = '<div id="disqus_thread"></div> \
		<script type="text/javascript" src="http://roiteatteri.disqus.com/embed.js"></script> \
        <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> \
        <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>';
		$('.disqus').html(dhtml);
	});
	
	
 
});


