a=0;
b=0;

function Item_Report()
{
	if(a == 0) 
	{
		document.getElementById('item_report').style.display=''; 
		a=1;
	}
	else 
	{
		document.getElementById('item_report').style.display='none'; 
		a=0;
	}
}

function Show_Messages()
{
	if(b == 0) 
	{
		c = document.getElementById('all_messages');
		if(c != null) 
		{
			c.style.display='';
			b=1;
		}
	}
	else 
	{
		c = document.getElementById('all_messages');
		if(c != null) 
		{
			c.style.display='none';
			b=0;
		}
	}
}

function Save_Message()
{
	document.getElementById('write_message').style.display='none';
}


////////////// Adding images /////////////////
var i = 0;

function AddKyozouImage(retStrParent, iwidth, iheight)
{
	
	var retStr;
	
	if (!retStrParent)
		retStr = window.showModalDialog("../Controls/ImageEditor.htm?"+Math.random(), "", "dialogHeight:" + iheight + "px;dialogWidth:" + iwidth + "px;center:yes;resizable:no;status:no;scroll:no");
	else
		retStr = retStrParent;
	
	if (retStr != null)	
	{
		if (retStrParent) RemoveKyozouImage(1, false);
		i++;
		var html = "";
		html += "<table style='display:inline;' class='rma_image_border_1' id='TableImage_new_"+i+"'><tr><td>";
		html += "<input type=hidden name=ProductImage value='new_"+i+";"+retStr+"'>";
		html += "<OBJECT CLASSID='CLSID:4156EC68-BB80-4B06-B1FA-780C3DB183A6' ID='Image_Obj_new_"+i+"' ";
		html += "codebase='/KyozouX.cab#Version=1,1,0,0' WIDTH=100 HEIGHT=100 style='border: solid 0px black;' VIEWASTEXT>";
		html += "</OBJECT>";
		html += "</td></tr><tr><td align='center'>";
		html += "";
		html += "<input type=button class=checkout_button style='width:60px' onclick='RemoveKyozouImage(\"new_"+i+"\")' value='Remove'>";
		
		html += "</td></tr></table>";
		
		ImageContainer.insertAdjacentHTML("beforeEnd", html);
		//TableImage_AddNew.style.display = "none";
		
		document.all["Image_Obj_new_"+i].DrawState = false;
		document.all["Image_Obj_new_"+i].Decode(retStr);
	}
}

function RemoveKyozouImage(ppId, conf)
{
	if ((conf) || (confirm("Are you sure?")))
	{
		document.all["TableImage_"+ppId].outerHTML = "";
		//TableImage_AddNew.style.display = "";
		//if ((ppId+"").indexOf("new_") == -1) 
	}
}


function Button_active(i)
{
	document.all(i).style.backgroundImage='url(/Design/Templates/5/vision/button_act.gif)';
}

function Button_inactive(i)
{
	document.all(i).style.backgroundImage='url(/Design/Templates/5/vision/button.gif)';
}
