

window.onload=function(){

makeOB();
}

function is_child_of(parent, child) {
			if( child != null ) {			
				while( child.parentNode ) {
					if( (child = child.parentNode) == parent ) {
						return true;
					}
				}
			}
			return false;
		}
		function fixOnMouseOut(element, event, JavaScript_code) {
			var current_mouse_target = null;
			if( event.toElement ) {				
				current_mouse_target 			 = event.toElement;
			} else if( event.relatedTarget ) {				
				current_mouse_target 			 = event.relatedTarget;
			}
			if( !is_child_of(element, current_mouse_target) && element != current_mouse_target ) {
				eval(JavaScript_code);
			}
		}

ob_pic1= new Image(42,42); 
ob_pic1.src="http://www.oscarbrown.com/sig/images/oscarbrown/logo.png";
ob_pic2= new Image(42,42); 
ob_pic2.src="http://www.oscarbrown.com/sig/images/oscarbrown/logo_transparent.png";
ob_pic3= new Image(208,42); 
ob_pic3.src="http://www.oscarbrown.com/sig/images/oscarbrown/siteby.jpg";
ob_pic4= new Image(208,42); 
ob_pic4.src="http://www.oscarbrown.com/sig/images/oscarbrown/pic.jpg";
ob_pic5= new Image(10,10); 
ob_pic5.src="http://www.oscarbrown.com/sig/images/black.png";
ob_pic6= new Image(10,10); 
ob_pic6.src="http://www.oscarbrown.com/sig/images/send.png";




function findOBpos() {
var obj=document.getElementById("OB");
	var curleft = curtop = 0;
if (obj.offsetParent) {
do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;

} while (obj = obj.offsetParent);
	return [curtop];
}
}


function makeOB()
{

//alert(findPos());



var h=document.body.scrollHeight;
if (h==0) var h=document.body.parentNode.scrollHeight;

var h2=220;
var h3=400;


var div1 = document.createElement("div");
        
        div1.id = "ob_container";
       	div1.style.marginTop='-400px';
       	div1.style.top='0%';
		div1.style.display='none';
		div1.style.width='250px';
		div1.style.fontFamily='Verdana, Geneva, sans-serif';
		div1.style.textAlign='left';
		div1.style.fontSize='12px';
		div1.style.position='absolute';
		div1.style.height='442px';
		div1.style.zIndex='1002';
		div1.style.left='100%';
		div1.style.marginLeft='-250px';
		div1.style.color='#FFF';
        div1.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0" style=""><tr><td height="400" valign="bottom"><div id="ob_menu" onmouseout="fixOnMouseOut(this, event, ' + "'OBclose()'" + ')" style="-webkit-box-shadow:0px 0px 30px #FFF; display:none; width:250px;"><div><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="background:url(http://www.oscarbrown.com/sig/images/black.png); padding-left:20px; padding-right:20px; padding-bottom:10px; padding-top:20px;"><img src="http://www.oscarbrown.com/sig/images/oscarbrown/hi.png"><div style="padding-top:2px;">and I made this website.  This website features a user-friendly backend so Redeemer's Pastors &amp; Staff can edit the webpages themselves, in fact, all of my sites do!</div></td><td width="42" style="background:#000;" valign="top"><img src="http://www.oscarbrown.com/sig/images/oscarbrown/pic.jpg" /></td></tr><tr><td style="background:url(http://www.oscarbrown.com/sig/images/black.png); padding-left:20px;"><iframe src="http://www.facebook.com/plugins/like.php?href=&amp;layout=button_count&amp;show_faces=false&amp;width=168&amp;action=like&amp;font=verdana&amp;colorscheme=dark&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:168px; height:21px;" allowTransparency="true"></iframe></td><td bgcolor="#000000">&nbsp;</td></tr><tr><td style="background:url(http://www.oscarbrown.com/sig/images/black.png); padding-left:20px; padding-top:10px; padding-bottom:10px;"><img style="cursor:pointer; margin-bottom:6px;" border="0" src="http://www.oscarbrown.com/sig/images/oscarbrown/contact.png" onclick="OBshowContact()" ><div id="ob_contact" style="display:none; height:160px;"><div><input type="text" id="ob_contact_name" style="padding:2px; width:162px; margin-bottom:6px; border:1px solid #CCC; color:#FFF; background:url(http://www.oscarbrown.com/sig/images/black.png);" value="Name" onfocus="OBcheckContact(' + "'name'" + ')" onblur="OBcheckContactBlur(' + "'name'" + ')" /><input type="text" id="ob_contact_email" style="padding:2px; width:162px; margin-bottom:6px; border:1px solid #CCC; color:#FFF; background:url(http://www.oscarbrown.com/sig/images/black.png);" value="Email Address" onfocus="OBcheckContact(' + "'email'" + ')" onblur="OBcheckContactBlur(' + "'email'" + ')" /><textarea id="ob_contact_message" style="padding:2px; width:162px; height:80px; margin-bottom:6px; border:1px solid #CCC; color:#FFF; font-family:Verdana, Geneva, sans-serif; font-size:12px; background:url(http://www.oscarbrown.com/sig/images/black.png);" onfocus="OBcheckContact(' + "'message'" + ')" onblur="OBcheckContactBlur(' + "'message'" + ')">Tell me a little about what you' + "'" + 're looking for...</textarea><div align="right" style="padding-right:20px;"><img src="http://www.oscarbrown.com/sig/images/send.png" style="cursor:pointer;" onclick="OBsendContact()" /></div></div></div><div id="ob_contact_thanks" style="display:none; height:32px;"><div>Thanks! I' + "'" + 'll get back to you soon!</div></div></td><td style="background: #000;">&nbsp;</td></tr></table></div></div></td></tr><tr><td height="42" style="cursor:pointer;" onClick="OBopenSite()">&nbsp;</td></tr></table>';
        document.getElementById("OB").appendChild(div1);


var div2 = document.createElement("div");
        
        div2.id = "ob_logo";
		div2.onmouseover=function() { OBopen(); };
        div2.setAttribute("onMouseOver","OBopen()");
       	//div2.style.marginTop='0px';
		//div2.style.top='0%';
		div2.style.position='absolute';
		div2.style.width='42px';
		div2.style.height='42px';
		div2.style.cursor='pointer';
		div2.style.zIndex='1000';
		div2.style.left='100%';
		div2.style.marginLeft='-42px';
		div2.style.background='url(http://www.oscarbrown.com/sig/images/oscarbrown/logo_default.png) top center no-repeat';
        div2.innerHTML = '&nbsp;';
        document.getElementById("OB").appendChild(div2);


var div3 = document.createElement("div");
        
        div3.id = "ob_logo_over";
		div3.onclick=function() { OBopenSite(); };
        div3.setAttribute("onClick","OBopenSite()");
       	//div3.style.marginTop='0px';
		//div3.style.top='0%';
		div3.style.display='none';
		div3.style.position='absolute';
		div3.style.width='250px';
		div3.style.height='42px';
		div3.style.cursor='pointer';
		div3.style.zIndex='1001';
		div3.style.left='100%';
		div3.style.background='#000';
		div3.style.marginLeft='-250px';
        div3.innerHTML = '<div style="-webkit-box-shadow:0px 0px 30px #FFF;"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="42" style="background:url(http://www.oscarbrown.com/sig/images/oscarbrown/siteby.jpg) top center no-repeat;">&nbsp;</td><td width="42" style="background:url(http://www.oscarbrown.com/sig/images/oscarbrown/logo.png) top center no-repeat;">&nbsp;</td></tr></table></div>';
        document.getElementById("OB").appendChild(div3);





}

