function setGlobalOnLoad(f){var root=window.addEventListener||window.attachEvent?window:document.addEventListener?document:null;if(root){if(root.addEventListener)root.addEventListener("load",f,false);else if(root.attachEvent)root.attachEvent("onload", f);}else{if(typeof window.onload == 'function'){var existing=window.onload;window.onload=function(){existing();f();}}else{window.onload=f;}}}
var imcom = new Array();
var rlim = new Array(); 
var rlimold = new Array(); 
var xxxofs; 

function check_bla_bla(){
// this function not use
// replaced by imagePreview();
// u can find this function in bottom this file
var i=0; 
$("img").each(

function(){
if(/\/?content\//.test( this.src )){ 
	rlim[i] = $('<img id="hidimg"'+i+' completed="" />').attr('src',  this.src+'&size='+google_ad_stylekey2);

 rlimold[i] = this.src;
 i++;
 xOffset = -25; yOffset = 40; 
$(this).hover(function(e){
for(imj=0; imj< rlimold.length; imj++){
	if(rlimold[imj] && rlimold[imj] == this.src){
this.t = this.title;
var c=(this.title != "") ? "<br/>" + this.title : "";
this.title="";
$(this).parent().title='';
this.alt='';
xxxofs = rlim[imj].attr('width');
xxxofs = xxxofs == 0 ? 120 : xxxofs;
$("body").append($("<p id='preview'></p>").append(rlim[imj])); 
$("#preview").css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX - yOffset - rlim[imj].attr('width')) + "px").fadeIn("fast");
break;
	}
}
},function(){ this.title=this.t;$("#preview").remove();});$(this).parent().mousemove(function(e){$("#preview") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX - yOffset - xxxofs) + "px");});}

});

}
setGlobalOnLoad(check_bla_bla);

        var patt0=new RegExp(".*/user_contacts.php$");
            if(!patt0.test(document.location)) {
$(document).bind("contextmenu",function(e){if(e.target.type != 'text' && e.target.type != 'password') return false;});
$('input[type="text"]').unbind('contextmenu',function(e){return false;});
}

function limitChars(textid, limit, infodiv) { 
var text = $('#'+textid).val(); 
var textlength = text.length; 
if(textlength > limit) { 
	$('#' + infodiv).html('You exceeded the ' + limit + ' character limit for status!'); 
	$('#'+textid).val(text.substr(0,limit));
	return false;
} else {
	$('#' + infodiv).html('You have '+ (limit - textlength) +' characters left.');
	return true;
}
}
$(function(){
$('#txtmessage').keyup(function(){
limitChars('txtmessage', 150, 'charlimitinfo');
})
$('#txtaboutme').keyup(function(){
limitChars('txtaboutme', 1000, 'charlimitinfoabout');
})
});
this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = -25;
		yOffset = 40;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
		$(".statusContainer img").each(

				function(){
				if(/\/?content\//.test( this.src )){
					$(this).addClass('preview');
					
				}});
	$(".statusContainer img.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		xxxofs = $(this.src).attr('width')		
		xxxofs = xxxofs == 0 ? 120 : xxxofs;
		$("body").append("<p id='preview'><img src='"+ this.src+"&size="+google_ad_stylekey4+"' alt='Image preview' />"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$(".statusContainer img.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


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