function WinError(obj, label){
    var width = 270;
    var height = 74;
    xy = getAbsolutePos(obj);
    var Frame = document.getElementById("popupIfr");
    if(!Frame){
        Frame = document.createElement("IFRAME");
        Frame.id = "popupIfr";
        Frame.frameBorder = "0";
        Frame.scrolling = "no";
        Frame.allowtransparency = "true";
        Frame.style.border = "0";
        Frame.style.position = "absolute";
        Frame.style.zIndex = "10";
        Frame.background = "#F7F2D2";
        Frame.style.background = "#F7F2D2";
        Frame.style.display = "none";
        document.body.appendChild(Frame);
    }

    Frame.style.left = xy.x;
    Frame.style.top = xy.y + 23;
    Frame.style.width      = width;
    Frame.style.height     = height - 3;
    Frame.style.display = "block";

    var Wnd = document.getElementById("popupWnd");
    var cnt = '';
    if(!Wnd){

        Wnd = document.createElement("DIV");
        Wnd.id = "popupWnd";
        Wnd.style.border = "0";
        Wnd.style.position = "absolute";
        Wnd.style.overflow = "hidden";
        Wnd.style.zIndex = "20";
        Wnd.style.display = "none";
        document.body.appendChild(Wnd);
    }

    Wnd.style.left = xy.x;
    Wnd.style.top = xy.y + 20;

    Wnd.style.width = width;
    Wnd.style.height = height;
    Wnd.style.background = "#F7F2D2";//transparent
    Wnd.style.display = "block";
    cnt += '<table width="' + width + '" border="0" cellspacing="0" cellpadding="0" class="table_44" border="1">';
    cnt += '<tr>';
    cnt += '<td height="74" width="8" align="left" valign="bottom" style="text-align:bottom;"><img src="/img/message/message0.gif" width="9" height="52"></td>';
    cnt += '<td height="74"  style="background: url(\'/img/message/message_bg.gif\') repeat-x left bottom;" >';
    cnt += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
    cnt += '<tr> ';
    cnt += '<td height="74" valign="top" style="background: url(\'/img/message/message1.gif\') no-repeat left bottom; padding-top:30px; font: 11px Arial; vertical-align:top;">';
    cnt += label;
    cnt += '</td></tr>';
    cnt += '</table>';
    cnt += '</td>';
    cnt += '<td align="right" width="7" valign="bottom" style="text-align:bottom;"><img src="/img/message/message2.gif" width="9" height="52"></td>';
  	cnt += '</tr>';
	cnt += '</table>'

    Wnd.innerHTML = cnt;
}

function CloseWinError(){
	if(document.all.popupIfr){		document.all.popupIfr.style.display = "none";
	}
	if(document.all.popupWnd){
		document.all.popupWnd.style.display = "none";
	}
}

function getAbsolutePos(el){
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent)
		{
		var tmp = getAbsolutePos(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
		}
	return r;
}

function SelectErrorField(obj, typ){
    if(typ == 1){
    	obj.style.border = "1px solid #FF0000";
	}
	obj.style.background = "#F09D9D";
	obj.focus();
}

function ClearErrorField(obj, typ){
	if(typ == 1){
       	obj.style.border = "1px solid #1E3961";
	}
	obj.style.background = "#FFFFFF";
}


