SURL = "H" + "ttp://www.nexeninc.com"

function overImage(imgName) {
	document.images[imgName].src = SURL + "http://www.nexeninc.com/images/rollover/" + imgName + "_on.gif";
}

function offImage(imgName) {
	document.images[imgName].src = SURL + "http://www.nexeninc.com/images/rollover/" + imgName + ".gif";
}

function calEventLink (eventURL) {
	newURL = eventURL.slice(0,(eventURL.indexOf("(",0)-1));
        openWindow('calEvent',newURL);
}

function calEventLink2 (eventURL) {
	newURL = eventURL.slice((eventURL.indexOf("=",0)+1),(eventURL.indexOf(">",0)));
        openWindow('calEvent',newURL);
}

function openWindow(windowName,newURL) {
	switch(windowName) {
    	case 'chartincome':
	    window.open(SURL + "/fusioncharts/html/annual_income_comp.html","ISAnnual","width=600,height=400,status=yes,scrollbars=yes,resizable=yes");
	    break;
	  case 'student':
	    window.open(SURL + "/Careers/campus_Recruiting/2010_applicationA.asp","student","width=700,height=700,status=yes,scrollbars=yes,resizable=yes");
	    break;
//	  case 'feedback':
//	    window.open(SURL + "/feedback.asp","feedback","width=450,height=540,status=yes");
//	    break;
	  case 'feedback':
	    window.open(SURL + "/Contact_Us.asp","contactus","width=450,height=540,status=yes");
	    break;
                  case 'technical':
	    window.open(SURL + "/help.asp","technical","width=600,height=600,status=yes,scrollbars=yes,resizable=yes");
	    break;
                  case 'fraud':
	    window.open(SURL + "/careers/current_opportunities/fraud.asp","fraud","width=300,height=400,status=yes,scrollbars=yes,resizable=yes");
	    break;
                  case 'onlineAR':
	    window.open("http://reports.nexeninc.com/ar/2008/servicepages/welcome.html","AR","width=1015,height=800,status=yes,scrollbars=yes,resizable=no");
	    break;
                   case 'onlineCSR':
	    window.open("http://reports.nexeninc.com/csr/2008/servicepages/welcome.html","CSR","width=1015,height=800,status=yes,scrollbars=yes,resizable=no");
	    break;

                  case 'norway_application':
	    window.open(SURL + "/careers/Norway/norway_apply.asp","technical","width=640,height=600,status=yes,scrollbars=yes,resizable=yes");
	    break;
                  case 'corporate_video_2008':
	    window.open(SURL + "/files/streaming/corporate_video_2008.html","corporate_video_2008","width=860,height=680,status=yes,scrollbars=yes,resizable=yes");
	    break;

                  case 'wpcyouth_video_2008':
	    window.open(SURL + "/files/streaming/wpcyouth_video_2008.html","wpcyouth_video_2008","width=860,height=680,status=yes,scrollbars=yes,resizable=yes");
	    break;

                  case 'videowindow':
                 window.open(SURL + "/files/streaming/CAPP_award.html", "CAPP","width=340,height=306,status=yes,scrollbars=no,resizable=no");
                 break;


                  case 'governance':
	    window.open(SURL + "/Governance/dec5governance.asp","contactus","width=400,height=400,status=yes");
	    break;

	  case 'calEvent':
	    window.open(newURL,windowName,"width=570,height=500,status=yes,scrollbars=yes,resizable=yes");
	    break;
	  case 'legal':
	    window.open(SURL + "/legal.asp",windowName,"width=555,height=500,status=yes,scrollbars=yes,resizable=yes");
	    break;
	  case 'contact':
	    window.open(SURL + "/Contact_Us.asp","contact","width=555,height=500,status=yes,scrollbars=yes,resizable=yes");
	    break;
	  case 'privacy':
	    window.open(SURL + "/privacy.asp","privacy","width=555,height=500,status=yes,scrollbars=yes,resizable=yes");
	    break;
          default:
            break;
 }
}

function closeWindow(windowName) {
	window.close(windowName);
}

function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'
	win = window.open(mypage,myname,settings)
}

function Notes(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes'
	win = window.open(mypage,myname,settings)
}

