/*CSS Browser Selector v0.3.4 (Sep 29, 2009)Rafael Lima (http://rafael.adm.br)http://rafael.adm.br/css_browser_selectorLicense: 
http://creativecommons.org/licenses/by/2.5/Contributors: http://rafael.adm.br/css_browser_selector#contributors*/
function css_browser_selector(u) { var ua = u.toLowerCase(), is = function(t) { return ua.indexOf(t) > -1; }, g = 'gecko', w = 'webkit', s = 'safari', o = 'opera', h = document.getElementsByTagName('html')[0], b = [(!(/opera|webtv/i.test(ua)) && /msie\s(\d)/.test(ua)) ? ('ie ie' + RegExp.$1) : is('firefox/2') ? g + ' ff2' : is('firefox/3.5') ? g + ' ff3 ff3_5' : is('firefox/3') ? g + ' ff3' : is('gecko/') ? g : is('opera') ? o + (/version\/(\d+)/.test(ua) ? ' ' + o + RegExp.$1 : (/opera(\s|\/)(\d+)/.test(ua) ? ' ' + o + RegExp.$2 : '')) : is('konqueror') ? 'konqueror' : is('chrome') ? w + ' chrome' : is('iron') ? w + ' iron' : is('applewebkit/') ? w + ' ' + s + (/version\/(\d+)/.test(ua) ? ' ' + s + RegExp.$1 : '') : is('mozilla/') ? g : '', is('j2me') ? 'mobile' : is('iphone') ? 'iphone' : is('ipod') ? 'ipod' : is('mac') ? 'mac' : is('darwin') ? 'mac' : is('webtv') ? 'webtv' : is('win') ? 'win' : is('freebsd') ? 'freebsd' : (is('x11') || is('linux')) ? 'linux' : '', 'js']; c = b.join(' '); h.className += ' ' + c; return c; }; css_browser_selector(navigator.userAgent);

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// lightbox for newsletter signup
$(document).ready(function() {
    $('a.newsletterSignup').click(function() {
        _buildLightbox();

        var windowHeight = $(window).height();
        var lightboxHeight = $('#lightboxContent').height();

        $('#lightboxContentWrap').css('top', (windowHeight / 2) - (lightboxHeight / 2));

        _loadContent(newsletterUrl);

        return false;
    });
});
function _showNewsletterLightbox() {
    _buildLightbox();

    var windowHeight = $(window).height();
    var lightboxHeight = $('#lightboxContent').height();

    $('#lightboxContentWrap').css('top', (windowHeight / 2) - (lightboxHeight / 2));

    _loadContent('/newslettersignup.aspx');

    return false;
}
// ------------------------------------------------------------------------------------
function _buildLightbox() {
    $('body').append('<div id="lightboxOverlay"></div>');
    $('body').append('<div id="lightboxContentWrap"><div id="lightboxContent"><a class="close" href="#">Close</a><div id="lightboxLoadTarget"></div></div></div>');

    $('#lightboxOverlay').click(function() {
        _destroyLightbox()
    });
    $('#lightboxContentWrap').click(function() {
        _destroyLightbox()
    });
};
// ------------------------------------------------------------------------------------
function _destroyLightbox() {
    $('#lightboxOverlay').remove();
    $('#lightboxContentWrap').remove();
};
// ------------------------------------------------------------------------------------
function _loadContent(url) {
    $('#lightboxLoadTarget').html('<iframe src="' + url + '" border="0" frameborder="0" width="440px" height="626px" scrolling="no" />');
};


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//clearing input fields start
function ClearInput(value, obj){
	if(value == obj.value)
		obj.value = '';
}
//clearing input fields end
function ResetInput(value, obj){
	if(obj.value.length == 0)
		obj.value = value;
}
function PostBackOnReturn(event, postbackMethod){
    if(event){
        if(event.keyCode==13){
            __doPostBack(postbackMethod,'');
        }
    }
}
// clear textarea start
var clickedIt = false;
function cleartextarea(id){
	if (clickedIt == false){
		id.value="";
		clickedIt=true;
	}
}
// clear textarea end
function changeBorder(id){
	obj = MM_findObj(id);
	obj.style.border = "1px solid #F5F012";
	//obj.style.color = "#FFFFFF";
}
function changeBorderBack(id){
	obj = MM_findObj(id);
	obj.style.border = "1px solid #000000";
}
function changeBorderBack2(id){
	obj = MM_findObj(id);
	obj.style.border = "1px solid #333333";
}
function changeBorderComment(id){
	obj = MM_findObj(id);
	obj.style.border = "1px solid #F5F012";
}
function changeBorderBackComment(id){
	obj = MM_findObj(id);
	obj.style.border = "1px solid #CCCCCC";
}
//popUp that div start
var amID = "blank";
function showMe(containerId,containerId2){
	if(amID != "blank" ){
		hideMe(amID);
		changeBack(amClassId);
	}
	if(amID != containerId){
	    amID = containerId;
	    showContainer(containerId);
		amClassId = containerId2;
		setClass(containerId2);
	}else{
        amID = "blank";
		amClassId = "blank";
    }
}
function showContainer(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
}
function hideMe(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}
//popUp that div end
//change that class then back start
var amClassId = "blank";
function setClass(containerId2){
	obj = MM_findObj(containerId2);
	if (!obj) return;
	obj.className = 'active';
}
function changeBack(containerId2){
	obj2 = MM_findObj(containerId2)
	if (!obj2) return;
	obj2.className = 'question';
}
//change that class then back end
//showSubNav start
var amID = "blank";
function showSubNav(containerId){
	if(amID != "blank" ){
		hideMe(amID);
	}
	if(amID != containerId){
	    amID = containerId;
	    showContainer(containerId);
	}else{
        amID = "blank";
    }
}
//showSubNav end