function finishOB()
{
alert ("1");
var cont=document.getElementById('ob_frame').src;
alert(cont);
}





function OBopenSite()
{
window.open('http://www.oscarbrown.com?ref=redeemerlubbock');
}

ob_opening=0;
ob_open=0;

function OBopen()
{
if (ob_opening==0)
{
if (ob_open==0)
{
ob_opening=1;
Effect.Appear('ob_logo_over', {duration:.25});
document.getElementById("ob_container").style.top="0px";
var mtop1=findOBpos();
var mtop=(mtop1*1)-400;
document.getElementById("ob_container").style.marginTop=mtop + "px";
document.getElementById("ob_container").style.display="";
Effect.BlindDown('ob_menu', {duration:.25});
setTimeout('ob_open=1',250);
setTimeout('ob_opening=0',250);
}
}
else
{
setTimeout('OBopen()',250);
}
}

function OBclose()
{
if (ob_opening==0)
{
if (ob_open==1)
{
ob_opening=1;
Effect.BlindUp('ob_menu', {duration:.15});
Effect.Fade('ob_logo_over', {duration:.25});
setTimeout('ob_open=0',250);
setTimeout('ob_opening=0',250);
setTimeout('document.getElementById("ob_container").style.display="none";',250);
setTimeout('document.getElementById("ob_contact").style.display="none";',250);
setTimeout('document.getElementById("ob_contact_thanks").style.display="none";',250);

}
}
else
{
setTimeout('OBopen()',250);
}
}


function OBsendContact()
{

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
    xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==1)
      {
OBshowContact();
Effect.BlindDown('ob_contact_thanks', {duration:.5});
setTimeout('OBresetContact()',500);


      }
	if(xmlHttp.readyState==4)
      {


		var resp=xmlHttp.responseText;
      }
    }
	
var params = "name=" + escape(document.getElementById("ob_contact_name").value);
var params = params + "&email=" + escape(document.getElementById("ob_contact_email").value);
var params = params + "&message=" + escape(document.getElementById("ob_contact_message").value);
var params = params + "&site=redeemerlubbock";	
  xmlHttp.open("POST","http://www.oscarbrown.com/sig/send.php",true);
  //Send the proper header information along with the request
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");

  xmlHttp.send(params);
  }


function OBshowContact()
{
Effect.toggle('ob_contact','blind', {duration:.5});
  }

function OBcheckContact(id)
{
if (id=="name") var lookFor="Name";
else if (id=="email") var lookFor="Email Address";
else if (id=="message") var lookFor="Tell me a little about what you're looking for...";

if (document.getElementById("ob_contact_" + id).value==lookFor)
{
document.getElementById("ob_contact_" + id).value="";
}
}

function OBcheckContactBlur(id)
{
if (id=="name") var lookFor="Name";
else if (id=="email") var lookFor="Email Address";
else if (id=="message") var lookFor="Tell me a little about what you're looking for...";

if (document.getElementById("ob_contact_" + id).value=="")
{
document.getElementById("ob_contact_" + id).value=lookFor;
}
}

function OBresetContact()
{
document.getElementById("ob_contact_name").value="Name";
document.getElementById("ob_contact_email").value="Email Address";
document.getElementById("ob_contact_message").value="Tell me a little about what you're looking for...";
}

