// Code by Christopher at PowerPoint3 dot com
// Like it? Use it. :-)

function getbg(){
	var size=readCookie('Res');
	if(size == null){
		createCookie('Res',screen.width,5);
		if (screen.width <= 1024) {
			document.getElementById('HeadGrp').style.marginTop="30px";
			document.body.style.backgroundImage = 'url("/images/bg1-1024.jpg")';
		}else{
			document.getElementById('HeadGrp').style.marginTop="100px"; // default
			document.body.style.backgroundImage = 'url("/images/bg1-1500.jpg")';
		}
	}
}

function changeImage(img,bgcolor) {
    newImage = "url("+img+")";
    document.getElementById('Good').style.backgroundImage = newImage;
	document.getElementById('bodddy').style.backgroundColor = bgcolor;
}


function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}