
//absolute doc paths - but could we use env variables?
dabsRoot   = "http://dabs.nerc-bas.ac.uk/dabs";
 
//this needs sorting out also defined in initDABS()!!
Version = "CV01.00";

// Intro window
win6height1 = 550;
win6width1  = 550;

function introPage(){
   //first time user
   //cgi must add users ip

   //introWin = window.open("./cgi-bin/DABS_create_intro_page.cgi","Intro","height="+win6height1+",width="+win6width1+",resizable");
	
   introWin = window.open("./DABS_intro_page.html","Intro","height="+win6height1+",width="+win6width1+",resizable");
	
   introWin.focus();
}

function acceptRules () {

	//add ip to rules.log
	introWin.location.href=dabsRoot+'/cgi-bin/DABS_logIP.cgi'
	introWin.close();
	//hack
	//write a cookie - so DABS_loads
    	var expDate = new Date ();
    	expDate.setTime( expDate.getTime() + ( 10*60*1000 ) );
	SetCookie( "DABS_RULES", Version, expDate, "/dabs" );
	location.href=dabsRoot;
	
}

function declineRules () {
	introWin.close();
	parent.history.back();
}


function rulesAccepted() {
    if ( GetCookie( "DABS_RULES" ) ){
      return true; 
    }
    else{
      return false;
    }
}
