function change(id){
     ID = document.getElementById(id);
    
     if(ID.style.display == "")
          ID.style.display = "none";
     else
          ID.style.display = "";
      }
function show(id){
     ID = document.getElementById(id);
    ID.style.display = "block";
}
function hide(id){
     ID = document.getElementById(id);
     ID.style.display = "none";
}
function hide_popup(){
	hide('popup_window');
	hide ('overlay');
}

var xmlHttp;

function DoPopUp(id)
{
	if ($.browser.msie) {
		location.href = "#top";
	}
document.getElementById("popup_window").style.display = "block";
document.getElementById("overlay").style.display = "block";
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//dbAction.do?cmd=displaySitePage1&subcmd=select&id=32
//pages/displaySitePage3.jsp?subcmd=select&id=250
var url="dbAction.do?cmd=displaySitePopup&subcmd=select"
url=url+"&id="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function DoPopUpEmailFriend()
{
        if ($.browser.msie) {
                location.href = "#top";
        }
document.getElementById("popup_window").style.display = "block";
document.getElementById("overlay").style.display = "block";
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="dbAction.do?cmd=sitePageSendEmailLink&subcmd=sendEmail&id=382"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function DoVideoPopUp(id)
{
	if ($.browser.msie) {
		location.href = "#top";
	}
document.getElementById("popup_window").style.display = "block";
document.getElementById("overlay").style.display = "block";
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//dbAction.do?cmd=displaySitePage1&subcmd=select&id=32
//pages/displaySitePage3.jsp?subcmd=select&id=250
var url="dbAction.do?cmd=displaySiteVideoPopup&subcmd=select"
url=url+"&id="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("popup_window").innerHTML=xmlHttp.responseText
 }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
} 

function doSubmit(subcmd, theform)
{
    theform.subcmd.value = subcmd;
    theform.submit();
}

function doSubmitDelete(subcmd, theform)
{
    if (confirm("Are you sure you want to delete")) 
    {
        doSubmit(subcmd, theform);
    }
}

function loginConfirmDelete(delUrl) 
{
    if (confirm("Are you sure you want to delete")) 
    {
        document.location = delUrl;
    }
}

function clear_text(fieldText){
	if(fieldText.value=='Search What Works') fieldText.value='';
}

var pageSource = '';

function getPageSource()
{
    var xmlhttp;
    
    if ("XMLHttpRequest" in window)
    {
        if (document.body.__defineGetter__) 
        {
            if (HTMLElement) 
            {
                var element = HTMLElement.prototype;
                if (element.__defineGetter__) 
                {
                    element.__defineGetter__("outerHTML",
                           function () {
                                  var parent = this.parentNode;
                                  var el = document.createElement(parent.tagName);
                                  el.appendChild(this);
                                  var shtml = el.innerHTML;
                                  parent.appendChild(this);
                                  return shtml;
                           }
                     );
                }
           }
        }
        pageSource = document.documentElement.outerHTML;
    };
    if ("ActiveXObject" in window)  pageSource = document.documentElement.outerHTML;
}

function doPopupSubmit(subcmd, theform)
{
    theform.subcmd.value = subcmd;
    url="";
    cnt=0;
    while (cnt<theform.elements.length){
    	url=url+"&"+theform.elements[cnt].name+"="+theform.elements[cnt].value;
    	cnt++;
    }
    $.get("dbAction.do?cmd=sitePageSendEmailLink&subcmd="+subcmd+url, function(data){
  	  $("#popup_window").html(data);
  	});
    //theform.submit();
}

function confirmDelete(delUrl) 
{
    if (confirm("Are you sure you want to delete")) 
    {
        document.location = delUrl;
    }
}


// ----------------------------------------------------------------------------------   from displaySitePage2 ----------------------------------
/*
function change(id){
     ID = document.getElementById(id);
    
     if(ID.style.display == "")
          ID.style.display = "none";
     else
          ID.style.display = "";
      }
function show(id){
     ID = document.getElementById(id);
    ID.style.display = "block";
}
function hide(id){
     ID = document.getElementById(id);
     ID.style.display = "none";
}
function hide_popup(){
	hide('popup_window');
	hide ('overlay');
}

var xmlHttp;

function DoPopUp(id)
{
//location.href = "#top"
document.getElementById("popup_window").style.display = "block";
document.getElementById("overlay").style.display = "block";
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
//dbAction.do?cmd=displaySitePage1&subcmd=select&id=32
//pages/displaySitePage3.jsp?subcmd=select&id=250
var url="dbAction.do?cmd=displaySitePopup&subcmd=select"
url=url+"&id="+id
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("popup_window").innerHTML=xmlHttp.responseText
 }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
} 

function doSubmit(subcmd, theform)
{
    theform.subcmd.value = subcmd;
    theform.submit();
}

function doSubmitDelete(subcmd, theform)
{
    if (confirm("Are you sure you want to delete")) 
    {
        doSubmit(subcmd, theform);
    }
}

function loginConfirmDelete(delUrl) 
{
    if (confirm("Are you sure you want to delete")) 
    {
        document.location = delUrl;
    }
}

function clear_text(fieldText){
	if(fieldText.value=='Search What Works') fieldText.value='';
}

var pageSource = '';

function getPageSource()
{
    var xmlhttp;
    
    if ("XMLHttpRequest" in window)
    {
        if (document.body.__defineGetter__) 
        {
            if (HTMLElement) 
            {
                var element = HTMLElement.prototype;
                if (element.__defineGetter__) 
                {
                    element.__defineGetter__("outerHTML",
                           function () {
                                  var parent = this.parentNode;
                                  var el = document.createElement(parent.tagName);
                                  el.appendChild(this);
                                  var shtml = el.innerHTML;
                                  parent.appendChild(this);
                                  return shtml;
                           }
                     );
                }
           }
        }
        pageSource = document.documentElement.outerHTML;
    };
    if ("ActiveXObject" in window)  pageSource = document.documentElement.outerHTML;
}

function doSubmit(subcmd, theform)
{
    theform.subcmd.value = subcmd;
    theform.submit();
}

function doSubmitDelete(subcmd, theform)
{
    if (confirm("Are you sure you want to delete")) 
    {
        doSubmit(subcmd, theform);
    }
}

function confirmDelete(delUrl) 
{
    if (confirm("Are you sure you want to delete")) 
    {
        document.location = delUrl;
    }
}


*/

