// JavaScript Document

<!--
	function changeImage(source,image)
	{
	//alert(source + "\n" + image);
		if (navigator.appName == "Microsoft Internet Explorer")
		{
	//		if ( !document.all[source] ) {
				window.event.srcElement.src = image;
	//		} else {
	//			document.all[source].src = image;
	//		}
		}
	}

	function hover(obj, color, cursor)
	{
		obj.style.backgroundColor = color;
		obj.style.cursor = cursor;
		return true;
	}
	
	function rehover(obj, url, cursor)
	{
		obj.style.backgroundImage = 'url(' + url + ')';
		obj.style.cursor = cursor;
		return true;
	}
	
	function cWnd(url, width, height)
	{
		if(width == '') width = 600;
		if(height == '') height = 640;
		window.open(url, '', 'left=100, top=50, width=' + width + ', height=' + height);
	}
	
	function scrollObj(mode, resource)
	{
		obj = document.getElementById('slider');
		
		if(obj)
		{
			switch(mode)
			{				
				case 'aim':
					// alert(navigator.appName);
					if(navigator.appName == 'Microsoft Internet Explorer')
					{
						target = shower;
					} else {
						target = document.getElementById('shower');	
					}
					obj.stop();
					blastImage(target, resource);
								break;
								
				case 'normal':
					obj.start();
					obj.direction = 'up';
					obj.scrollDelay = 24;
								break;
				
				case 'up':
					obj.start();
					obj.direction = 'up';
					obj.scrollDelay = 6;
								break;
				
				case 'down':
					obj.start();
					obj.direction = 'down';
					obj.scrollDelay = 6;
								break;
								
				default:
					obj.start();
					obj.direction = 'up';
					obj.scrollDelay = 24;
								break;
			}
		}
		
		return true;
	}

	function nRate(power)
	{		
		var stars = new Array();
		var i; var j;
		
		leg = document.getElementById('legend');
		
		for(i = 1; i <= 5; i++)
			stars[i] = document.getElementById('img_' + i);
			
		if(power == 0)
		{
			for(i = 1; i <= 5; i++)
				blastImage(stars[i], syspack[0]);
		} else {
			if(power > 0 && power <= 5)
			{
				for(j = 1; j <= 5; j++)
					blastImage(stars[j], syspack[0]);
				for(j = 1; j <= power; j++)
				{	
					blastImage(stars[j], syspack[2]);
					leg.innerHTML = 'Гласуване с ' + j;
				}
					
			}
		}
	}
	
	function rRating(value)
	{
		var full;
		var half;
		var empty;
		
		var i; var j;
		
		var stars = new Array();
		
		for(i = 1; i <= 5; i++)
			stars[i] = document.getElementById('img_' + i);
		
		full = Math.floor(value);
		
		if((value - full) > 0)
		{
			half = 1;	
		} else {
			half = 0;	
		}
		
		empty = (5 - full - half);
		
		for(i = 1; i <= full; i++)
			blastImage(stars[i], syspack[2]);
			
		if(half > 0)
			blastImage(stars[full+1], syspack[1]);
		
		for(i = 1; i <= empty; i++)
			blastImage(stars[full+half+i], syspack[0]);
			
		leg.innerHTML = initial;
	}
	
	function cfmReg()
	{
		var agree = confirm('Информацията в бланката попълнена ли е правилно?');
		
		if(agree)
			return true;
		else
			return false;
	}
//-->
