function gridView() {
    $("div#tp-banners").gridView({
		url: '/ajax/treatmentProviders.php'
	});
$("div#list-icon").removeClass("list-selected").addClass("list");
$("div#grid-icon").removeClass("grid").addClass("grid-selected");
}
$(document).ready(function ($) {
    $("input.emailCaptureAddress").defaultValue("Enter email address here");
    $("input.search-field").defaultValue("city & state or zip code");
    $("input.name").defaultValue("name");
    $("input.phone").defaultValue("phone");
    $("input.email").defaultValue("email");
    $("textarea.comments").defaultValue("comments");
    $("a.playerLink").ytPlay();
    $("div#watch-episode-page").parent().css({
		'width': '1034px'
	});
    $("div#about-page").parent().css({
		'width': '1109px'
	});
   // $("div.scroll-videos").scrollable();
});
var delayb4scroll = 2000
var marqueespeed = 1
var pauseit = 1
var copyspeed = marqueespeed
var pausespeed = (pauseit == 0) ? copyspeed : 0
var actualheight = ''

function scrollmarquee() {
	if (parseInt(cross_marquee.style.top) > (actualheight * (-1) + 8)) cross_marquee.style.top = parseInt(cross_marquee.style.top) - copyspeed + "px"
	else cross_marquee.style.top = parseInt(marqueeheight) + 8 + "px"
}

function initializemarquee() {
	cross_marquee = document.getElementById("vmarquee")
	if (cross_marquee) {
		cross_marquee.style.top = 0
		marqueeheight = document.getElementById("marqueecontainer").offsetHeight
		actualheight = cross_marquee.offsetHeight
		if (window.opera || navigator.userAgent.indexOf("Netscape/7") != -1) {
			cross_marquee.style.height = marqueeheight + "px"
			cross_marquee.style.overflow = "scroll"
			return
		}
		setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
	}
}
if (window.addEventListener) window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent) window.attachEvent("onload", initializemarquee)
else if (document.getElementById) window.onload = initializemarquee
	
function gotoState(sel){
	var state = sel.options[sel.options.selectedIndex].value;
	if (state != ''){
		var url = '/treatment-providers-state/' + state;
		location.href = url;
	}
}
function gotoKeyword(sel){
	var url = sel.options[sel.options.selectedIndex].value;
	if (url != ''){
		location.href = url;
	}
}

$(document).ready(function () {
    if ($('#container-1')!=null) {
        var api = $('#container-1').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'fast' });
    }
    /*
    api.onClick(function(){
    alert('test');
    });
    $('#paging_arrow').click(function(){
    alert(api);
    api.next();
    });
    //
    */
});

function clearText(field){
   if (field.defaultValue == field.value) field.value = '';
   else if (field.value == '') field.value = field.defaultValue;
}

var currPage = 1;
function scrollToTop(pg){
	currPage = pg;
	$('html, body').animate({ scrollTop: 355 }, 'fast');
	if (pg != 1){
		document.getElementById('paging_image').style.top = '1080px';
		document.getElementById('paging_list').style.top = '1130px';
	} else {
		document.getElementById('paging_image').style.top = '1320px';
		document.getElementById('paging_list').style.top = '1370px';
	}
}

function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}
function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}
