// *******
// globals
// *******
var shwAucFired = '';

// ****************
// Google Analytics
// ****************
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17242893-1']);
_gaq.push(['_setDomainName', '.propertyauctionaction.co.uk']);
_gaq.push(['_setAllowHash', false]); 
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


// *********************************
// Display the current date and time
// ********************************* 
var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")	//predefine weekday names
var this_month_name_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December")	//predefine month names
var this_date_timestamp=new Date()	//get current day-time stamp
var this_weekday = this_date_timestamp.getDay()	//extract weekday
var this_date = this_date_timestamp.getDate()	//extract day of month
var this_month = this_date_timestamp.getMonth()	//extract month
var this_year = this_date_timestamp.getYear()	//extract year
if (this_year < 1000)
	this_year+= 1900;	//fix Y2K problem
if (this_year==101)
	this_year=2001;		//fix Netscape browsers - it displays the year as being the year 101!
var this_date_string = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date + ", " + this_year	//concat long date string


// ***************************************
// Display arrow dependent on browser type
// ***************************************
var stIsIE = /*@cc_on!@*/false;
var this_sortrevind = stIsIE ? '<span id="sorttable_sortrevind">&nbsp;<font face="webdings">5</font></span>' : '<span id="sorttable_sortrevind">&nbsp;&#x25B4;</span>';


// *******************
// ClearField Function
// *******************
function clearField(thefield) {
	if (thefield.defaultValue==thefield.value)
		thefield.value = ""
	}


// **********************************
// Open window to auctioneers website
// **********************************
function Auction(auctionRRN,t) {
        if (t) return;
        win=window.open("http://propertyauctionaction.co.uk/cgi-bin/openpage.pgm?auctionRRN="+auctionRRN+"&CLURL=http://propertyauctionaction.co.uk/","Auctioneer");
        }


// **********************************
// Reset property search criteria form
// **********************************
function resetPrpSrc_C() {
document.PROPERTY_SEARCH.F_LOCALITYX.value=" ";
document.PROPERTY_SEARCH.F_KEYWRD.value=" ";
document.PROPERTY_SEARCH.F_SRCRAD.selectedIndex=0;
document.PROPERTY_SEARCH.F_NAMADR.value=" ";
document.PROPERTY_SEARCH.F_PROPTYPE.selectedIndex=0;
document.PROPERTY_SEARCH.F_MINBEDS.selectedIndex=0;
document.PROPERTY_SEARCH.F_MINGUIDE.selectedIndex=0;
document.PROPERTY_SEARCH.F_MAXGUIDE.selectedIndex=0;
document.PROPERTY_SEARCH.F_SORTBY.selectedIndex=0;
document.PROPERTY_SEARCH.F_AHSNAME.selectedIndex=0;
return true;
}


// **********************************
// Open window to auctioneers website
// **********************************
function Auction(auctionRRN) {
	if (shwAucFired == 'Y') {
          shwAucFired = ' ';
          return;
        }
        win=window.open("http://propertyauctionaction.co.uk/cgi-bin/openpage.pgm?auctionRRN="+auctionRRN+"&CLURL=http://propertyauctionaction.co.uk/","Auctioneer");
        }

// **********************************************************************
// Show properties on propertyauctionaction.co.uk for selected auctioneer
// **********************************************************************
function shwAuc(e) {
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
	if(!+"\v1")  {
	  var ah = targ.parentNode.parentNode.firstChild.firstChild.innerHTML;
        }
	else 
	if(navigator.userAgent.indexOf("Opera")>=0) {	
	  var ah = targ.parentNode.parentNode.firstChild.firstChild.innerHTML;
	}
	else {
	  var ah = targ.parentNode.parentNode.firstChild.nextSibling.firstChild.innerHTML;
	}
	shwAucFired = 'Y';
	window.location = 'http://propertyauctionaction.co.uk/cgi-bin/paprpsrc_l.pgm?F_SRCRAD=000&F_MINBEDS=0&F_MINGUIDE=000000000&F_MAXGUIDE=999999999&F_SORTBY=GUIDEASC&F_AHSNAME='+ah;
        }


