	function noSpam(user,domain)
	{
					 window.location = "mailto:" + user + "@" + domain;
	} 

	function refreshPage(main,params)
	{
			//url='main.php?mode='+mode;
			url=main;
			if (params!=undefined)
					url+=params;
			location.replace(url);
	}	
	
	function category_changeDisplay(id,mainimages) {
		var element = document.getElementById(id);
		var display_block_value = 'block';
		var display_none_value = 'none';
		if (element != null) {
			if(element.style.display == display_block_value) {
				element.style.display = display_none_value;
			} else {
				element.style.display = display_block_value;
			}
		}
	}	
	
	function OpenWindow(theURL,width,height,windowname,html)
	{
		if (windowname == undefined)
			windowname='';
		if (html!=undefined)
		{
			var ww = parseFloat(width)+20;
			var wh = parseFloat(height)+20;
			var params = 'width='+ww+',height='+wh+',toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no';

			var html = '<html><head><style type="text/css">\n'+
					'body,html { text-align: center; margin: 0px; padding: 0px;}\n'+
					'</style></head><body>\n'+
					'<a onclick="window.close();"><img src="'+theURL+'" width="'+width+'" height="'+height+'" border="0" alt=""/></a>\n'+
					'</body></html>';

			newwindow=window.open('',windowname,params);
			newwindow.document.write(html);
		}
		else
			window.open(theURL,windowname,'height='+height+',width='+width+',menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,right=0,bottom=0');
	}

	function randomPassword(length)
	{
			chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
			pass = '';
			for(x=0;x<length;x++)
			{
					i = Math.floor(Math.random() * 62);
					pass += chars.charAt(i);
			}
			return pass;
	}
	
	
	function changeDisplay(id) {
	
		var element = document.getElementById(id);

		if (element != null) {
				if(element.style.display == 'block') {
						element.style.display = 'none';
				} else {
						element.style.display = 'block';
				}
		}
	}	
	
	function disableSubmitElement(name)
	{
			document.getElementById(name).disabled=true;
			document.getElementById(name).className='submit_disabled';
	}
	function enableSubmitElement(name)
	{
			document.getElementById(name).disabled=false;
			document.getElementById(name).className='submit';		
	}		