function insertM2Link(nam, dom, text) {
	// Goal of this function is to prevent spam robots from harvesting e-m-a-i-l addresses.
	// M2 is short for "m-a-i-l t-o" (without hyphens).
	// To use, user needs to insert a short call to this function in web page body.
	// Avoid or scramble references to "at" signs, "dot-com" domain suffixes,
	// the text "m-a-i-l t-o" in HREF attributes, and break up the user name and the
	// domain name so they are not near each other in the document.
	// This assumes that spam harvesters are not javascript aware.
	// If they are then move to a server-side form-submit model.
	
	// Build default domain name in case no parameter is sent.
	default_dom = "nexe" + "ninc" + String.fromCharCode(46) + "c" + "om"
	// Build full address including at sign from name portion and specified or default domain
	full = nam + String.fromCharCode(64) + (dom == "" ? default_dom : dom);
	document.write("<a hr" + "ef=\"mai" + "lto:" + full + "\">" + (text == "" ? full : text) + "</a>");
}
function tableBanding_ToggleUtil(pCurClass) {
	if (pCurClass == "even") {
		return "odd";
	}
	return "even";
}
function tableBanding_Generic(pId, pHasHeader) {
	if (document.getElementsByTagName) {
		var table = document.getElementById(pId);
		var rows = table.getElementsByTagName("tr");
		var curClass = "even";
		for (i=0; i < rows.length; i++) {
			if (pHasHeader && i == 0) {
				continue;
			}
			rows[i].className = curClass;
			curClass = tableBanding_ToggleUtil(curClass);
		}
	}
}
function tableBanding() {
	tableBanding_Generic("tableband", true);
}
function tableBanding_Single(pId) {
	tableBanding_Generic(pId, true);
}
function tableBanding_NoHeader() {
	tableBanding_Generic("tableband", false);
}
function tableBandings_ToggleUtil(pCurClass) {
	if (pCurClass == "even") {
		return "odd";
	}
	return "even";
}
function tableBandings_Generic(pId, pHasHeader) {
	if (document.getElementsByTagName) {
		var table = document.getElementById(pId);
		var rows = table.getElementsByTagName("tr");
		var curClass = "even";
		for (i=0; i < rows.length; i++) {
			if (pHasHeader && i == 0) {
				continue;
			}
			rows[i].className = curClass;
			curClass = tableBandings_ToggleUtil(curClass);
		}
	}
}
function tableBandings() {
	tableBandings_Generic("tablebands", true);
}
function tableBandings_Single(pId) {
	tableBandings_Generic(pId, true);
}
function tableBandings_NoHeader() {
	tableBandings_Generic("tablebands", false);
}

function removeTimeFromDate(pDateStr) {
    var monthNames = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

    var wxDateStr = pDateStr.slice(0, pDateStr.indexOf("at"));
    var eleDynamicDate = document.getElementById("DynamicComponentLastUpdated");
    //alert("wxDateStr: " + wxDateStr);
    var result;
    if (eleDynamicDate != null) {
        var dynamicDateStr = eleDynamicDate.innerHTML;
        //alert("dynamicDateStr : " + dynamicDateStr );
        try {
            wxDate = new Date(wxDateStr);
            dynamicDate = new Date(dynamicDateStr);
            //alert("wxDate: " + wxDate);
            //alert("dynamicDate: " + dynamicDate);
            if (dynamicDate > wxDate) {
                result = monthNames[dynamicDate.getMonth()] + " " +
                    dynamicDate.getDate() + ", " + dynamicDate.getFullYear();
            }
            else {
                result = wxDateStr;
            }
        }
        catch (e) {
            //alert("Exception: " + e);
            result = wxDateStr;
        }
    }
    else {
        result = wxDateStr;
    }
    //alert("result: " + result);
    document.write(result);
}





/*
	Header Information------------------------------------[Do Not Remove This Header]--
	Title: OO Dom Image Rollover
	Description: This script makes it easy to add rollover/ mousedown 
  	effects to any image on the page, including image submit buttons. Automatically 
  	preloads images as well. Script works in all DOM capable browsers- IE5+, NS6+, 
  	Opera7+.
	
	Legal: Copyright 2005 Adam Smith
	Author Email Address: ibulwark@hotmail.com
	Date Created: June 6, 2005
	Website: Codevendor.com | eBadgeman.com
	Script featured on Dynamic Drive: http://www.dynamicdrive.com
	-----------------------------------------------------------------------------------
*/

function imageholderclass(){
	this.over=new Array();
	this.down=new Array();
	this.src=new Array();
	this.store=store;
	
	function store(src, down, over){
		var AL=this.src.length;
		this.src[AL]=new Image(); this.src[AL].src=src;
		this.over[AL]=new Image(); this.over[AL].src=over;
		this.down[AL]=new Image(); this.down[AL].src=down;
	}
}

