
	var intOffsetTop = 240;
	var strAgent = navigator.userAgent.toLowerCase(); 
  var ord=Math.random()*10000000000000000; 	// nodig voor dart, geframede pagina's zonder kop 
	cLanguage = getCookie( 'language' );
	
	
//   var xx = '';      
	function doSkyscraperBanner() {

    return;		
		var blnIe = document.all && !window.opera;

		objIebody = (document.compatMode=="CSS1Compat") ? document.documentElement : document.body;
                
                objBanner = document.getElementById( 'rechtsbuiten' );
                
                if (objBanner == null ) return;
                
		var scroll_top = (blnIe) ? objIebody.scrollTop : window.pageYOffset;
					
		docheight = (blnIe) ? objIebody.clientHeight : window.innerHeight;
		
		objheight = objBanner.offsetHeight;

                paginagrootte = document.getElementById('main').offsetHeight;

                // document.body.scrollHeight.toString() werkt niet meer, dus vandaar paginagrootte 
//        xx = scroll_top.toString() + '/' + paginagrootte.toString() + '/' + intOffsetTop.toString();
//	alert( xx );
		if (scroll_top > intOffsetTop) 
		{
			if (scroll_top < (paginagrootte - 600 ) )

                       {
				objBanner.style.top = scroll_top - intOffsetTop + 'px';
				// alert( objBanner.style.top );
			}

		}
		else 
		{
			objBanner.style.top = 0;
		}
		
		
		setTimeout('doSkyscraperBanner()', 500);
	}

        
//	if (!(strAgent.indexOf("msie") > 0 && strAgent.indexOf("mac") > 0))
	//{  setTimeout('doSkyscraperBanner()', 1500);}

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );



}


// this function gets the cookie, if it exists
function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}



// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
			




// threadsafe asynchronous XMLHTTPRequest code


function ajaxSend(url, callback){
// we use a javascript feature here called "inner functions"
// using these means the local variables retain their values after the outer function
// has returned. this is useful for thread safety, so
// reassigning the onreadystatechange function doesn't stomp over earlier requests.


   
function ajaxBindCallback() {
if (ajaxRequest.readyState == 4) {
if (ajaxCallback) {
ajaxCallback(ajaxRequest.responseText);
} 
else {
alert('no callback defined');
}
} 
}


// use a local variable to hold our request and callback until the inner function is called...
var ajaxRequest = null;
var ajaxCallback = callback;



// bind our callback then hit the server...
if (window.XMLHttpRequest) {
// moz et al
ajaxRequest = new XMLHttpRequest();
ajaxRequest.onreadystatechange = ajaxBindCallback;
ajaxRequest.open("GET", url, true);
ajaxRequest.send(null);
} 
else 
if (window.ActiveXObject) {
// ie
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
if (ajaxRequest) {
ajaxRequest.onreadystatechange = ajaxBindCallback;
ajaxRequest.open("GET", url, true);
ajaxRequest.send();
}
}

}



function viewhide( id ) {
 
 el = document.getElementById(id);
 var nextSibStatus = (el.style.display == 'none') ? 'block' : 'none';
 el.style.display = nextSibStatus;

}





function ShowMenu(div_id) {
    

    el = document.getElementById(div_id);
    

    pijltje_id = 'pijltje_' + div_id;   


    
    if (el.style.display == 'block')
    {
      el.style.display = 'none';
      document.getElementById(pijltje_id).src='http://static.djguide.nl/image/formulier/pijltje_rechts.gif';
      document.getElementById(pijltje_id).alt='>';
      
      
      
      Set_Cookie( div_id, 'none', 60 , '/', '', '' ) 
      
      
    }
    else
    {  el.style.display = 'block';
       document.getElementById(pijltje_id).src='http://static.djguide.nl/image/formulier/pijltje_beneden.gif';
       document.getElementById(pijltje_id).alt='v';


       Set_Cookie( div_id, 'block', 60 , '/', '', '' ) 
    }

    
    return false; // return false is nodig ivm aanroep via href
}



function OpenMenu( div_id )
{

     
    el = document.getElementById(div_id);
    pijltje_id = 'pijltje_' + div_id;   

    if (Get_Cookie( div_id )  == 'none' )
    {
      el.style.display = 'none';
      document.getElementById(pijltje_id).src='http://static.djguide.nl/image/formulier/pijltje_rechts.gif';
      document.getElementById(pijltje_id).alt='>';
       
    }
    else
    {
      el.style.display = 'block';
      document.getElementById(pijltje_id).src='http://static.djguide.nl/image/formulier/pijltje_beneden.gif';
      document.getElementById(pijltje_id).alt='v';
    
    }
    return false; // return false is nodig ivm aanroep via href

}





function handleAltskyscraper(response) 
{
 el = document.getElementById( 'rechtsbuiten' );
 el.innerHTML = response;
}

function handleAltcentraalbovenin(response) 
{
 
 if ( response.length > 156 )
 {el = document.getElementById( 'centraalbovenin' );
  el.innerHTML = response;
 } 
}





