// JavaScript Document

/*function popupenlarge(prodcode,imgnum)
	{
		//invoke the request
		var postvars2="";
		var postvars="";
		postvars=postvars+("prodcode="+prodcode)
		postvars=postvars+("&")
		postvars=postvars+("imgnum="+imgnum)
		
//			alert("/modules/ajax_notifyform.asp?"+postvars);
		if( ajax_RequestString( popupenlarge_callBack , ("/modules/viewimage_ajax.asp?"+postvars) ,postvars2 , prodcode ) )
		{
			//get hold of the text box and put a friendly message in it while we are waiting
			var addbutton = document.getElementById("enlarge_"+prodcode);
			addbutton.src = "/images/highside/loading.gif";
		}
		return false;
	}
*/
var loadedpage=false;
var storednotificationtext="";
aaManageEvent(window,'load',enlargechecker);
function enlargechecker()
{
	loadedpage=true;
	if (storednotificationtext!="") {
		var tmpnul=notificationWindow(storednotificationtext,0,"","enlargenotify");
		storednotificationtext='';
	}
}


function popupenlarge(prodcode,imgnum)
{
	var notificationtext="";
	notificationtext="<div><iframe width=800px height=500px frameborder='0' scrolling='no' src='/modules/viewimage_ajax2.asp?prodcode="+prodcode+"&imgnum="+imgnum+"'></iframe></div";
	if (loadedpage){
		var tmpnul=notificationWindow(notificationtext,0,"","enlargenotify");
	} else { 
		storednotificationtext=notificationtext;
	} 
	return false;
}

function popupenlarge_callBack( sString , statusCode , requestObject )
	{
		var prodcode=(requestObject.m_userObject);
//		alert("prodcode="+prodcode);
//		alert("statusCode="+statusCode);
		//status OK : print the time 
		if( statusCode == ajax_statusCode_ok )
		{
			var addbutton = document.getElementById("enlarge_"+(prodcode));
			addbutton.src = "/images/icons/enlarge.gif";
//				alert(sString);
			var notificationtext="";
			notificationtext="<div>"+sString+"</div>"
			var tmpnul=notificationWindow(notificationtext,0,"","enlargenotify")

		}
		//error : print an error message, test this by changing the request URL above to garbage
		else
		{
			var addbutton = document.getElementById("enlarge_"+(prodcode));
			addbutton.src = "/images/highside/loader.gif";
		}
	}
