var Windborne; if (!Windborne) Windborne = {}; if (!Windborne.Utils) Windborne.Utils = {};


$(document).ready( 
		function(){ 
 
		      //jquery stuff here
		      
		      $("[href='#contact']").replaceWith('<a href="http://www.vafest.org/2012/about_contactus4.html?KeepThis=true&height=310&width=400&TB_iframe=true" title="Contact Us" class="thickbox">Contact Us</a>');
		      
		      $("[href='#newsletter']").replaceWith('<a href="http://www.vafest.org/2012/newsletter.php?KeepThis=true&height=310&width=530&TB_iframe=true" title="Newsletter: Summer 2011" class="thickbox">Newsletter: Summer 2011</a>');
		      
		      $("[href='#travelcontact']").replaceWith('<a href="http://www.vafest.org/2012/tours_contactus.html?KeepThis=true&height=310&width=560&TB_iframe=true" title="Contact Us" class="thickbox">Contact Us</a>');
		      
		      $("[href='#travelpagecontact']").replaceWith('<a href="http://www.vafest.org/2012/travel_contactus.html?KeepThis=true&height=310&width=560&TB_iframe=true" title="Contact Us" class="thickbox">Contact Us</a>');
		      
		      		      
		      $("[href='#travelcontactlink']").replaceWith('<a href="http://www.vafest.org/2012/tours_contactus.html?KeepThis=true&height=310&width=560&TB_iframe=true" title="Contact Us" class="thickbox">click here</a>');
		      
			  $("[href='#boxoffice']").replaceWith('<a href="http://www.vafest.org/2012/about_boxoffice.html?KeepThis=true&height=250&width=560&TB_iframe=true" title="VAF Box Office" class="thickbox">VAF Box Office</a>');
			  
			  $("[href='#faq']").replaceWith('<a href="http://www.vafest.org/2012/faq.html?KeepThis=true&height=310&width=530&TB_iframe=true" title="Frequently Asked Questions" class="thickbox">Frequently Asked Questions</a>');

				 
		 } ); 


function init(vals) {
	

//remove for debugging
//DEBUG(vals,msg);
}


function openWindow(theURL,winName,features) { 
    window.open(theURL,winName,features);
}


function HTML_insert(id,code){
 var ele = Spry.$(id);
 ele.innerHTML=code;
 return;
}


function redirect(theurl) {
  document.location = theurl;
}

function redirect_blank(theurl) {
  window.open(''+theurl);
}



function getVisible(id) {
 var ele = Spry.$(id);
 var visibility_test = ele.style.visibility;
 if(visibility_test == "visible"){
  return true;
 } else {
  return false;
 }
}


function ToggleDiv(id)  {	
  var test_id = getVisible(id);
  var ele = Spry.$(id);
  if(!test_id){
     ele.style.visibility = 'visible';
  } else {
     ele.style.visibility = 'hidden';
  }  
}


function ShowDiv(id)  {
	var e = 'div#' + id;	
    Spry.$$(e).setStyle("visibility: visible;");	
}

function HideDiv(id) {
	var e = 'div#' + id;	
    Spry.$$(e).setStyle("visibility: hidden;");
}


function searchbox(){
	
}
//Backwards compat.   ///////////////////////////////////////
function HideLayer(id)  {
     HideDiv(id);
}

function ShowLayer(id)  {
     ShowDiv(id);
}

function ToggleLayer(id) {
	  ToggleDiv(id);
}

function myoff(id){
      HideDiv(id);
}

function tag_footer(){
var copyright_date = new Date();                    
var copyright_year = copyright_date.getFullYear(); 
var crt = '&copy; ';
var txtline = ' Virginia Arts Festival.  All artists, repertoire, performance dates, times, venues are subject to change.';
var tagline = crt + copyright_year + txtline;
HTML_insert('footer',tagline);
}


function open_SOL_popup(popkey){
  var theURL,popwidth,popheight;
  theURL = "popup_edu.php?solchoice=" + popkey;
  popwidth = 400;
  popheight = 250;  //Set height here if overall height is too much or too little
  
  MM_openBrWindow(theURL,"","scrollbars=yes,resizable=yes,width=" + popwidth + ",height=" + popheight + "");

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validate (){

}

///////////////////////////////////////////////////////////
///////////   Debugging  //////////////////////////////////

function myTest() {
	
	
	
	
	
	var vals = '';
    var msg = 'testing something: ' ;
    DEBUG(vals,msg);
}

function DEBUG(vals,message){
	if (vals == undefined || vals == ''){
	   var vals = 'no values passed';	
	}
	if(Spry.is.ie){
		alert('DBG: ' + message + ' ' + valtest);
	}else{
		console.log("DBG: %s %s\n", message, vals);
	}	
}
///////////////////////////////////////////////////////////


