/*
core.js by giobi.com 2010-01

*/

function rand(top) {
	return Math.floor(Math.random()*top)
}
function validmail(emailAddress) {
		var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
		return pattern.test(emailAddress);
	}

function getanchor() {
	var query = location.href.split('#');
	return query[1];
}

function redirect(loc) {
	location.replace(loc);
}

function token() {
	return '&_='+ rand(99999);
}

function roundTo(decimalpositions)
{
    var i = this * Math.pow(10,decimalpositions);
    i = Math.round(i);
    return i / Math.pow(10,decimalpositions);
}
Number.prototype.round = roundTo; 

/*
giobi.com 2011-04-ilye



(function($) {
	$.fn.zerofill = function(options) {
		debug(this);
		var opts = $.extend({}, $.fn.share.defaults, options);
		
		//number
		width -= number.toString().length;
		
		if (width > 0) {
			return new Array( width + (/\./.test( number ) ? 2 : 1) ).join( '0' ) + number;
		}
		return number;
	};
	
	function debug($obj) {
		if (window.console && window.console.log) window.console.log('[utils] count: ' + $obj.size());
	};	
	$.fn.share.defaults = {
		fb: '<a href="fb">Facebook</a>',
		email: '<a href="mailto:insert address"></a>'
	};
})(jQuery);
*/
