// Custom Javascript Functions

var version = deconcept.SWFObjectUtil.getPlayerVersion();

if (!document.location.href.indexOf('noflash.html') && document.getElementById && version["major"] < 8) {
	window.location = "noflash.html"
}

// custom stuff
function trace(str){
	//alert(str);
	window.status = "trace//"+str;
}

// Initialise Site
function init(){
	//getPage('home.php','site_content');
}  
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function showMessage(){
	var width = 220;
	var height = 210;
	var top = (screen.height-width)/2;
	var left = (screen.height-height)/2;
	MM_openBrWindow('http://www.swapitshop.com/cgi-bin/swapitshop/creative_swapits.cgi?creative_id=6846&partner_id=1','ShreddiesSwappits','width='+width+', height='+height+', top='+top+', left='+left+', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no');
}

function showTermsOfUse(){
	var width = 800;
	var height = 480;
	var top = (screen.height-width)/2;
	var left = (screen.height-height)/2;
	MM_openBrWindow('terms-of-use.html','ShreddiesSwappits','width='+width+', height='+height+', top='+top+', left='+left+', toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no');
}
// Load homepage
function addEvent(obj, type, fn){
	if(obj.addEventListener){
		obj.addEventListener(type, fn, false);
	}
	else if(obj.attachEvent){
		obj["e" + type + fn] = fn;
		obj[type + fn] = function(){
				obj["e" + type + fn](window.event);
			}
		obj.attachEvent("on" +type, obj[type+fn]);
	}
}
addEvent(window, "load", init);