﻿<!--//

function expand(oElementID,path)
{
oXpander = 'expanderText' + oElementID
if (document.getElementById(oXpander).style.display=="")
	{
	document.getElementById(oXpander).style.display="none";
	if(document.getElementById(oXpander+'Left'))
	{
	document.getElementById(oXpander+'Left').style.display="none";
	}
	MM_swapImage(oElementID,'','/images/interface/'+path+'/b_'+oElementID+'_2.jpg',1)
	document.getElementById(oElementID+'Text').innerText = 'Click to open details';
	
	}
else
	{
	document.getElementById(oXpander).style.display="";
	if(document.getElementById(oXpander+'Left'))
	{
	document.getElementById(oXpander+'Left').style.display="";
	}
	MM_swapImage(oElementID,'','/images/interface/'+path+'/b_'+oElementID+'_3.jpg',1)
		document.getElementById(oElementID+'Text').innerText = 'Click to close details';
	}
}


function changeImage(oElementID,path)
{
oXpander = 'expanderText' + oElementID
if (document.getElementById(oXpander).style.display=="")
	{
	MM_swapImage(oElementID,'','/images/interface/'+path+'/b_'+oElementID+'_3.jpg',1)
	}
else
	{
	MM_swapImage(oElementID,'','/images/interface/'+path+'/b_'+oElementID+'_2.jpg',1)
	}
}


function secureThis(obj){
var newO=document.createElement('input');
newO.setAttribute('type','password');
newO.setAttribute('name',obj.getAttribute('name'));
newO.setAttribute('class',obj.getAttribute('class'));
newO.setAttribute('id',obj.getAttribute('id'));
obj.parentNode.replaceChild(newO,obj);
setTimeout("document.getElementById('"+newO.getAttribute('id')+"').focus();", 10);
}




function changeSelect(oElementID,iIndex)
{
	
	document.getElementById(oElementID).selectedIndex = iIndex;
}

function isEmail(field)
{
return !(field.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1);

}

function isNumeric(field)
{
return (field.search(/^[-|+]*\d*.{1}\d*$/)!=-1);
}


function setSearchURL()
{
var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
       // alert(targ.id);		


var genre = document.getElementById('searchGenre').value;
var month = document.getElementById('searchMonth').value; 
if (document.getElementById('searchVenue'))
{
var venue = document.getElementById('searchVenue').value;
}
else
{

}

var search= document.getElementById('searchwostring').value;
var sortBy = document.getElementsByName('sortBy');

if (sortBy[1].checked ==true)
{
var action ="/search/" + genre + "/" + month + "/" + venue +"/title/";
}
else
{
var action ="/search/" + genre + "/" + month + "/" + venue +"/";
}

if ((search != '[ All ]') && (search != '') && (search != 'Site Search') && (search != 'Event Name or Artist'))
{
action = action += '?searchstring=' + search;
}

document.getElementById("search").setAttribute("action",action);

try{
document.getElementById("bottom_search").setAttribute("action",action);
}
catch(e)
{
}
}





function showWarningText(oWarningTextElement)
{
var bookingLink = document.getElementById('bookingLink').href;

var warningText = document.getElementById(oWarningTextElement).innerHTML.replace(/([^0-9])\./gi,'$1\.\n\n') + 'Click OK to continue to box office and to book your tickets.'
if (confirm(warningText.replace('&nbsp;',' ')))
{

   var win = window.open(bookingLink,'_bo')

            if(!(win))
            {window.location.href=bookingLink;}
            return true;   

        
return true;
}
else
{
return false;
}
}

function showWarningText2(oWarningTextElement)
{
var bookingLink = document.getElementById('bookingLink'+oWarningTextElement).href;

var warningText = document.getElementById('warningText'+oWarningTextElement).innerHTML.replace(/([^0-9])\./gi,'$1\.\n\n') + 'Click OK to continue to box office and to book your tickets.'
        warningText = warningText.replace(/&nbsp;/g,' ');
        warningText = warningText.replace(/\n /g,'\n');

if (confirm(warningText))
{
   var win = window.open(bookingLink,'_bo')

            if(!(win))
            {window.location.href=bookingLink;}
            return true;   
       
        
return true;
}
else
{
return false;
}
}




