if (self.name != 'iframeContent') {
	self.location = "/index.htm?destination=" + escape(self.location.protocol + "//" + self.location.hostname + self.location.pathname) + "&subpage=" + escape(self.location.hash);
//	self.location = "/index.htm?destination=" + escape(self.location.href);
}

/*if (self.name == 'bbWindow') {
	self.location = "/index.htm?destination=" + escape(self.location.protocol + "//" + self.location.hostname + self.location.pathname) + "&subpage=" + escape(self.location.hash);
//	self.location = "/index.htm?destination=" + escape(self.location.href);
} else if (self.name != 'iframeContent') {
	bbWindowOpen("/index.htm?destination=" + escape(self.location.protocol + "//" + self.location.hostname + self.location.pathname) + "&subpage=" + escape(self.location.hash));
	bbWindow.focus();
	history.go(-1);
}*/

function addToArray(arrayName,element) {
	var currentArray = eval(arrayName)
		currentArray[currentArray.length] = element;
}

var suit = null, card = null;
function parseAnchorName(anchorName) {
	var pos = anchorName.indexOf('.');
	if (pos != -1) {
		suit = anchorName.substring(0,pos);
	} else {
		suit = null;
	}
	return suit;
}

// Let's initialise the arrays that hold the 'cards' and then populate them
var a = new Array();
var b = new Array();
var c = new Array();
var d = new Array();
var z = new Array();
var currentSuit = null;
function initCards() {
	for (var i=0; i < document.anchors.length; i++) {
		parseAnchorName(document.anchors[i].name)
		if (suit) {
			addToArray(suit,document.anchors[i].name)
			if (currentSuit == null) currentSuit = suit;
		}
	}
}

function commonInit() {
//	parent.setButton('A');
//	var shit = self.location.hash;
//	alert(fb);
//	parent.dw(self.name);
//	alert(fb);
//	self.location = '#' + shit;
	initCards();
//	alert('BOO');
	parent.initButtons();
//	parent.setMoreLess('init');
//	alert(A.length + ' - ' + B.length + ' - ' + C.length + ' - ' + D.length)
//	alert(A.toString + '\n' + B.toString + '\n' + C.toString + '\n' + D.toString)
	/*alert(	'a (' + a.length + ') : ' + a + '\n' + 
			'b (' + b.length + ') : ' + b + '\n' + 
			'c (' + c.length + ') : ' + c + '\n' + 
			'd (' + d.length + ') : ' + d + '\n' + 
			'z (' + z.length + ') : ' + z )*/
//	alert(eval(document.anchors));
}
