addEvent(window, 'load', attachClickFunction);		

function attachClickFunction() {						
	var anchors = document.getElementById("Wallpapers").getElementsByTagName("A"); 
	for (i=0; i<anchors.length; i++)
		anchors[i].onclick = openNewWindow;		
}

function openNewWindow(obj) {					
	if (!obj)
		obj = window.event.srcElement;	
	else
		obj = this;	  
	 
	// openwindow			
	var newWindow;				
	if (obj.innerHTML == "1024x768")
		newWindow = window.open (obj.href, 'popupwindow', 'width=1024, height=768,noscrollbars,resizable');
	else
		newWindow = window.open (obj.href, 'popupwindow', 'width=800, height=600,noscrollbars,resizable');		
		
	if (window.focus)
		newWindow.focus()
	return false;
}
   
function addEvent(obj, evType, fn){
 if (obj.addEventListener){
   obj.addEventListener(evType, fn, true);
   return true;
 } else if (obj.attachEvent){
   var r = obj.attachEvent("on"+evType, fn);
   return r;
 } else {
   return false;
 }
}