function showVIPWarningText(oWarningTextElement)
{
    var bookingLink = document.getElementById('bookingLinkVIP').href;
    var tandc = false;
    if (document.getElementById("agreetandc"))
    {
    if(document.getElementById("agreetandc").checked==true)
        {
       tandc = true;
        }
    }

   if (document.getElementById("agreetandc2"))
    {
    if(document.getElementById("agreetandc2").checked==true)
        {
       tandc = true;
        }
    }
    
    if (!tandc)
    {
        alert("Before you can proceed with booking this Hospitality package online you must tick the box to say that you have read and agree to the terms and conditions of booking our hospitality packages.");
    }
    else
    {
        if (document.getElementById(oWarningTextElement))
        {
        var warningText = document.getElementById(oWarningTextElement).innerHTML.replace(/([^0-9])\./gi,'$1\.\n\n')  + 'Click OK to continue to box office and to book your tickets.';
        warningText = warningText.replace(/&nbsp;/g,' ');
        warningText = warningText.replace(/\n /g,'\n');
        if (warningText != '')
        {
        if (confirm(warningText))
        {

       var win = window.open(bookingLink,'_bo')

            if(!(win))
            {window.location.href=bookingLink;}
        }
        else
        {
            return false;
        }
        }
        else
        {
        return true;
        }
        }
        else
        {
        return true;
        }
    }
}


function showSuitesWarningText(oWarningTextElement)
{

    var bookingLink = document.getElementById('bookingLinkSuites').href;
    var tandc = false;
    if (document.getElementById("suitesTandC"))
    {
    if(document.getElementById("suitesTandC").checked==true)
        {
       tandc = true;
        }
    }

   if (document.getElementById("suitesTandC2"))
    {
    if(document.getElementById("suitesTandC2").checked==true)
        {
       tandc = true;
        }
    }
    
    if (!tandc)
    {
        alert("Before you can proceed with booking this Hospitality Suite online you must tick the box to say that you have read and agree to the terms and conditions of booking our hospitality suite packages.");
    }
    else
    {
        if (document.getElementById(oWarningTextElement))
        {
        var warningText = document.getElementById(oWarningTextElement).innerHTML.replace(/([^0-9])\./gi,'$1\.\n\n')  
	if (bookingLink.indexOf("*") == 0 )
	{	
 	warningText = warningText  +'Click OK to continue to box office and to book your tickets. ';
	} 
       warningText = warningText.replace(/&nbsp;/g,' ');
        warningText = warningText.replace(/\n /g,'\n');
        
        if (warningText != '')
        {
        if (confirm(warningText))
        {
	if (bookingLink.indexOf("*") == 0 )
	{
		var win = window.open(bookingLink,'_bo')

            	if(!(win))
            	{
			window.location.href=bookingLink;
		}
		return true;
		
	}else
			{return false;}

        }
        else
        {
            return false;
        }
        }
        else
        {

        return true;
        }
        }
        else
        {

        return true;
        }
        
    }
}




function oldtestBookingLink(iSiteID)
{
link = document.getElementById('bookinglink').value;
if (iSiteID == 1)
{
    if (link.length > 35)
    {
        if (document.getElementById('pickaseat').checked)
        {window.open('https://www.sheffieldboxoffice.com/online/mapSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldarena','bookinglink','',false)}
        else
        {window.open('https://www.sheffieldboxoffice.com/online/seatSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldarena','bookinglink','',false)}
    }
    else
    {window.open('https://www.sheffieldboxoffice.com/Online/default.asp?BOset::WSseatSearch::Query::Clause::10::value='+link+'&brand=sheffieldarena','bookinglink','',false)}
}
else
{
   if (link.length > 35)
    {
    if (document.getElementById('pickaseat').checked)
    {window.open('https://www.sheffieldboxoffice.com/online/mapSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldticketsarena','bookinglink','',false)}
    else
    {window.open('https://www.sheffieldboxoffice.com/online/seatSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldticketsarena','bookinglink','',false)}
    }
    else
    {window.open('https://www.sheffieldboxoffice.com/Online/default.asp?BOset::WSseatSearch::Query::Clause::10::value='+link+'&brand=sheffieldticketsarena','bookinglink','',false)}
}
}



