/**
 * Initialization of all shadowbox items
 * @author     Nathanael Utama
 */
	 
//Objects - params: [ element id, shadowbox html tag (for supported browsers), html tag for ie 6 ]  
 function itm(id,ie,other){
 this.id = id;
 this.ie = ie;
 this.other = other;
 }
 
  
 window.onload = function(){
		if (!document.getElementById || !document.createTextNode) {return;} // Check for DOM support
			
		sdwbox_items = new Array(new itm('pwd_link', '<a style="clear: both; font-size: 8pt;" href="#" title="Forgotten Password" onclick="return openPopup(\'atview.cgi?ACTION=EMAILPWD\', 500, 200, true);">forgotten password?</a>' , '<a style="clear: both; font-size: 8pt;" href="atview.cgi?ACTION=EMAILPWD" rel="shadowbox;width=500;height=200">forgotten password?</a>'), new itm('details_link', '<a class="sign_link" href="atprofile.cgi" title="Change Details" onclick="return openPopup(\'atprofile.cgi\', 650, 460, true);">change details</a>' , '<a class="sign_link" href="atprofile.cgi" title="Change Details" rel="shadowbox;width=650;height=460">change details</a>') );
		
		for(var i=0;i<sdwbox_items.length;i++){
			
			 var oTarget;
			 if (document.getElementById(sdwbox_items[i].id)) { // Check that the target element actually exists
				 if(window.navigator.appVersion.indexOf("IE 6.0")!= -1){
					 oTarget = document.getElementById(sdwbox_items[i].id);
					 oTarget.innerHTML = sdwbox_items[i].ie;
				 } 
				 else{
					 oTarget = document.getElementById(sdwbox_items[i].id);
					 oTarget.innerHTML = sdwbox_items[i].other;
				 }
			 } 

		}
		Shadowbox.init(); 
 };
