function GetPostion()
{
    var   W,   H,   SL,   ST; 
    var   clientWidth,clientHeight;
    var   w=window,   d=document,   dd=d.documentElement; 

    if(w.innerWidth)   W=w.innerWidth; 
    else   if(dd&&dd.clientWidth)   W=dd.clientWidth; 
    else   if(d.body)   W=d.body.clientWidth; 

    if(w.innerHeight)   H=w.innerHeight; 
    else   if(dd&&dd.clientHeight)   H=dd.clientHeight;   
    else   if(d.body)   H=d.body.clientHeight; 

    if(w.pageXOffset)   SL=w.pageXOffset; 
    else   if(dd&&dd.scrollLeft)   SL=dd.scrollLeft; 
    else   if(d.body)   SL=d.body.scrollLeft; 

    if(w.pageYOffset)   ST=w.pageYOffset; 
    else   if(dd&&dd.scrollTop)   ST=dd.scrollTop; 
    else   if(d.body)   ST=d.body.scrollTop; 
    
        var scrollLeft = (document.documentElement.scrollLeft ?
            document.documentElement.scrollLeft : document.body.scrollLeft);
    var scrollTop = (document.documentElement.scrollTop ?
            document.documentElement.scrollTop : document.body.scrollTop);
    W=W+scrollLeft;
    H=H+scrollTop;
    return{clientWidth:W,clientHeight:H}; 
}
function reseMessengerPosition()
{
    var p=GetPostion();
    var container =  document.getElementById("divInquire");
    var containerLeft =p.clientWidth  - container.clientWidth - 20;
    var containerTop = p.clientHeight  - container.clientHeight;
    container.style.top=containerTop+"px";
    container.style.right="1px";
}
function AddEvent(obj)
{
    if (window.addEventListener)
    {
    window.addEventListener("resize", obj, false);
    window.addEventListener("scroll",obj,false);
    }
    else if (window.attachEvent)
    {
        window.attachEvent("onresize", obj);
        window.attachEvent("onscroll", obj);
    }
    else
    {
    window.onresize=obj;
    window.onscroll=obj;
    }
}
function RunFunction()
{
	clearTimeout(timer);
	timer =setTimeout('reseMessengerPosition()',10);
}
function ShowAndHide(obj1,obj2)
{
	var div1=document.getElementById(obj1);
	var div2=document.getElementById(obj2);
	div1.style.display=div1.style.display=="none" ? "":"none";
	div2.style.display=div2.style.display=="none" ? "":"none";
	
		var container =  document.getElementById("divInquire");
		var p=GetPostion();
		var containerLeft =p.clientWidth  - div2.clientWidth - 20;
        var containerTop = p.clientHeight  - div2.clientHeight;
		container.style.top=containerTop+"px";
        //container.style.left=containerLeft+"px";
        container.style.right="1px";
}
function Validate()
{
	var objDiv=document.getElementById("divError");
	var objMessage=document.getElementById("txtContent");
	if(objMessage.value.length<1)
	{
		objDiv.style.display="";
		objDiv.innerHTML="Please enter your inquiry.";
		return false;
	}
	else if(objMessage.value.length<50 || objMessage.value.length>2000)
	{
		objDiv.style.display="";
		objDiv.innerHTML="Your inquiry should be between 50-2000 characters.";
		return false;
	}
	return true;
}
function DoSubmit()
{
    if(Validate())
    {
		var f=document.getElementById("formInquire");
		f.target="_blank";
		ShowAndHide('divInquire3','divInquire1');
		return true;
    }
    return false;
}
function TxtFocus()
{
	var oTxt=document.getElementById("txtContent");
	oTxt.value="";
	oTxt.focus();
}
document.writeln("<style type=\"text/css\">");
document.writeln(".contactBox1 {");
document.writeln("	CLEAR: right; BACKGROUND: #fff; FLOAT: right; WIDTH: 170px");
document.writeln("}");
document.writeln(".contactBox2 {");
document.writeln("	CLEAR: right; BACKGROUND: #fff; FLOAT: right; WIDTH: 170px");
document.writeln("}");
document.writeln(".contContent {");
document.writeln("	BORDER-RIGHT: #99df72 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #99df72 1px; PADDING-LEFT: 10px; PADDING-BOTTOM: 12px; BORDER-LEFT: #99df72 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #99df72 1px solid");
document.writeln("}");
document.writeln(".contContent3 {");
document.writeln("	BORDER-RIGHT: #99df72 1px solid; PADDING-RIGHT: 10px; PADDING-LEFT: 15px; PADDING-BOTTOM: 12px; BORDER-LEFT: #99df72 1px solid; PADDING-TOP: 5px");
document.writeln("}");
document.writeln(".divmsg {");
document.writeln("	LINE-HEIGHT: 28px; HEIGHT: 28px");
document.writeln("}");
document.writeln(".divmsg IMG {");
document.writeln("	MARGIN-TOP: 5px; MARGIN-BOTTOM: -3px");
document.writeln("}");
document.writeln(".divmsg SPAN {");
document.writeln("	MARGIN-TOP: -22px; FLOAT: right; MARGIN-RIGHT: 18px");
document.writeln("}");
document.writeln(".contactBox3 {");
document.writeln("	CLEAR: right; BACKGROUND: #fff; FLOAT: right; WIDTH: 465px");
document.writeln("}");
document.writeln(".subContact {");
document.writeln("	BORDER-RIGHT: #99df72 1px solid; BORDER-TOP: #99df72 1px; BACKGROUND: #99df72; BORDER-LEFT: #99df72 1px solid; PADDING-TOP: 15px; BORDER-BOTTOM: #99df72 1px solid; HEIGHT: 30px; TEXT-ALIGN: center");
document.writeln("}");
document.writeln(".titBox {");
document.writeln("	BACKGROUND: url(http://static.list-of-companies.org/Images/bg1.jpg) #99df72 no-repeat right top; WIDTH: 100%; HEIGHT: 29px");
document.writeln("}");
document.writeln(".titBox H3 {");
document.writeln("	PADDING-LEFT: 5px; BACKGROUND: url(http://static.list-of-companies.org/Images/bg2.jpg) no-repeat left top; FLOAT: left; MARGIN: 0px; FONT: bold 13px/29px arial; WIDTH: 80%; COLOR: #000000; HEIGHT: 29px");
document.writeln("}");
document.writeln(".titBox IMG {");
document.writeln("	MARGIN-TOP: 8px; FLOAT: right; MARGIN-RIGHT: 8px");
document.writeln("}");
document.writeln(".mar30-b {");
document.writeln("	MARGIN-BOTTOM: 30px");
document.writeln("}");
document.writeln(".h110 {");
document.writeln("	OVERFLOW: hidden; HEIGHT: 110px");
document.writeln("}");
document.writeln("</style>");
document.writeln("    <form id=\"formInquire\" method=\"post\" action=\"http://www.list-of-companies.org/SendInquiry.aspx\" onsubmit=\"return DoSubmit();\"");
document.writeln("        target=\"_blank\">");
document.writeln("        <div id=\"divInquire\" style=\"right: 1px; position: absolute\">");
document.writeln("            <div class=\"contactBox1\" id=\"divInquire1\">");
document.writeln("                <div class=\"titBox\">");
document.writeln("                    <h3>");
document.writeln("                        Send Inquiry</h3>");
document.writeln("                    <img alt=\"\" onclick=\"ShowAndHide(\'divInquire1\',\'divInquire2\')\" src=\"http://static.list-of-companies.org/Images/ico_1.gif\" /></div>");
document.writeln("                <div class=\"contContent\">");
document.writeln("                    <textarea style=\"font-size: 11px; width: 90%; color: #888\" onfocus=\"ShowAndHide(\'divInquire1\',\'divInquire3\');TxtFocus();\"");
document.writeln("                        name=\"textfield2\" rows=\"4\" cols=\"12\">Click here to enter your inquiry.</textarea>");
document.writeln("                </div>");
document.writeln("            </div>");
document.writeln("            <div class=\"contactBox3\" id=\"divInquire3\" style=\"display: none\">");
document.writeln("                <div class=\"titBox\">");
document.writeln("                    <h3>");
document.writeln("                        Send Inquiry</h3>");
document.writeln("                    <img alt=\"\" onclick=\"ShowAndHide(\'divInquire3\',\'divInquire2\')\" src=\"http://static.list-of-companies.org/Images/ico_1.gif\" /></div>");
document.writeln("                <div class=\"contContent3\">");
document.writeln("                    <div class=\"divmsg\">");
document.writeln("                        <img alt=\"\" src=\"http://static.list-of-companies.org/Images/icon_email.gif\" />");
document.writeln("                        Enter your inquiry here</div>");
document.writeln("                    <textarea id=\"txtContent\" name=\"txtContent\" style=\"width: 95%; color: #888\"  rows=\"8\"");
document.writeln("                        cols=\"12\"></textarea>");
document.writeln("                    <div class=\"error\" id=\"divError\" style=\"display: none\">");
document.writeln("                        Your inquiry should be between 50-2000 characters</div>");
document.writeln("                </div>");
document.writeln("                <div class=\"subContact\">");
document.writeln("                    <input type=\"submit\" value=\" Send Inquiry Now \" />");
document.writeln("                </div>");
document.writeln("            </div>");
document.writeln("            <div class=\"contactBox2\" id=\"divInquire2\" style=\"display: none\">");
document.writeln("                <div class=\"titBox\">");
document.writeln("                    <h3>");
document.writeln("                        Send Inquiry</h3>");
document.writeln("                    <img alt=\"\" onclick=\"ShowAndHide(\'divInquire2\',\'divInquire1\')\" src=\"http://static.list-of-companies.org/Images/ico_2.gif\" /></div>");
document.writeln("            </div>");
document.writeln("        </div>");
document.writeln("    </form>");
document.writeln("");
AddEvent(RunFunction);
var timer = setTimeout('reseMessengerPosition()',10);