//Portions are Copyright (c) 2000-2005, Mobular Technologies&#174;, Inc.  All Rights Reserved.
//Mobular and Mobular Technologies are Registered Trademarks of Mobular
//Technologies, Inc.
//All rights reserved.  Unauthorized reproduction prohibited.
//http://www.mobular.com/
//

// adjust for missing search nvp
var _loc = new String(""+this.parent.location);
var _query = new String(''+this.parent.location.search);
if ( _query == '?' ) {
	_query = '';
}

// reset location
if ( (_query == '') && (_loc.indexOf("?") != -1) ) {
	_loc = _loc.replace('?','');
	this.parent.location = _loc;
} 
 
var backup_gShowShow = '';
function initializeCover()
{
  document.getElementById("showFrame").style.visibility = "HIDDEN";
  
  if ( ( g_ekitCover != "" ) && ( g_cover == 3 ) ) 
  {
    // Modify g_showShow so that when the user goes back to the kit cover they
    // do not see the single page.

    var new_cover = "";  
    new_cover += "\n<table width=\"814\" height=\"500\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
    new_cover += "\n  <tr valign=\"middle\">";
    new_cover += "\n    <td align=\"center\" valign=\"middle\">";
    new_cover += "\n          <h2>";
    new_cover += g_engineTitle;
    new_cover += "\n          </h2>";
    new_cover += "\n          <br />";
    new_cover += "\n          is loading.  Please be patient.";
    new_cover += "\n          <br />";
    new_cover += "\n          <br />";
    new_cover += "\n          <br />";
    new_cover += "\n          <img src=\"images/loading.gif\" alt=\"\" />";
    new_cover += "\n    </td>";
    new_cover += "\n  </tr>";
    new_cover += "\n  <tr>";
    new_cover += "\n    <td><img src=\"images/c.gif\" alt=\"\" width=\"1\" height=\"10\" border=\"0\" /></td>";
    new_cover += "\n  </tr>";
    new_cover += "\n</table>";
	
   document.getElementById("loadingFrame").style.visibility = "HIDDEN";   
   document.getElementById("loadingFrame").innerHTML = new_cover;	   
   document.getElementById("loadingFrame").style.visibility = "VISIBLE";   
  }

  backup_gShowShow = g_showShow;
  
}

function recreateShowShow() {
	try {
	eengine.kitData.remote = eengine.remote;
	} catch (e) {}

	// reload cover	
	// hide loading screen.. and display cover screen
	document.getElementById("loadingFrame").innerHTML = '';
	document.getElementById("loadingFrame").style.visibility = "HIDDEN";
	
	eengine.runDCT = dctAdjusted;
}

function dctAdjusted(url, divName, ifrH, ifrW, _poph, _popw, _fw) {

   //-- run engine load tracking image
   eengine.writeEngineLoad();

   	// pre process
	eengine.tracing.notify('pre process redirected', 916);

   if ( ( _fw == 1 ) || ( _fw == 2 ) ) {
      var _tb = 'location=1,toolbar=1,statusbar=1,screenX=50,screenY=50,top=50,left=50,resizable=1,scrollbars=1,height='+_poph+',width='+_popw;

      clickThrough = window.open(url,'customerSite', _tb);

      if (! eengine.exe ) {
		try {
			clickThrough.focus();
		} catch (e) {}
	  }
   } else { 
      var ifr = '<a style="text-decoration: none" href="Javascript:void(0)" onClick="'+eengine.dFS+'eengine.closeIFrame(\''+divName+'\')">';
          ifr += '<font color="#000000" face="Verdana,sans-serif" size="-1">'+eengine.erMsg[23]+'</font>';
          ifr += '</a><BR>';
          ifr += '<iframe width="'+eengine.ifr_w+'" height="'+eengine.ifr_h+'" scrolling=auto src="'+url+'"></iframe>';

	      if ( eengine.is_nav4 ) {
	         clickThrough = window.open(url,'customerSite','WIDTH=800,HEIGHT=600,screenX=50,screenY=50,top=50,left=50,scrollbars=no,resize=no,location=yes,toolbar=yes,menubar=yes');
	      } else {
	         var scr = 0;
	         if ( ( ifrH == 0 ) && ( ifrW == 0 ) ) scr = 1;

	         eengine.fillLayer(divName, ifr, scr);
	      }
   }

    eengine.reporting.trackAction(16, 'User Redirected', eengine.cno, "url="+url.replace('?','&'));	  
	  
    // post process
	eengine.tracing.notify('post process redirected', -916);   
}

//-----------------------------------------------------------------------------
// validate checks to see if the form values passed in from the s2f forward are valid.
//-----------------------------------------------------------------------------

function I2U_validate2(fo) {

	// in case the form reference is lost... look again for it.
	if (! fo ) {
		if ( document.data ) {
			fo = document.data;
		} else {
	        if ( eval( this.sFS ) ) {
	           fo = eval(this.sFS+".document.data");
	        }			
		}
	}		
		
    if ( eval( this.sFS ) ) {
		fo = eval(this.sFS+".document.data");
    }
	
	// Cleanse the subject and comments fields of any HTML tags
    if ( fo.subject.value == "" ) {
		return this.shwEr(this.erMsg[11], -1);
	} else {
		fo.subject.value = fo.subject.value.replace( /<[^<|>]+?>/gi, '' );		
	}
	
    if ( fo.Comments.value != "" ) {
		fo.Comments.value = fo.Comments.value.replace( /<[^<|>]+?>/gi, '' );				
	}

	// Let the standard engine code finish the process
	return eengine.validate(fo);
	
}




// Default links -- These must be overridden by submitting the links.js
// file at build time.

//----------------------- Segment 8 - Voting ----------------------------------
voting_link_text 			= "CAST YOUR VOTE";
voting_link 				= "";
voting_ends					= "";

// Note: The voting_ends variable must be defined in the following format:
//		 "yyyy-mm-dd".
//-----------------------------------------------------------------------------

//----------------------- Segment 9 - Shareholding management -----------------
shareholding_link_text		= "View and update your shareholding";
shareholding_link 			= "https://www-au.computershare.com/Investor/LoginHolder.asp?issuerid=scaucpu";
//-----------------------------------------------------------------------------

//----------------------- Segment 11 - Useful links ---------------------------
useful1_link_text			= "Company website";
useful1_link 				= "http://www.computershare.com";

useful2_link_text			= "Share price";
useful2_link 				= "http://www.asx.com.au/asx/markets/PriceResults.jsp?method=get&template=F1001&ASXCodes=cpu";

useful3_link_text 			= "Announcements";
useful3_link 				= "http://www.asx.com.au/asx/statistics/announcementSearch.do?method=searchByCode&issuerCode=cpu&timeFrameSearchType=D&releasedDuringCode=M";

useful4_link_text 			= "ASX website";
useful4_link 				= "http://www.asx.com.au";

useful5_link_text 			= "";
useful5_link 				= "";

useful6_link_text 			= "";
useful6_link 				= "";

useful7_link_text 			= "";
useful7_link 				= "";

useful8_link_text 			= "";
useful8_link				= "";

// Note: For the financials_link variable, enter only the name of the Excel  
//       file being uploaded.  If no financials spreadsheet is being deployed
//       with the AMK, leave the financials_link value blank.
financials_link_text		= "Download financials";
financials_link				= "";  
//-----------------------------------------------------------------------------

//----------------------- Miscellaneous ---------------------------------------
usefulLinksString			= "Useful links";
clickString 				= "Click here";
//----------------------- Miscellaneous ---------------------------------------
