
function popup(url,popupname,popup_width,popup_height){

	//var in_str = url + " " + popupname + " " + popup_width + " " + popup_height
	// var params = 'width=' + popup_width + ' hight=' + popup_height
	var params = "location=yes,scrollbars=yes,status=yes,width=630,height=400";
	handle = window.open(url,popupname,params);
	//handle = window.open(url,popupname,'width=630,height=400');
}

function reloadparent(src){
	if(self.opener){
		//alert("Trying to load: " + src);
		self.opener.focus();   
		self.opener.location.href = src;
		//self.opener.location.reload();
		self.close();
	}else{
		alert("No opener object found");
	}
}
function mysubmit(src,close){
	if(self.opener){
		//alert("mysubmit called with arg: " + src);
		if(changed){
			document.account.submit();
		}else{
			//alert("You did not change anything... right?");
			close=true;
		}
		if(close){
			self.opener.focus();   
			self.opener.location.href = src;
			//self.opener.location.reload();
			self.close();
		}
	}else{
		alert("No opener object found");
	}
}
function alertDeleteAccount(){
	if(document.account.deleteme.checked){
		alert("Deleting an account will also delete any mail it has on the server!");
	}
}
function ichanged(){
	//alert("Are you changing something?");
	changed=true;
}

function ichangedPassword(){
	//alert("Are you changing something?");
	changed=true;
	document.account.updatep.checked=true;
}



function ichangedabody(){
	changed=true;
	document.account.aenable.checked=true;
}
function ichangedasubject(){
	changed=true;
	document.account.aenable.checked=true;
}

function ichangedNewalias(){
	changed=true;
	var alias=document.forms[0].address.value;
	var newtext = alias;
	var myReference= getRefToObject('fillinname');
	
	if( typeof( myReference.innerHTML ) != 'undefined' ) {
		//used by the IE series, Konqueror, Opera 7+ and Gecko browsers
		myReference.innerHTML = newtext;
	} else {
		if( myReference.document && myReference.document != window.document ) {
			//used by layers browsers
			myReference.document.open();
			myReference.document.write(newtext);
			myReference.document.close();
		} else {
			if( window.frames && window.frames.length && window.frames['nameOfIframe'] ) {
				//used by browsers like Opera 6-
				//if we attempt to rewrite the iframe content before
				//it has loaded we will only produce errors
				myReference = window.frames['nameOfIframe'].window;
				myReference.document.open();
				myReference.document.write(newtext);
				myReference.document.close();
			}
		}
	}
	document.forms[0].form_goto.style.backgroundColor='lightyellow';
	document.forms[0].form_goto.focus();
}
function submitnew(src,close){
	//alert('4 Recieved src: ' + src);
	
	if(self.opener){
		//alert("mysubmit called with arg: " + src);
		if(changed){
			document.forms[0].action = src;
			document.forms[0].submit();   
		}else{
			//alert("You did not change anything... right?");
			close=true;
		}
		if(close){
			self.opener.focus();   
			self.opener.location.href = src;
			//self.opener.location.reload();
			self.close();
		}
	}else{
		alert("No opener object found");
	}
}

function enableAutoDelete(){
	return;
	if(document.account.autodelete.checked){
		if(! document.account.form_goto.value.length){
			alert("Auto-Delete only makes sense if you are forwarding mail to other addresses. If you are not, then just delete the account itself.");
		}
	}
}

function enableStore(){
	return;
	if(document.account.autodelete.checked){
		if(! document.account.form_goto.value.length){
			alert("Auto-Delete only makes sense if you are forwarding mail to other addresses. If you are not, then just delete the account itself.");
		}
	}
}

function checkFormsubmit(){
	alert("Plase use the buttons at the bottom of the page to close this wondow");
}

function getRefToObject(divID) {
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}

function MWJ_findObj( oName, oFrame, oDoc ) {
    /* this function is slightly bigger than the DreamWeaver
    function but is more efficient as it can also find
    anchors, frames, variables, functions, and check through
    any frame structure

    if not working on a layer, document should be set to the
    document of the working frame
    if the working frame is not set, use the window object
    of the current document
    WARNING: - cross frame scripting will cause errors if
    your page is in a frameset from a different domain */
    if( !oDoc ) { if( oFrame ) { oDoc = oFrame.document; } else {
        oDoc = window.document; } }

    //check for images, forms, layers
    if( oDoc[oName] ) { return oDoc[oName]; }

    //check for pDOM layers
    if( oDoc.all && oDoc.all[oName] ) { return oDoc.all[oName]; }

    //check for DOM layers
    if( oDoc.getElementById && oDoc.getElementById(oName) ) {
        return oDoc.getElementById(oName); }

    //check for form elements
    for( var x = 0; x < oDoc.forms.length; x++ ) {
        if( oDoc.forms[x][oName] ) { return oDoc.forms[x][oName]; } }

    //check for anchor elements
    //NOTE: only anchor properties will be available,
    //NOT link properties!
    for( var x = 0; x < oDoc.anchors.length; x++ ) {
        if( oDoc.anchors[x].name == oName ) {
            return oDoc.anchors[x]; } }

    //check for any of the above within a layer in layers browsers
    for( var x = 0; document.layers && x < oDoc.layers.length; x++ ) {
        var theOb = MWJ_findObj( oName, null, oDoc.layers[x].document );
            if( theOb ) { return theOb; } }

    //check for frames, variables or functions
    if( !oFrame && window[oName] ) { return window[oName]; }
    if( oFrame && oFrame[oName] ) { return oFrame[oName]; }

    //if checking through frames, check for any of the above within
    //each child frame
    for( var x = 0; oFrame && oFrame.frames &&
      x < oFrame.frames.length; x++ ) {
        var theOb = MWJ_findObj( oName, oFrame.frames[x],
          oFrame.frames[x].document ); if( theOb ) { return theOb; } }

    return null;
}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}