function sall(){
 if(!document.listmsg.Msg) return;
 if(!document.listmsg.Msg.length)
	document.listmsg.Msg.checked = document.listmsg.Msg.checked ? false : true;
 else
	for(var i=0;i<document.listmsg.Msg.length;i++)
		document.listmsg.Msg[i].checked = document.listmsg.Msg[i].checked ? false : true;
}

function chbg(x,id,c)
{
	if(x=='over'){
		document.getElementById(id).style.backgroundColor = '#CECECE';
	}
	else{
		document.getElementById(id).style.backgroundColor = c;
	}
}

function chbd(x,id)
{
	if(x=='over'){
		//document.getElementById(id).style.border = '#000000 1px solid;';
	}
	else{
		//document.getElementById(id).style.border = 0;
	}
}

var tipwidth='20px' //default tooltip width
var tipbgcolor='lightyellow'  //tooltip bgcolor
var disappeardelay=250  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="-38px" //horizontal offset of tooltip from anchor link
var horizontal_offset="8px" //horizontal offset of tooltip from anchor link

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(menucontents, obj, e, tipwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
dropmenuobj.innerHTML=menucontents

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidetip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

function DS(element){
	window.open('/data/m_2.php?css=css/default.css&target=form_fulltext_struct['+element+']', 'myWin', 'Toolbar=0, Location=0, Directories=0, Status=0, Menubar=0, Scrollbars=0, Resizable=0, Copyhistory=1, Width=190, Height=270');
}
function open_div(id){
	rg = new RegExp("<!--NO_ITEMS-->");
	id_text = document.getElementById(id).innerHTML;
	//alert(id_text);
	if (!rg.exec(id_text)){
  		document.getElementById(id).style.display='';
	}
}
function close_div(id){
  document.getElementById(id).style.display='none';
}

function show_hide(id)
{
	var	el = document.getElementById('aukc'+id);
	if (el.style.display == 'none')
	{
		el.style.display = '';
	}
	else
	{
		el.style.display = 'none';
	}
}

function light_selected(id,color)
{
	document.getElementById('row'+id).setAttribute('bgcolor', color, 0);
}

function show_attach_form(get_p)
{
	var path = 'http://www.internetmebel.ru/includes/attach.php?'+get_p;
	window.open(path, 'nWin', 'Toolbar=0, Location=0, Directories=0, Status=0, Menubar=0, Scrollbars=1, Resizable=1, Copyhistory=1, Width=720, Height=150');
}
function show_image(i,t,w,h,type)
{
	var path = 'http://www.internetmebel.ru/'+t+'/'+i+'jpg.html?type='+type;
	window.open(path, 'nWin', 'Toolbar=0, Location=0, Directories=0, Status=0, Menubar=0, Top=200, Left=200, Scrollbars=0, Resizable=0, Copyhistory=0, Width='+w+', Height='+h);
}
function submit_Form(g,c)
{
	var path = 'http://www.internetmebel.ru/add_cart.phtml?g='+g+'&c='+c;
	window.open(path, 'nWin', 'Toolbar=0, Location=0, Directories=0, Status=0, Menubar=0, Top=200, Left=200, Scrollbars=1, Resizable=1, Copyhistory=1, Width=500, Height=400');
	return false;
}

function show_color(g,c)
{
	var path = 'http://www.internetmebel.ru/color.html?g='+g+'&c='+c;
	window.open(path, 'nWin', 'Toolbar=0, Location=0, Directories=0, Status=0, Menubar=0, Top=200, Left=200, Scrollbars=1, Resizable=0, Copyhistory=0, Width=300, Height=200');
	return false;
}


function submitForm(form_)
{
	F= document.forms[form_];
	F.submit();
}
function sivamtime()
{
	now=new Date();
	hour=now.getHours();
	min=now.getMinutes();
	sec=now.getSeconds();
	if (min<=9) { min="0"+min; }
	if (sec<=9) { sec="0"+sec; }
	if (hour>12) { hour=hour-12; add="pm"; }
	else { hour=hour; add="am"; }
	if (hour==12) { add="pm"; }

	time = ((hour<=9) ? "0"+hour : hour) + ":" + min + ":" + sec + " " + add;
	document.getElementById('theTime').innerHTML = time;
	setTimeout("sivamtime()", 1000);
}
setTimeout("sivamtime()", 500);