// Function to check the Invalid chars in the email address
// File created: Vipin Vij
// Called from: Default.asp to check the email address entered by the client.
function invalidChars(validatedControl, validatedName, charString, msg) {
	var validatedString = validatedControl.value
	charString = charString.toLowerCase()
	for (var i=0; i<validatedString.length; i++) {
		for (var j=0; j<charString.length; j++) {
			if (validatedString.charAt(i) == charString.charAt(j)) {
			
				if (typeof (Common_Scripts_FuncLib_Space) == "undefined")
					Common_Scripts_FuncLib_Space = "space"
					
				var alertString = charString.split("").join("  ")
				alertString = alertString.split("     ").join("  " + Common_Scripts_FuncLib_Space + "  ")
				
				if (msg == null)				
				//msg = validatedName + " cannot contain any of the following illegal characters:\n\n " + alertString
				msg = emailchar;
				msg = msg.replace(/\[IllegalCharacters\]/, alertString)
				alert(msg )					
				validatedControl.focus()
				validatedControl.select()
				return true
			}
		}
	}
	return false
}

//validate and submit member login details
function memberLogin(frm) {
	if (frm.email.value=="")
	{
	   // alert("Please Enter Email");
	    alert(JSMsgLog3);
		frm.email.focus();
		frm.email.select();
	    return;
	}
		if (frm.password.value=="")
	{
	   // alert("Please Enter Password");
	    alert(JSRegFrmMsg12);
		frm.password.focus();
		frm.password.select();
	    return;
	}
	var email = frm.email.value;
    for (var i=0; i<email.length; i++) {
		if (email.charAt(i) == "@") at = true
		if (email.charAt(i) == "." && at) dot = true
	}
    var at = false
	var dot = false
	for (var i=0; i<email.length; i++) {
		if (email.charAt(i) == "@") at = true
		if (email.charAt(i) == "." && at) dot = true
	}
	var msg
	if (!(at && dot && email.length > 5)) {
		if (msg == null)
			//msg = "The email you entered is not a valid e-mail address."
			msg = JSMsgLog1;
		
		alert(msg)		
		frm.email.focus()
		frm.email.select()
		return false;
		}
		
		//var alertString='%#^!&*,;|" <>\\/';
		 //var validatedName = "E-mail cannot contain any of the following illegal characters:\n\n " + alertString
		 // var validatedName = emailchar;
		  //validatedName = validatedName.replace(/\[IllegalCharacters\]/, alertString);
	//if (invalidChars(frm.email, "E-mail", '%#^!&*,;|" <>\\/',validatedName))
	//{
//		return true;
//	}
	frm.submit();
}

