var CSite = new Class({
			
	queryString: null,
	
	initialize: function()
	{
		// use a regular expression
		// to pull the query string
		var regQuery	= /\?([^\#]*)/;
		var arrQuery	= regQuery.exec(document.location.href);
		var strQuery	= null;
		
		if(arrQuery && arrQuery.length == 2)
			strQuery = arrQuery[1]; // the query string
		
		// create a hash
		var objHash 	= new Object();
		
		// if we have a query string
		if(strQuery)
		{
			var arrHash 	= strQuery.split("&");
			for(var i = 0; i < arrHash.length; i++)
			{
				var arrParts = arrHash[i].split("=");
				if(arrParts.length == 2)
					objHash[arrParts[0]] = arrParts[1];
			}
		}
		this.queryString = new Hash(objHash);
	},
	
	changeQueryValue: function(strName, strValue)
	{
		var newQueryString 		= this.queryString;
		var strNewQueryString 	= null;
		
		if(newQueryString)
		{
			if(strValue)
				this.queryString.set(strName, strValue);
			else
				this.queryString.erase(strName);
				
			strNewQueryString = this.queryString.toQueryString();
		}
		
		return strNewQueryString;
	},
	
	createSEOTitle: function(strTitle)
	{
		var strEncoded 	= strTitle.toLowerCase();
		strEncoded 		= strEncoded.replace(/[\?':,\.\\\"]/g, "");
		strEncoded 		= strEncoded.replace(/\s/g, "-");
		strEncoded 		= strEncoded.replace(/&/g, "and");
		//strEncoded		= strEncoded.replace(new RegExp("["+String.fromCharCode(233)+"]"), "e");
		/*strEncoded 		= strEncoded.replace(/[йки]/, "e");
		strEncoded 		= strEncoded.replace(/[бваг]/, "a");*/
		
		return strEncoded;
	},
	
	disableAnchor: function(mxLabel)
	{
		// assume failure
		var bDisabled 	= false;
		
		// try and locate the item
		var elTarget	= $(mxLabel);
		
		// if we located it
		if(elTarget)
		{
			// disable the link
			if(Browser.Engine.trident) // IE
				elTarget.onclick = function(){ return false; };
			else // FF, Safari, Opera
				elTarget.setAttribute('onclick', 'return false');
			
			// declare success
			bDisabled = true;
		}
		
		// return the result
		return bDisabled;
	},
	
	disableForm: function(mxForm)
	{
		// assume failure
		var bDisabled 	= false;
		
		// try and locate the item
		var elTarget	= $(mxForm);
		
		// if we located it
		if(elTarget)
		{
			// disable the link
			if(Browser.Engine.trident) // IE
				elTarget.onsubmit = function(){ return false; };
			else // FF, Safari, Opera
				elTarget.setAttribute('onsubmit', 'return false');
			
			// declare success
			bDisabled = true;
		}
		
		// return the result
		return bDisabled;
	},
	
	checkStrength: function(strPass)
	{
		var regPunc 	= /[[:punct:]]/;
		var regLower	= /[a-z\s]/;
		var regUpper	= /[A-Z]/;
		var regNumeric	= /[0-9]/;
		var iScore 		= 0;
		
		if(regPunc.test(strPass))
			iScore += 10;
		
		// lower case alpha or space
		if(regLower.test(strPass))
			iScore += 10;
		
		// upper case alpha
		if(regUpper.test(strPass))
			iScore += 10;
			
		// numbers
		if(regNumeric.test(strPass))
			iScore += 10;
		
		// add to the score based on length
		iScore += Math.min(60, strPass.length * 5);
		
		// return it
		return iScore;
	}
});

site = new CSite();