//wallpaper.js
//@author Evan Chiu - www.evanchiu.com
//@brief - functionality to show the user their screen size and update links with screensize

//prints the current size of the screen so the user doesn't have to think about the options
function printSize(){
	document.write(screen.width + "x" + screen.height);
}

//prints the paramters so the PHP backend knows the screen size
function completeURL(id){
	var width = screen.width;
	var height = screen.height;
	var element = document.getElementById(id);
	var oldURL = element.href;
	
	//correct the iPhone resolution
	if(width == 320 && height == 396
	 	|| width == 396 && height == 320){
			width = 320;
			height = 480; 	
	}
	
	var newURL = oldURL + "&w=" + width + "&h=" + height;
	element.href = newURL;
}