function ShowSearchBy(id, blk)
{
    if(id == 'sbd')
    {   
        document.getElementById('sbd').style.display = "block";   
        document.getElementById('sbh').style.display = "none";   
        document.getElementById('sbho').className = "nonSelected"; 
        document.getElementById('sbde').className = "";
		document.getElementById('srchbut').className = "button";
    }
    else 
    {   
        document.getElementById('sbd').style.display = "none";   
        document.getElementById('sbh').style.display = "block"; 
        document.getElementById('sbho').className = ""; 
        document.getElementById('sbde').className = "nonSelected";
		document.getElementById('srchbut').className = "button mt85";
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////
// Functions for Search engine Check In and Check Out Dates
////////////////////////////////////////////////////////////////////////////////////////////////////////


function init() 
{
	if (typeof(populateDates) != "undefined") 
		{  
			populateDates('inDate', 'outDate');
		    populateDates('InDateHotelName', 'OutDateHotelName');
		}
}

window.onload = init

var objCookie

//Instantialise and initialise cookie object
function initCookie()
{
	objCookie = new cookieVal("", "", "", "", "")

	var cookieArray = URLDecode(document.cookie).split("|")

	for (var i=0; i<cookieArray.length; i++)
		{
			if (cookieArray[i] == "SearchEng") 
				{
					objCookie.country = cookieArray[i+2]
					objCookie.city = cookieArray[i+3]
					objCookie.suburb = cookieArray[i+4]
					objCookie.inDate = cookieArray[i+5]
					objCookie.outDate = cookieArray[i+6]

					break
				}
		}

	//If dates are present in the querystring, set them from there
	var qsInDate = GetQSVal("inDate")
	if (qsInDate != "") objCookie.inDate = qsInDate
	var qsOutDate = GetQSVal("outDate")
	if (qsOutDate != "") objCookie.outDate = qsOutDate

}

//Populate and set select boxes
function populateDates(objIdIn, objIdOut)
{
	//Instantialise and initialise cookie object
	initCookie()

	//Populate dates
	populateDate(objIdIn, new Date(curYear, curMonth, curDay - 1))  //start from yesterday - to consider the whole world times
	populateDate(objIdOut, new Date(curYear, curMonth, curDay))

	//Set dafaults

	setVal(objIdIn, RemoveDateZeros(objCookie.inDate))
	setVal(objIdOut, RemoveDateZeros(objCookie.outDate))
	//debugger;
    
	setWkd('inWkd', 'outWkd', 'inDate')
	setWkd('inWkdHotelName', 'outWkdHotelName', 'InDateHotelName')
}

//Populate date select box
function populateDate(ctl, startDate)
{
	var optDate = new Date(startDate)
	//clear select box
	ctl.length = 0
	
	if (bookPeriod > 0 && bookPeriod < 11 && (ctl == "outDate" || ctl == "OutDateHotelName")) {
		bookPeriod = bookPeriod + bookPeriod
	} 
	else if (bookPeriod > 10 && bookPeriod < 21 && (ctl == "outDate" || ctl == "OutDateHotelName")) {
		bookPeriod = 21
	}
	
	
	if (CheckOutPeriod > 0 && CheckOutPeriod < 21 && (ctl == "outDate" || ctl == "OutDateHotelName")) {
		bookPeriod = CheckOutPeriod;
	} 

	//Populate select box
	for (var i=0; i<=bookPeriod; i++) {
		getObject(ctl)[i] = new Option(formatDateText(optDate), formatDateVal(optDate))
		optDate.setDate(optDate.getDate() + 1)
	}

	if(ctl=='inDate' || ctl=='InDateHotelName')
		getObject(ctl).selectedIndex = 1

	if(ctl=='outDate' || ctl == "OutDateHotelName")
		getObject(ctl).selectedIndex = 2
}

function formatDateText(date)
{
	var dateVal

	dateVal = date.getDate()
	if (dateVal < 10) dateVal = "0" + dateVal

	var arrMask = dateMask.split("|")

	var sTmpDate = dateMask.replace(/y/, date.getFullYear())
	sTmpDate = sTmpDate.replace(/m/, monthArray[date.getMonth()])
	sTmpDate = sTmpDate.replace(/d/, dateVal)
	sTmpDate = sTmpDate.replace(/\|/g, arrMask[3])

	if (arrMask[3] != "")
		sTmpDate = sTmpDate.substring(0, sTmpDate.length - 2)

	return sTmpDate
}

function formatDateVal(date)
{
	return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate()
}

//Extract value from querystring for the passed name
function GetQSVal(qsName) {
	var qsPair
	var qsVal = ""
	var qString = location.search.substr(1)
	var arrNameVal = qString.split("&")

	for (var i in arrNameVal) {
		qsPair = arrNameVal[i].split("=")

		if (URLDecode(qsPair[0]) == qsName) {
			qsVal = URLDecode(qsPair[1])
			break
		}
	}

	return qsVal
}

//UnEncode url-encoded string
function URLDecode(urlStr) {
	return unescape(urlStr.replace(/\+/g, " "))
}

//Cookie values object constructor
function cookieVal(country, city, suburb, inDate, outDate) {
	this.country = country
	this.city = city
	this.suburb = suburb
	this.inDate = inDate
	this.outDate = outDate
}

//Set select box value
function setVal(ctl, newVal) {
	for (var i=0; i<getObject(ctl).length; i++) {
		if (getObject(ctl)[i].value == newVal) {
			getObject(ctl)[i].selected = true
			getObject(ctl).selectedIndex = i
			break
		}
	}
}

//Set days of week and length of stay
function setWkd(objInWK, objOutWK, InDateParam)
{
    var checkinDate = ''
	var checkoutDate = '' 
	
	if(InDateParam == 'inDate')
	{
	    checkinDate = getDateFromCtl('inDate')	
	    checkoutDate = getDateFromCtl('outDate')
	    
	    //set days of week
	    getObject(objInWK).innerHTML = "(" + wkdArray[checkinDate.getDay()] + ")"
	    getObject(objOutWK).innerHTML = "(" + wkdArray[checkoutDate.getDay()] + ")"
	    
	    //Set length of stay
	    getObject('lenofStay').innerHTML = Math.round((checkoutDate - checkinDate) / 86400000)	    
	}
	else if(InDateParam == 'InDateHotelName')
	{
	    checkinDate = getDateFromCtl('InDateHotelName')	
	    checkoutDate = getDateFromCtl('OutDateHotelName')
	    
	    //set days of week
	    getObject(objInWK).innerHTML = "(" + wkdArray[checkinDate.getDay()] + ")"
	    getObject(objOutWK).innerHTML = "(" + wkdArray[checkoutDate.getDay()] + ")"
	    
	    //Set length of stay
	    getObject('lenofStayHotelName').innerHTML = Math.round((checkoutDate - checkinDate) / 86400000)
	}
}

//Get date from the date select box
function getDateFromCtl(ctl)
{
	var arrDate = getVal(ctl).split("-")
	return new Date(arrDate[0], arrDate[1] - 1, arrDate[2])
}

//Remove leading zeros from canonically-formatted date elements
function RemoveDateZeros(dtStr)
{
	var dtArr = dtStr.split("-")
	return Number(dtArr[0]) + "-" + Number(dtArr[1]) + "-" + Number(dtArr[2])
}

//Get select box value
function getVal(ctl) 
{
	return  getObject(ctl).value
}

//Reset out date to (in date + 1) if out date <= in date
function resetOutDate(InDateParam)
{
     if(InDateParam == 'InDate')
    {
    
        if (getObject('outDate').selectedIndex < getObject('inDate').selectedIndex)
        {
            getObject('outDate').selectedIndex = getObject('inDate').selectedIndex
        }    
    }
    else if(InDateParam == 'InDateHotelName')
    {
        if (getObject('OutDateHotelName').selectedIndex < getObject('InDateHotelName').selectedIndex)
        {
            getObject('OutDateHotelName').selectedIndex = getObject('InDateHotelName').selectedIndex
        }    
    }
    
	
	DateChangeExtras()
}

//Reset in date to (out date - 1) if in date >= out date
function resetInDate(InDateParam)
{
    if(InDateParam == 'InDate')
    {
        if (getObject('inDate').selectedIndex > getObject('outDate').selectedIndex) 
        {
            getObject('inDate').selectedIndex = getObject('outDate').selectedIndex
        }    
    }
    else if(InDateParam == 'InDateHotelName')
    {
        if (getObject('InDateHotelName').selectedIndex > getObject('OutDateHotelName').selectedIndex) 
        {
            getObject('InDateHotelName').selectedIndex = getObject('OutDateHotelName').selectedIndex
        }    
    }
	
	DateChangeExtras()
}

//Extra work that needs to be done when a date is changed
function DateChangeExtras()
{
	//set weekdays and length of stay
	setWkd('inWkd', 'outWkd', 'inDate')
	setWkd('inWkdHotelName', 'outWkdHotelName', 'InDateHotelName')
}

//Save selected dates and location to cookie
function setSelCookie(country, city, suburb, inDate, outDate)
{
	document.cookie = escape("|SearchEng|") + "=" + escape("|"
		+ country + "|" + city + "|" + suburb + "|"
		+ inDate + "|" + outDate + "|")
		+ ";path=/"
}


//Reload page with new in/out dates
function changeDates()
{
	//To check 25 nights of booking.
	var arrinDate = getVal('inDate').split("-")
	var arroutDate = getVal('outDate').split("-")
	
	var checkin = new Date(arrinDate[0], arrinDate[1] - 1, arrinDate[2])
	var checkout = new Date(arroutDate[0], arroutDate[1] - 1, arroutDate[2])
	
	if (Math.round((checkout - checkin) / 86400000) > 25)
	{
		if (typeof (StayTooLong_Msg) == "undefined")
			//StayTooLong_Msg = "Your period of stay should be not longer than 25 nights.\n\nIf you wish to book for more than 25 nights, please send us an e-mail with your request."
			StayTooLong_Msg = SB_StaytoLong;

		alert(StayTooLong_Msg)
		getObject('outDate').focus()
		return
	}

	//Save new dates to the cookie
	setSelCookie(objCookie.country, objCookie.city, objCookie.suburb, getVal('inDate'), getVal('outDate'))

	//Get new querystring
	var qString = location.search.substr(1)
	
	qString = setQStringName(qString, "inDate", new Array(getVal('inDate')))
	qString = setQStringName(qString, "outDate", new Array(getVal('outDate')))

	//Do some extra work if dates are changed on the search results page

	if (getObject('showAll')) {
		//Set page to 1
		qString = setQStringName(qString, "page", new Array("1"))
		
		//set currenctly selected search option
		//for (var i = 0; 1 < getObject('showAll').length; i++) {
			if (getObject('showAll').checked) {
				var showAll = getObject('showAll').value
				//break
			}

			if (getObject('showAvail').checked) {
				var showAll = getObject('showAvail').value
				//break
			}
		//}

		qString = setQStringName(qString, "ShowAll", new Array(showAll))
	}
	

	if (getObject('SearchHotel')) {
		
		//set currenctly selected Hotel search option
			if (getObject('SearchHotel').checked) {
				
				var SearchHotel = getObject('SearchHotel').value
			}

			if (getObject('SearchApartments').checked) {
				var SearchHotel = getObject('SearchApartments').value
			}
		//}

		qString = setQStringName(qString, "SearchHotel", new Array(SearchHotel))
	}
	
	if (getObject('star5'))
	{
			
		//set currenctly selected 5 Star rating
			if (getObject('star5').checked) 
			{
				var Star5 = 'on'
				qString = setQStringName(qString, "star5", new Array(Star5))
			}
			else
			{
				qString = qString.replace('&star5=on','')
			}
	}

	if (getObject('star4'))
	{
			
		//set currenctly selected 4 Star rating
			if (getObject('star4').checked) 
			{
				var Star4  = 'on'
				qString = setQStringName(qString, "star4", new Array(Star4))
			}
			else
			{
				qString = qString.replace('&star4=on','')
			}
	}

	if (getObject('star3'))
	{
			
		//set currenctly selected 3 Star rating
			if (getObject('star3').checked) 
			{
				var Star3 = 'on'
				qString = setQStringName(qString, "star3", new Array(Star3))
			}
			else
			{
				qString = qString.replace('&star3=on','')
			}
	}

	location = location.pathname + "?" + qString
}


//Replace or add a name/value pairs in url-encoded querystring
function setQStringName(qString, name, arrVal) {
	var i
	var qStringNew = ""

	if (qString != "") {
		var curName
		var arrNameVal = qString.split("&")

		for (i in arrNameVal) {
			curName = arrNameVal[i].split("=")[0]
			curName = URLDecode(curName)
			if (curName.toLowerCase() != name.toLowerCase()) qStringNew += "&" + arrNameVal[i]
		}
	}

	for (i in arrVal) {
		qStringNew += "&" + escape(name) + "=" + escape(arrVal[i])
	}

	return qStringNew.substr(1)
}


//submit the form
function submitForm(SearchType) {	
	var selectedcity;
  var selectedsuburb;
	var frm = document.frmSearch
	var button, HotName, langMsg, star5, star4, star3, city, ShowAll, specCity
	var arrinDate, arroutDate, checkin, checkout, inWkd, lenStay, outWkd
	
	switch(SearchType)
	{
	    case "Des":	        	        
	        if (!(frm.star3.checked || frm.star4.checked || frm.star5.checked)) 
	            {
		            if (typeof (SearchEng_SelectStar) == "undefined")
			            //SearchEng_SelectStar = "Please select at least one Star Rating."
			            SearchEng_SelectStar = SelectStar;
			            
            			
		            alert(SearchEng_SelectStar)
		            frm.star5.focus()
		            return
	            }
	            
	            //to check 25 nights of booking.
	             arrinDate = getVal(frm.inDate.id).split("-")
	             arroutDate = getVal(frm.outDate.id).split("-")
            	
	             checkin = arrinDate[0] + "-" + arrinDate[1] + "-" + arrinDate[2]
	             checkout = arroutDate[0] + "-" + arroutDate[1] + "-" + arroutDate[2] 	             
	             
	             inWkd = document.getElementById("inWkd").innerHTML
	             lenStay = document.getElementById("lenofStay").innerHTML
	             outWkd = document.getElementById("outWkd").innerHTML       	            
	             
	              switch(getObject('showAll').checked)
                 {
                    case true:
                        ShowAll = "1"
                        break;	            
                    case false:
                        ShowAll = "0"
                        break;
                 }
	             //save selected country, city, suburb, in and out dates to a cookie
        	selectedcity=document.getElementById("city").options[document.getElementById("city").options.selectedIndex].value;
          selectedsuburb = document.getElementById("suburb").options[document.getElementById("suburb").options.selectedIndex].value;
          //alert(frm.country.value + ' ' + selectedcity + ' ' + selectedsuburb);
	        	            setSelCookie(frm.country.value, selectedcity, selectedsuburb, frm.inDate.value, frm.outDate.value)
	            HotName = ''
	             
	        break;
	    case "Home":
	        //to check 25 nights of booking.  
	         arrinDate = getVal(frm.InDateHotelName.id).split("-")
	         arroutDate = getVal(frm.OutDateHotelName.id).split("-")
        	
        	 checkin = arrinDate[0] + "-" + arrinDate[1] + "-" + arrinDate[2]
	         checkout = arroutDate[0] + "-" + arroutDate[1] + "-" + arroutDate[2] 
	         
	         inWkd = document.getElementById("inWkdHotelName").innerHTML
	         lenStay = document.getElementById("lenofStayHotelName").innerHTML
	         outWkd = document.getElementById("outWkdHotelName").innerHTML
	         
	         switch(getObject('showAllHotelName').checked)
	         {
	            case true:
	                ShowAll = "1"
	                break;	            
	            case false:
	                ShowAll = "0"
	                break;
	         }
	             
        	selectedcity=document.getElementById("city").options[document.getElementById("city").options.selectedIndex].value;
          selectedsuburb = document.getElementById("suburb").options[document.getElementById("suburb").options.selectedIndex].value;
	         //save selected country, city, suburb, in and out dates to a cookie
	        //setSelCookie(frm.country.value, frm.city.value, frm.suburb.value, frm.InDateHotelName.value, frm.OutDateHotelName.value)
	        //alert(frm.country.value + ' ' + selectedcity + ' ' + selectedsuburb);
	        setSelCookie(frm.country.value, selectedcity, selectedsuburb, frm.InDateHotelName.value, frm.OutDateHotelName.value)
	        
	        //validate hotel name
	       // langMsg = "Please complete this field using English characters."
	        langMsg = Message_ASCII;
	        

			if (typeof (SearchEng_HotelName) == "undefined")
				//SearchEng_HotelName = "Hotel Name cannot contain any of the following illegal characters:\n\n%"
				SearchEng_HotelName = HotelNameChar //+ "\n\n%"
				
				
			if (invalidChars(frm.HName, "", "%", SearchEng_HotelName)) return
			
			if (charCheck(frm.HName, langMsg)) return
			
			if (trim(frm.HName.value).length < 3) {
				if (typeof (SearchEng_NameLength) == "undefined")
					//SearchEng_NameLength = "Hotel Name should be at least 3 characters long."
					
					SearchEng_NameLength = HotelLength
					
					
					
				alert(SearchEng_NameLength)
				frm.HName.focus()
				return
			}
			HotName = frm.HName.value
	         break;
	}
	
	//validations	
	if (lenStay > 25)
	{
		if (typeof (StayTooLong_Msg) == "undefined")
			//StayTooLong_Msg = "Your period of stay should be not longer than 25 nights.\n\nIf you wish to book for more than 25 nights, please send us an e-mail with your request."
			StayTooLong_Msg = SB_StaytoLong


		alert(StayTooLong_Msg)
		frm.outDate.focus()
		return
	}
	
	selectedcity=document.getElementById("city").options[document.getElementById("city").options.selectedIndex].value;
            	 //selectedcity=document.getElementById("city").options[document.getElementById("city").options.selectedIndex].innerHTML;
  selectedsuburb = document.getElementById("suburb").options[document.getElementById("suburb").options.selectedIndex].value;
	//var selectedsuburb=frm.suburb.value;

//	alert(document.getElementById("suburb").options[document.getElementById("suburb").options.selectedIndex].innerHTML);
  selectedcity = selectedcity.replace('&', '%26');
  selectedsuburb = selectedsuburb.replace('&', '%26');
  selectedCountry = frm.country.value;
  selectedCountry = selectedCountry.replace('&', '%26');
  frm.action="SearchResults.asp?inDate=" + checkin + "&inWkd=" + escape(inWkd) + "&lenStay=" + lenStay + "&outDate=" + checkout + "&outWkd=" + escape(outWkd) + "&country=" + selectedCountry + "&star5="+ document.getElementById("star5").checked +"&star4="+ document.getElementById("star4").checked +"&star3="+ document.getElementById("star3").checked +"&city=" + selectedcity + "&hotelName=" + HotName + "&suburb="+ selectedsuburb +"&ShowAll=" + ShowAll + "&specCity="+ selectedcity
	if(checkout != "-undefined-undefined" &  checkin != "-undefined-undefined")
	{
		frm.submit()
	}
}

//prosess key-press event in hotel name text-box
function keyPressed(frm, pressedKeyCode) {
	if (pressedKeyCode == 13) submitForm()
}

//validate ASCII Character Set
function charCheck(field, message, toASCIIfield) 
{
	if (toASCIIfield == null)
		var txt = field.value
	else
		var txt = ToASCII(field)

	for (var i=0; i<txt.length; i++) 
	{
		if (txt.charCodeAt(i) >= 128) 
		{
			alert(message)
			field.focus()
			return true
		}
	}
	return false
}
function SyncDates(id)
{
	switch(id)
	{
		case "inDate":
		case "outDate":
					getObject("InDateHotelName").value=getObject("inDate").value;
					getObject("OutDateHotelName").value=getObject("outDate").value;
					getObject("lenofStayHotelName").innerHTML= getObject("lenofStay").innerHTML
				break;
		case "InDateHotelName":
		case "OutDateHotelName":
					getObject("inDate").value=getObject("InDateHotelName").value;
					getObject("outDate").value=getObject("OutDateHotelName").value;
					getObject("lenofStay").innerHTML= getObject("lenofStayHotelName").innerHTML;	
				break;
			
	}
}
function HotDealUpdate(id)
{
	switch(id)
	{
		case "inDate":
		case "InDateHotelName":
					for(var i=0;i<3;i++){
						var HotDealUrl,hotArr1,hotArr2,hotArr3;
						if(getObject("HotDeal"+i))
						{
							hotArr1=getObject("HotDeal"+i).href.split("indate=");
							hotArr2=hotArr1[1].split("outdate=");
							hotArr3=hotArr1[1].split("lc=");
							if(getObject("HotDeal"+i)){
								if(id=="InDateHotelName"){
									HotDealUrl=hotArr1[0]+"indate="+getObject(id).value+"&outdate="+getObject("OutDateHotelName").value+"&lc="+hotArr3[1];
								}else
									HotDealUrl=hotArr1[0]+"indate="+getObject(id).value+"&outdate="+getObject("outDate").value+"&lc="+hotArr3[1];
								document.getElementById("HotDeal"+i).href=HotDealUrl; 
							}
						}
					}
					break;
		case "outDate":
		case "OutDateHotelName":
					for(var i=0;i<3;i++){
						var HotDealUrl,hotArr1,hotArr2,hotArr3;
						if(getObject("HotDeal"+i))
						{
							hotArr1=getObject("HotDeal"+i).href.split("indate=");
							hotArr2=hotArr1[1].split("outdate=");
							hotArr3=hotArr1[1].split("lc=");
							if(getObject("HotDeal"+i)){
								if(id=="OutDateHotelName"){
									HotDealUrl=hotArr1[0]+"indate="+getObject("InDateHotelName").value+"&outdate="+getObject(id).value+"&lc="+hotArr3[1];
								}else							
									HotDealUrl=hotArr1[0]+"indate="+getObject("inDate").value+"&outdate="+getObject(id).value+"&lc="+hotArr3[1];
								document.getElementById("HotDeal"+i).href= HotDealUrl
							}
						}
					}
					break;
						

	}

}

//bookmark the site
function SetBookmark(url, title) {
	document.all.bookmark.src = "/Common/Bookmark.asp"
	window.external.AddFavorite(url, title)
}