function handleEigenMenu(response) 
{

 el = document.getElementById( 'contentEigenMenu' );

 if (el.style.display == 'block')
 { el.style.display = 'none';
 
   el = document.getElementById( 'bannerprofielinfo');
   if (el != undefined)
   {
   	el.style.display = 'block';
   }

   el = document.getElementById( 'rechtsbuiten');
   if (el != undefined)
   {
   	el.style.display = 'block';
   }

   return;
 }  
 
 el.innerHTML = response;
 el.style.display = 'block';
 
 // om flash hidden te maken, kan ik helaas niet overeenkomen omdat ik de transparant param niet kan zetten van extern geladen flash en z-index niet werkt
 el = document.getElementById( 'bannerprofielinfo');
 if (el != undefined)
 {
   el.style.display = 'none';
 }

 el = document.getElementById( 'rechtsbuiten');
 if (el != undefined)
 {
   el.style.display = 'none';
 }

}

function sluitEigenMenu() 
{
 el = document.getElementById( 'contentEigenMenu' );
 el.style.display = 'none';
   
 el = document.getElementById( 'bannerprofielinfo');
 if (el != undefined)
 {
   el.style.display = 'block';
 }
 el = document.getElementById( 'rechtsbuiten');
 if (el != undefined)
 {
   el.style.display = 'block';
 }
   
}





function updateSearchAction()
	{
   
      
   current = document.SubmitSearch.SearchIn.selectedIndex;
   
   el = document.getElementById( 'ExtraSearchOptions' );

   if (el != undefined) {el.style.display = 'none';}


   if ( document.SubmitSearch.SearchIn[current].value == 'P' )
   {
     document.SubmitSearch.action=cDomain+'/maand.p';
     document.SubmitSearch.method='post';
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'F' )
   {
     document.SubmitSearch.action=cDomain+'/fotoboekhist.p?view=lijst';
     document.SubmitSearch.method='post';
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'A' )
   {
     document.SubmitSearch.action=cDomain+'/djlist.p?scope=search';
     document.SubmitSearch.method='post';
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'N' )
   {
     document.SubmitSearch.action=cDomain+'/nieuwshist.p';
     document.SubmitSearch.method='post';
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'L' )
   {
     document.SubmitSearch.action=cDomain+'/locatie.p';
     document.SubmitSearch.method='post';
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'O' )
   {
     document.SubmitSearch.action=cDomain+'/organiserlist.p';
     document.SubmitSearch.method='post';
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'D' )
   {
     document.SubmitSearch.action='http://www.djguide.nl/googleresults.p';
     document.SubmitSearch.method='get';
     document.getElementById('ss1').value='www.djguide.nl';
     
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'G' )
   {
     document.SubmitSearch.action='http://www.djguide.nl/googleresults.p';
     document.SubmitSearch.method='get';
     document.getElementById('ss1').value='';
   }
   else
   if ( document.SubmitSearch.SearchIn[current].value == 'M' )
   {
     document.SubmitSearch.action=cDomain+'/profielenoverzicht.p?scope=zoek';
     document.SubmitSearch.method='post';
     if (el != undefined) {el.style.display = 'inline';}
   }
   
}

function Meld_Misbruik( cSource , cMemberName, cRowid ) 
{

  var agree=confirm( 'Vind je het bericht van ' + cMemberName + ' echt niet kunnen en wil je het bericht naar DJGuide versturen ter beoordeling?' )
      
  if (agree)
  {
    
    ajaxSend( '/ajaxmeldmisbruik.p?source=' + cSource + '&rowid=' + cRowid , handleMisbruik );
    el = document.getElementById( cRowid );
    el.style.display = 'none';

  }  
}

function handleMisbruik(response) 
{
 
 alert( response );
 
}


function trimAll(sString) 
{
  while (sString.substring(0,1) == ' ')
  {
  sString = sString.substring(1, sString.length);
  }
  while (sString.substring(sString.length-1, sString.length) == ' ')
  {
  sString = sString.substring(0,sString.length-1);
  }
  return sString;
}


// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  // alert( dc );
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


function ScrollToElement(theElement){
  var selectedPosX = 0;
  var selectedPosY = 0;
  while(theElement != null){
    selectedPosX += theElement.offsetLeft;
    selectedPosY += theElement.offsetTop;
    theElement = theElement.offsetParent;
  }
 window.scrollTo(selectedPosX,selectedPosY);
}

function setCaretTo(obj, pos) {   
	  
	  
    if(obj.createTextRange) {   
        /* Create a TextRange, set the internal pointer to  
           a specified position and show the cursor at this  
           position  
        */  
        var range = obj.createTextRange();   
        range.move("character", pos);   
        range.select();   
        
        
    } else if(obj.selectionStart) {   
        /* Gecko is a little bit shorter on that. Simply  
           focus the element and set the selection to a  
           specified position  
        */  
        obj.focus();   
        obj.setSelectionRange(pos, pos);   
        
    }   
    
}  



function attentafriend()
{
  // alert( $('formattentafriend').serialize()  );
  
  new Ajax.Request('/ajaxprofielguestbookadd.p', {
  parameters: $('formattentafriend').serialize(true) ,
  
  onSuccess: function(transport){
      
      
      
      var response = transport.responseText || "no response text";
      
      
      
      alert(response);
      return false;
    },
 	 onFailure: function()
 	 { alert('Something went wrong...') ;
 	   return false;	
 	 	}
 	 
  });
  

} 	 



function newsite(sender)
{ 
  Set_Cookie( 'version', 'v2', 1 , '/', '', '' );
  
  //	Delete_Cookie( 'version', '/', '.djguide.nl' ); werkt niet op ipad
  
  // Set_Cookie( 'version', 'v2', 60 , '/', '', '' );
	window.location.reload(true);
	// window.location.href=window.location.href + '?' + ord;
}

