function pics(img,ref)
{
	document.images[img].src = ref;
}

function openwin(img,w,h,title)
{
 var hWnd;
 if(hWnd!=null) hWnd.close();
 hWnd=window.open(img,"","toolbar=no,location=no,directories=no,resizable=yes,scrollbars=yes,left=100,top=100,width="+w+",height="+h);
 hWnd.document.open();
 hWnd.document.write("<html><head><title>"+title+"</title></head><body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>");
 hWnd.document.write("<img src=\""+img+"\" width="+w+" height="+h+">");
 hWnd.document.write("</body></html>");
 hWnd.document.close();
}

function IEPngFix( pngimg, gifimg, width, height, unique_name )
{
	var code = '<IMG SRC="'+ gifimg +'" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER=0 name='+ unique_name +' STYLE="BACKGROUND:url('+pngimg+') no-repeat 0px 0px;">';
	if( navigator.userAgent.indexOf("Opera") > 1 )
		document.write(code);
	else
		if( navigator.userAgent.indexOf("MSIE 6") > 1 )
			document.write('<IMG SRC="'+gifimg+'" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER="0" ALT="" STYLE="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src=' + pngimg + ' , sizingMethod=crop );">');
		else
			if(navigator.userAgent.indexOf("MSIE 5") != -1)
				document.write(code);
			else
				document.write(code);
				
}


//=========


function switch_div()
{
	fl = document.getElementById("flag");
	if(fl)
		if(fl.value==1) document.getElementById("div_info").style.display = "none";
			else document.getElementById("div_info").style.display = "block";
}

function preload()
{
	var imgsrc = preload.arguments;
	arr=new Array(imgsrc.length);
	for (var j=0; j < imgsrc.length; j++)
	{
		arr[j] = new Image; arr[j].src = imgsrc[j];
	}
}


function set_params(w, h)
{
	var pic = document.getElementById('head_pic');
	pic.style.visibility = "hidden";
	pic.style.width = w;
	pic.style.height = h;
	pic.style.visibility = "visible";
}


//===========



$(document).ready(function(){
	$('input:radio').click(function()
	{
		if( $(this).attr("name") == "firsttime" )
		{
			if($(this).val()==1)
			{
				$('#firsttimeblock').show();
				$('#notfirsttimeblock').hide();
			}
			else
			if($(this).val()==0)
			{
				$('#firsttimeblock').hide();
				$('#notfirsttimeblock').show();
			}
		}

		if( ($(this).attr("name") == "know") && ( $(this).val() == 7 ) )
		{
			$('#know_txt').focus();
		}

	})
});

