function comparision_add(value)
{
	//alert(value);
	if($('comparison_id_value'))
	{
		$('comparison_id_value').value=value;
		//	document.comparison_send.comparison_id_value.value='$row[id]'; 
		if($('comparison_id_value').form)	$('comparison_id_value').form.submit();
	}
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function insertPicture(field,picture_min,picture_max,x,y,alt)
{
	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\" alt=\""+ alt +"\" title=\""+ alt +"\">";
}

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);
	if(name)
	{
		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);
	if(name)
	{
		name.moveTo(left, top);
		name.focus();
	}
}


function activeTab(active)
{
	
	var content=$("tabDescription").getElementsByClassName("tab_div");
	var header=$("tabs").getElementsByTagName("div");
	
	var j = 0;
	for (var i=1; i<=content.length; i++)
	{
			j++;			
			if (j==active)
			{
				Element.show(content[i-1]);
				$(header[j-1]).className='tab_head_active'
			}
			else
			{
				Element.hide(content[i-1]);
				$(header[j-1]).className='tab_head'
			}		
	}
	
}
/*
function activeTab(active)
{
	
	var content=document.getElementById("tabDescription").getElementsByTagName("div");
	var header=document.getElementById("tabs").getElementsByTagName("div");

	for (var i=1; i<=content.length; i++)
	{
		if (i==active)
		{
			content[i-1].style.display='inline';
			header[i-1].style.backgroundImage='url(image/icon/tab_on.gif)';
			header[i-1].style.cursor='default';
		}
		else
		{
			content[i-1].style.display='none';
			header[i-1].style.backgroundImage='url(image/icon/tab_off.gif)';
			header[i-1].style.cursor='pointer';
		}
		header[i-1].style.width='112px';
		header[i-1].style.height='19px';
		header[i-1].style.backgroundPosition='top';
		header[i-1].style.backgroundRepeat='no-repeat';
		header[i-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;
}