/* tabs */
function OfficeTabs_OnClick(index,callee){
	if ( callee == 0 ){
		switch ( index ){
			case 0:
				location.href = "?location=4&listingtype=" + HttpManager.Request.QueryString("listingtype");
				break;
			case 1:
				location.href = "?location=5&listingtype=" + HttpManager.Request.QueryString("listingtype");
				break;
			case 2:
				location.href = "?location=6&listingtype=" + HttpManager.Request.QueryString("listingtype");
				break;
		}
	}
}

function OfficeTabs_OnLoad(){
	var iIndex = -1;
	switch ( HttpManager.Request.QueryString("location") ){
		case "4":
			iIndex = 0;
			break;
		case "5":
			iIndex = 1;
			break;
		case "6":
			iIndex = 2;
			break;
	}	
	if ( iIndex >= 0 ) {
		HttpManager.Document.GetObject("cntrlOfficeTabs").selectTabIndex( iIndex, 1 );
	}
}

function LettingsTabs_OnClick(index,callee){
	if ( callee == 0 ){
		switch ( index ){
			case 0:
				location.href = "tenant-information.aspx";
				break;
			case 1:
				location.href = "landlord-information.aspx";
				break;
			case 2:
				location.href = "free-property-valuation.aspx";
				break;
		}
	}
}

function SalesTabs_OnClick(index,callee){
	if ( callee == 0 ){
		switch ( index ){
			case 0:
				location.href = "buyer-information.aspx";
				break;
			case 1:
				location.href = "seller-information.aspx";
				break;
			case 2:
				location.href = "free-property-valuation.aspx";
				break;
		}
	}
}

function OfficeSalesTabs_OnClick(index,callee){
	if ( callee == 0 ){
		switch ( index ){
			case 0:
				location.href = "search.aspx?location=4&listingtype=5";
				break;
			case 1:
				location.href = "search.aspx?location=5&listingtype=5";
				break;
			case 2:
				location.href = "search.aspx?location=6&listingtype=5";
				break;
		}
	}
}

function OfficeLettingsTabs_OnClick(index,callee){
	if ( callee == 0 ){
		switch ( index ){
			case 0:
				location.href = "search.aspx?sp=1&location=4&minprice=&maxprice=&minbedrooms=&maxbedrooms=&page=&listingtype=6&sv=0&obd=0&obc=0&rentperiod=2";
				break;
			case 1:
				location.href = "search.aspx?sp=1&location=5&minprice=&maxprice=&minbedrooms=&maxbedrooms=&page=&listingtype=6&sv=0&obd=0&obc=0&rentperiod=2";
				break;
			case 2:
				location.href = "search.aspx?sp=1&location=6&minprice=&maxprice=&minbedrooms=&maxbedrooms=&page=&listingtype=6&sv=0&obd=0&obc=0&rentperiod=2";
				break;
		}
	}
}