function insertPicture(field,picture_min,picture_max,x,y)
{
	var field=document.getElementById(field);
	var frame;
	if (picture_max && x && y)
		frame=" style='cursor:pointer' onClick=\"window_open('frame.php?image=" + picture_max + "',''," + x + "," + y + ")\"";
	field.innerHTML="<img src=\"" + picture_min + "\" " + frame + " border=\"0\" >";
}

function window_open(URL, name, width, height)
{
	var left=(screen.width-width)/2;
	left=Math.round(left);
	var top=(screen.height-height-100)/2;
	top=Math.round(top);
	name=window.open(URL, name, 'resizable=0, height=' + height + ', width=' + width + ', top=' + top + ', left=' + left);
	name.moveTo(left, top);
	name.focus();
}

function window_open_resizable(URL, name, width, height)
{
	var left=(screen.width-width)/2;
	left=Math.round(left);
	var top=(screen.height-height-100)/2;
	top=Math.round(top);
	name=window.open(URL, name, 'resizable=1,scrollbars=1, height=' + height + ', width=' + width + ', top=' + top + ', left=' + left);
	name.moveTo(left, top);
	name.focus();
}


function activeTab(active)
{
	
	var content=document.getElementById("tabDescription").getElementsByTagName("div");
	var header=document.getElementById("tabs").getElementsByTagName("div");
	
	var j = 0;
	
	for (var i=1; i<=content.length; i++)
	{

		if( content[i-1].className == 'tab_div')
		{

			j++;	
	
		
		if (j==active)
		{

			content[i-1].style.display='inline';
			header[j-1].style.backgroundImage='url(image/icon/tab_on.gif)';
			header[j-1].style.cursor='default';
			header[j-1].style.color='rgb(209,63,0)';
		}
		else
		{
			content[i-1].style.display='none';
			header[j-1].style.backgroundImage='url(image/icon/tab_off.gif)';
			header[j-1].style.cursor='pointer';
			header[j-1].style.color='#000000';
		}
		
		header[j-1].style.borderTop='1px solid rgb(221,221,221)';						
		header[j-1].style.fontWeight='bold';
		header[j-1].style.fontSize='12px';
		
		header[j-1].style.width='170px';
		header[j-1].style.height='23px';
		header[j-1].style.backgroundPosition='top';
		header[j-1].style.backgroundRepeat='no-repeat';
		header[j-1].style.paddingTop='2px';
		//header[i-1].style.border='1px solid black';
		
			}
	}
	
}

function ShowDiv(element)
{
	var elem=document.getElementById(element);
	if (elem.style.display=='inline') elem.style.display='none'; else elem.style.display='inline';
}

function ActiveDeactiveDiv(element,show)
{
	var elem=document.getElementById(element);
	if (show=='0') elem.style.display='none'; else elem.style.display='inline';
}
function ShowHideElement(element,style_display_on)
{
	var elem=document.getElementById(element);
	if (elem.style.display=='none') 
		elem.style.display=style_display_on; 
	else 
		elem.style.display='none';
}


function insertVaulue(value,field)
{
		var field=document.getElementById(field);
		
		field.value=value;
}