//ADDED FOR http://nycballet.com  cases  -BJM

//if (document.domain == "nycballet.com"){
//	//alert ("www.nycballet.com");
//	location.href = "http://www.nycballet.com";
//}

	function popup(href){
		wnum = 0;
	if(href.length > 0){
		wnum++;
		window.open(href, "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=yes,height=300,width=400");
		}
	}
	function popup(href,h,w){
		wnum = 0;
	if(href.length > 0){
		wnum++;
		window.open(href, "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=yes,height=630,width=800");
		}
	}
function popupAlpha(href){
		wnum = 0;
	if(href.length > 0){
		wnum++;
		window.open(href, "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=yes,height=660,width=800");
		}
	}
	function popupGeorge(href){
		wnum = 0;
	if(href.length > 0){
		wnum++;
		window.open(href, "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=yes,height=475,width=625");
		}
	}

	function popupColor(href){
		wnum = 0;
	if(href.length > 0){
		wnum++;
		window.open(href, "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=yes,height=500,width=550");
		}
	}

function popupGall(href){
		wnum = 0;
	if(href.length > 0){
		wnum++;
		window.open(href, "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=no,height=630,width=670");
		}
	} 
	
	function popupKir(href){
		wnum = 0;
	if(href.length > 0){
		wnum++;
		window.open(href, "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=no,height=640,width=590");
		}
	} 
	
 
	/* SLIDE GALLERY */
function changeImage(i)
      {

      var image = pic[i].split("/-/");
document.getElementById('Gall_MainImage').innerHTML =  image[0]  ;
document.getElementById('Gall_ImageText').innerHTML = image[1];

}
/*END SLIDE GALLERY */

function changeTourImage(i)
{
document.getElementById('Tour_Image').innerHTML =  pic[i]  ;
}

function openPuzzles(i){

wnum = 0;
	
		wnum++;
		
		window.open("/nycb/content/crossword.aspx?puzzle="+i+"", "window"+wnum, 
"toolbar=no,location=no,directories=no,resizable=yes,status=no,menubar=no,scrollbars=yes,height=700,width=800");
		
}
//JavaScript for Rollovers

if (document.images) {
	roll_01_on = new Image();				// Inactive Images
	roll_01_on.src ="/nycb/images/2008/HOME_saba.jpg";
	roll_02_on = new Image();
	roll_02_on.src ="/nycb/images/2008/HOME_nyci.jpg";

    roll_01_off = new Image();				// Inactive Images
	roll_01_off.src ="/nycb/images/2008/HOME_saba.jpg";
	roll_02_off = new Image();
	roll_02_off.src ="/nycb/images/2008/HOME_nyci.jpg";
}

// Function to 'activate' images.
function imgOn(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "_on.src");
	}
}

// Function to 'deactivate' images.
function imgOff(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "_off.src");
	}
}

// REP CREDITS 

function OpenCredit(obj){

//x = obj.offsetParent.offsetTop + obj.offsetTop ;
//x = x- 65;

x = 160 ;
y = document.getElementById('right').offsetLeft - 325;

document.getElementById('Credits_Table').style.visibility= "visible";
document.getElementById('Credits_Table').style.top =  x + "px";
document.getElementById('Credits_Table').style.left = y + "px";
document.getElementById('Credits_Table').style.background = "#ffffff";
document.getElementById('Credits_Table').style.border= "1px solid #000000";

}

function CloseCredit(){
document.getElementById('Credits_Table').style.visibility= "hidden";
}


function playClip(x){
	var randomnumber=Math.floor(Math.random()*999999999);
    document.getElementById('MusicClip').style.display="inline" ; 
	
    document.getElementById('MusicClip').src = "/nycb/content/clip.aspx?clip=" + x +"_"+randomnumber + "&np=" + randomnumber;
    document.getElementById('MusicClip').style.top = (document.all)?document.body.scrollTop:window.pageYOffset + "px" ;
        if (document.getElementById('MusicClip').style.top == "0px")
         {
         document.getElementById('MusicClip').style.top = "500px";
         }

}


function addBreaks(x)
{
sbr2 = /\"/g;
	
	sbr =/\^/g;

	x = x.replace(sbr2, "&quot;");
document.write(x.replace(sbr, "<br />"));
}