//GOOGLE AD
var google_ad_client = "pub-7127154518538579";
var google_ad_width = 468;
var google_ad_height = 60;
var google_ad_format = "468x60_as";
var google_ad_type = "text_image";
//2007-06-25: Primary
var google_ad_channel = "4212677058";
var google_color_border = "E5E5E5";
var google_color_bg = "F2F2F2";
var google_color_link = "000000";
var google_color_text = "333333";
var google_color_url = "010D96";
var google_ui_features = "rc:0";
//GOOGLE AD

//Members
var RegexEmail = /([a-zA-Z0-9_\.\-]+\@[a-zA-Z0-9\-]+\.+[a-zA-Z0-9]{2,4})/gi;
var RegexUrl = /(href=\"){0}\s+((((http|https)[:]{1}[\/]{2})|([w]{3}\.))+([\w]{1,}\.[\w]{1,4})+((\/[\w-\/?%&=]+)([\.\w]{2,4})?)?)/gi;
var RegexPhone = /(((1[- ])?)(([0-9]{3}[- ])?)[0-9]{3}[ -][0-9]{4})/gi;
//Members

//Functions

//Occurs When Page Load Happens
function OnPageLoad()
{
    var contentBody = document.getElementById('ContentBody');
    if (undefined != contentBody &
        null != contentBody)
    {
       ProcessEmailAddresses(contentBody);
       ProcessWebSites(contentBody);
       ProcessPhoneNumbers(contentBody);
    }
}
//Process Email Addresses
function ProcessEmailAddresses(contentBody)
{
    contentBody.innerHTML = contentBody.innerHTML.replace(RegexEmail
        , '<a href=\"mailto:$1\">$1</a>');
}
//Process Phone Numbers
function ProcessPhoneNumbers(contentBody)
{
    contentBody.innerHTML = contentBody.innerHTML.replace(RegexPhone
        , '<font class=\"Phone\">$1</font>');
}
//Process Web Sites
function ProcessWebSites(contentBody)
{
    contentBody.innerHTML = contentBody.innerHTML.replace(RegexUrl
        , ' <a href=\"http://$2\" target=\"_blank\">$2</a>');
}
//Closes Window
function CloseWindow()
{
    window.close();
}
//Resizes Window
function ResizeWindow()
{
    var width = 850;//getWindowFrameWidth();
    var height = getWindowFrameHeight() * 1.33;
    if (parseInt(navigator.appVersion)>3)
    {
        if (navigator.appName=="Netscape")
        {
            top.outerWidth=width;
            top.outerHeight=height;
        }
        else
        {
            top.resizeTo(width,height);
        }
    }
}
function  getWindowFrameWidth()
{
	var width;
	if (document.width) //detected gecko
	{
		width= document.width;
	}
	else if (document.body && document.body.scrollWidth) //detected IE
	{
		width= document.body.scrollWidth;
		if (document.body.currentStyle.width) width=  document.body.currentStyle.width ;
	}
    return width;
}
//Window Frame Height
function  getWindowFrameHeight()
{
	var height;
	if (document.height) //detected gecko
	{
		height = document.height;
	}
	else if (document.body && document.body.scrollHeight) //detected IE
	{
		height = document.body.scrollHeight;
	}
	if (document.documentElement && document.documentElement.scrollHeight) //detected another gecko
	{
	    if (height == null) {
	        height = document.documentElement.scrollHeight;
	    }
	    else if (/WebKit/i.test(navigator.userAgent))     /* for Safari */
	    {
	        height = document.documentElement.scrollHeight;
	    }
	}
    return height;
}
var ObserverPopUp;
function PopUpFrame(urlstr, height, width)
{
	var options = 'height=' + height + ',width=' + width + ',toolbar=no,menubar=no,scrollbars=1,resizable=yes,status=no,location=no,z-lock=yes,left=5,top=5';
	ObserverPopUp = window.open(urlstr, 'ObserverPopup', options); 
	ObserverPopUp.focus();
}
//PopUp
function PopUp(table, id)
{
    PopUpFrame('Pictures.aspx?table=' + table +'&id=' + id, 450, 770);
}
//For Browser Compatability
function ReturnFalse() { return false; }
function GoToArticle(queryString) {
    NavigateTo('Article.aspx', queryString);
}
function GoToClassifiedAd(queryString) {
    NavigateTo('Classifieds.aspx', queryString);
}
function GoToOpinion(queryString)
{
    NavigateTo('Opinion.aspx', queryString);
}
function NavigateTo(page, queryString)
{
    window.location.href = page + '?' + queryString;
}
function NewWindow(url)
{
    window.open(url);
}
function ShowHide(id)
{
    var node = document.getElementById(id);
    if (undefined != node &
        null != node)
    {
        
        if (node.style.display=='block')
        {
            node.style.display = 'none';
        }
        else{
            node.style.display = 'block';
        }
    }
}