function oldtestVIPLink(iSiteID)
{
link = document.getElementById('sisarenaclubbookinglink').value;
if (iSiteID == 1)
{
    if (link.length > 35)
    {window.open('https://www.sheffieldboxoffice.com/online/seatSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldarenaclub','bookinglink','',false)}
    else
    {window.open('https://www.sheffieldboxoffice.com/Online/default.asp?BOset::WSseatSearch::Query::Clause::10::value='+link+'&brand=sheffieldarenaclub','bookinglink','',false)}
}
else
{
   if (link.length > 35)
    {window.open('https://www.sheffieldboxoffice.com/online/seatSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldarenaclub','bookinglink','',false)}
    else
    {window.open('https://www.sheffieldboxoffice.com/Online/default.asp?BOset::WSseatSearch::Query::Clause::10::value='+link+'&brand=sheffieldarenaclub','bookinglink','',false)}
}
}


function oldtestSuitesLink(iSiteID)
{
link = document.getElementById('suitebookinglink').value;
if (iSiteID == 1)
{
    if (link.length > 35)
    {window.open('https://www.sheffieldboxoffice.com/online/seatSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldarenapsh','bookinglink','',false)}
    else
    {window.open('https://www.sheffieldboxoffice.com/Online/default.asp?BOset::WSseatSearch::Query::Clause::10::value='+link+'&brand=sheffieldarenapsh','bookinglink','',false)}
}
else
{
   if (link.length > 35)
    {window.open('https://www.sheffieldboxoffice.com/online/seatSelect.asp?BOset::WSadmissions::admission::performance_id='+link+'&brand=sheffieldarenapsh','bookinglink','',false)}
    else
    {window.open('https://www.sheffieldboxoffice.com/Online/default.asp?BOset::WSseatSearch::Query::Clause::10::value='+link+'&brand=sheffieldarenapsh','bookinglink','',false)}
}
}




function testSuitesLink(iSiteID)
{
link = document.getElementById('suitebookinglink').value;
testLinks(iSiteID,2,link);
}


function testBookingLink(iSiteID)
{
link = document.getElementById('bookinglink').value;
testLinks(iSiteID,1,link); 
}


function testVIPLink(iSiteID)
{
link = document.getElementById('sisarenaclubbookinglink').value;
testLinks(iSiteID,3,link); 
}

function testLinks(iSiteID,iLinkType,strLink)

{
  

 if (strLink.indexOf("ttp") > 0 )

{
bookingLink = strLink;
}
else
{

 var bookingLink;

    switch  (iLinkType)
         {
         case 1: bookingLink = "https://www.sheffieldboxoffice.com/<brand>/online/<pickaseat>Select.asp?BOset::WSmap::seatmap::performance_ids=<pid>";break;
         case 2: bookingLink = "https://www.sheffieldboxoffice.com/<brand>/online/mapSelect.asp?BOset::WSmap::seatmap::performance_ids=<pid>";break;
         case 3: bookingLink = "https://www.sheffieldboxoffice.com/<brand>/online/mapSelect.asp?BOset::WSmap::seatmap::performance_ids=<pid>";break;

         
	}

	bookingLink = bookingLink.replace('<pid>',strLink);


   if (link.length > 35)

    var pickaseat
    if(document.getElementById('pickaseat').checked)
    {pickaseat = "map";}
     else
    {pickaseat = "seat";}


	bookingLink = bookingLink.replace('<pickaseat>',pickaseat);
 

    var brand

    switch  (iLinkType)
         {
         case 1:  if (iSiteID == 1) {brand = "sheffieldarena"}  else {brand = "sheffieldticketsarena"};break;
         case 2: brand = "sheffieldarenapsh";break;
         case 3: brand = "sheffieldarenaclub";break;
         }

	bookingLink = bookingLink.replace('<brand>',brand);
	
}
window.open(bookingLink,'bookinglink','',false);
}




//-->