var ih = new imageholderclass();
var mouseisdown=0;

function preloader(t){
	for(i=0;i<t.length;i++){
		if(t[i].getAttribute('srcover')||t[i].getAttribute('srcdown')){
			
			storeimages(t[i]);
			var checker='';
			checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';
			checker=(t[i].getAttribute('srcdown'))?checker+'B':checker+'';
			
			switch(checker){
			case 'A' : mouseover(t[i]);mouseout(t[i]); break;
			case 'B' : mousedown(t[i]); mouseup2(t[i]); break;
			case 'AB' : mouseover(t[i]);mouseout(t[i]); mousedown(t[i]); mouseup(t[i]); break;
			default : return;			
			}
			
			if(t[i].src){t[i].setAttribute("oldsrc",t[i].src);}
		}
	}
}
function mouseup(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup();}

	}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");}}
	t.onmouseup=newmouseup;
}

function mouseup2(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup();}
		}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");}}
	t.onmouseup = newmouseup;
}

function mousedown(t){
	var newmousedown;
	if(t.onmousedown){
		t.oldmousedown=t.onmousedown;
		newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown();}}
	}
	else{newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");}}}
	t.onmousedown=newmousedown;
}

function mouseover(t){
	var newmouseover;
	if(t.onmouseover){
		t.oldmouseover=t.onmouseover;
		newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover();}
	}
	else{newmouseover=function(){this.src=this.getAttribute("srcover");}}
	t.onmouseover=newmouseover;
}

function mouseout(t){
	var newmouseout;
	if(t.onmouseout){
		t.oldmouseout=t.onmouseout;
		newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout();}
	}
	else{newmouseout=function(){this.src=this.getAttribute("oldsrc");}}
	t.onmouseout=newmouseout;
}

function storeimages(t){
	var s=(t.getAttribute('src'))?t.getAttribute('src'):'';
	var d=(t.getAttribute('srcdown'))?t.getAttribute('srcdown'):'';
	var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';
	ih.store(s,d,o);
}

function preloadimgsrc(){
	if(!document.getElementById) return;
	var it=document.getElementsByTagName('IMG');
	var it2=document.getElementsByTagName('INPUT');
	preloader(it);
	preloader(it2);
}

if(window.addEventListener){window.addEventListener("load", preloadimgsrc, false);} 
else{
	if(window.attachEvent){window.attachEvent("onload", preloadimgsrc);}
	else{if(document.getElementById){window.onload=preloadimgsrc;}}
}








/***********************************************
* Switch Content script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated April 2nd, 2005.
* Visit http://www.dynamicdrive.com/ for full source code
*ADDED BY MITCH ON MAY 24 2006
***********************************************/

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)

var contractsymbol='<img src="http://www.nexeninc.com/images/icons/contract_icon.gif">' //HTML for contract symbol. For image, use: <img src="whatever.gif">
var expandsymbol='<img src="http://www.nexeninc.com/images/icons/expand_icon.gif">' //HTML for expand symbol.


if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
var rootlength=rootobj.length
for (i=0; i<rootlength; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}

function sweeptoggle(ec){
var thestate=(ec=="expand")? "block" : "none"
var inc=0
while (ccollect[inc]){
ccollect[inc].style.display=thestate
inc++
}
revivestatus()
}


function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(curobj, cid){
var spantags=curobj.getElementsByTagName("SPAN")
var showstateobj=getElementbyClass(spantags, "showstate")
if (ccollect.length>0){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
if (showstateobj.length>0){ //if "showstate" span exists in header
if (collapseprevious=="no")
showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
else
revivestatus()
}
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function revivestatus(){
var inc=0
while (statecollect[inc]){
if (ccollect[inc].style.display=="block")
statecollect[inc].innerHTML=contractsymbol
else
statecollect[inc].innerHTML=expandsymbol
inc++
}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
var alltags=document.all? document.all : document.getElementsByTagName("*")
ccollect=getElementbyClass(alltags, "switchcontent")
statecollect=getElementbyClass(alltags, "showstate")
if (enablepersist=="on" && ccollect.length>0){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
if (ccollect.length>0 && statecollect.length>0)
revivestatus()
}

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate


/***********************************************
* END OF SWITCH CODE ADDED BY MITCH ON MAY 24 2006
***********************************************/