function show(id){
  	   if(document.getElementById(id).style.display=='none'){
          document.getElementById(id).style.display='inline';
       }
	   else{
	    document.getElementById(id).style.display='none';
	   }
  }
   function submit(id){
      document.getElementById("pra").value='done';
  }

function go_to_yellowshark(lnk ) {
   var ht_wt = check_sys_height_pix_Size();
   var w= Math.ceil( 0.8 * ht_wt[0]);
   var h= Math.ceil( 0.9 * ht_wt[1]);
   window.open(lnk,'_blank','toolbar=yes, location=yes, scrollbars=yes ,width='+w+', height='+h+',left=100,top=200' );
   return false;
}

function gj_has_ssl(value) {
    if (gj_ssl_checked) return;
    gj_ssl_checked = true;
    document.cookie = 'gj_ssl=' + escape(value) + '; path=/';
}

function gj_check_ssl() {
    if (document.cookie != 'undefined' && document.cookie.length > 0 && document.cookie.indexOf('gj_ssl=') != -1) {
      return;
    }
    var url = 'https://' + window.location.hostname + '/images/n.gif';
    var tag = '<img width="1" height="1" alt="" src="' + url + '" onLoad="gj_has_ssl(1)" style="visibility:hidden;position:absolute">';
    document.write(tag);
    setTimeout('gj_has_ssl(0)', 4000);
}

var gj_ssl_checked = false;

$(document).ready(function(){
    setLink('#navlinkGlobal', '.navdescGlobal');
    setLink('#navlinkInstance', '.navdescInstance');
});

function setLink(link_sel, target_sel) {
    if ($(link_sel).attr('href')) {
        $(link_sel).hover(function() { $(link_sel+','+target_sel).css("text-decoration", "underline") }, function() { $(link_sel+','+target_sel).css("text-decoration", "none") });
        $(target_sel).hover(function() { $(link_sel+','+target_sel).css("text-decoration", "underline") }, function() { $(link_sel+','+target_sel).css("text-decoration", "none") });
        $(target_sel).click(function() { window.location.href = $(link_sel).attr('href'); });
    }
}

var _pm = (function() {
	var B=0,P={},s={},_id=0;
	function inT(x,i){B=x;_id=i;bind();} function saT(x){P[x]=g();} function spT(x){var F=P[x]||B,D=g();s[x]=D-F;} function g(){return(new Date()).getTime();}
	function m(){
            var prbench = false;
	    if( s.ready > 2000) prbench = true;
	    if(prbench) {
		var i=0,m=15000,stt=g(),run=true;
		saT('bench'); var str = ''; for(;i<m&&run;i++){str=i+'tho'; run=(g()-stt<400); } spT('bench');
		if(!run) { s.bench = ( (g()-stt) / i ) *m; }
	    }
	    var d={id:_id,url:window.location.toString(),times:s,html:document.documentElement.innerHTML.length,dom:$('*').length,img:$('img').length,ngifs:$('img[src$=n.gif]').length,chrome_frame:(/x-clock|chromeframe/).test(navigator.userAgent)};
	    $.post('/static/pm.html',d);
	}
	function bind(){$(document).ready(function(){spT('ready'); }); $(window).load(function(){spT('load'); m(); });}
	return {init:inT,start:saT,stop:spT};
    })();


//old functions from utils.js

var formSent = false;

/* Key events starts */
if(document.all) {
  document.onkeydown = onKeyPress;
} else if (document.layers || document.getElementById) {
  document.onkeypress = onKeyPress;
}

function onKeyPress(evt) {
  //do server side 'key pressed'
  var x = readCookie('gj_kp');
  if(!x) {
   createCookie('gj_kp', true);
  }
}
/* Key events ends */

/* Mouse events starts */
function clickIE() {
  //do server side 'mouse moved'
  var x = readCookie('gj_mm');
  if(!x) {
    createCookie('gj_mm', true);
  }
}

function clickNS(e) {
  //do server side 'mouse moved'
  var x = readCookie('gj_mm');
  if(!x) {
    createCookie('gj_mm', true);
  }
}

if(document.layers) {
  document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove=clickNS;
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown=clickNS;
} else {
  document.onmousemove=clickNS;
  document.onmouseup=clickNS;
  document.oncontextmenu=clickIE;
}
/* Mouse events ends */

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  } else {
    var expires = "";
  }
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}


function disableButtons() {
  for(var j=0;j<document.forms.length;++j) {
    for(var i=0;i<document.forms[j].length;++i) {
      if (document.forms[j].elements[i]) {
        if (document.forms[j].elements[i].type == 'submit' || document.forms[j].elements[i].type == 'button') {
          document.forms[j].elements[i].disabled=true;
        }
      }
    }
  }

  if (!formSent) {
    formSent = true;
    return true;
  }
if (global_lang=="en")
{
alert('Form is already under process');
}else{
alert('Formular wird bereits verarbeitet');
}

  return false;
}


function setButtonEmulator(name,value) {
  button = document.getElementById("button_emulation");
  button.name = name;
  button.value = value;
}

function enableButtons() {
  for(var j=0;j<document.forms.length;++j) {
    for(var i=0;i<document.forms[j].length;++i) {
      if (document.forms[j].elements[i]) {
        if (document.forms[j].elements[i].type == 'submit' || document.forms[j].elements[i].type == 'button') {
          document.forms[j].elements[i].disabled=false;
        }
      }
    }
  }
  return false;
}

function disableStaticButtons() {
  for(var j=0;j<document.forms.length;++j) {
    for(var i=0;i<document.forms[j].length;++i) {
      if (document.forms[j].elements[i]) {
        if (document.forms[j].elements[i].type == 'submit' || document.forms[j].elements[i].type == 'button') {
          document.forms[j].elements[i].disabled=true;
        }
      }
    }
  }
  return true;
}
function setopac(){
$("#dim").fadeTo("slow",0.3);
}

function hideElement(element) {
el=document.getElementById(element);
  if (el.style) {
    clearTimeout(f);
    el.style.display = 'none';
  }
}
function showElement (element) {
  el=document.getElementById(element);
  f=window.setTimeout( function () { if (el) { el.style.display = 'block';} }, 500);
  f;
}
function hideall(){
  clearTimeout(f);
}

function reset_all(link_checker, innermessage){
document.getElementById('loader').style.display='block';
document.getElementById('loader').style.top=eval(document.body.scrollTop+160);
setopac();
var search_link="location.href='"+link_checker+"'";
document.getElementById('message').innerHTML=innermessage;
showgrey();
window.setTimeout(search_link, 1500);
}
var myWidth = 0;
var myHeight = 0;
function showSize() {
  if( typeof( window.innerWidth ) == 'number' ) {
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
}
var win = null;
function NewWindow(mypage,myname){
settings =
    'height='+newheight+',width='+newwidth+',left='+0+', scrollbars='+scroll+',resizable';
win = window.open(mypage,myname,settings);
}
function highlight(x){
var x=x+1;
document.forms[x].elements[0].select();
}

function showhideDiv(whichdiv){
var mydiv=document.getElementById(whichdiv);
	if(mydiv && mydiv.style.display=='none'){
     mydiv.style.display='block';
	}else{
	  mydiv.style.display='none';
	}
}
var timeout	= 50;
var closetimer	= 0;
var ddmenuitem	= 0;
// open hidden layer
function mopen(id)
{
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose;




function displayhidden(div, changearrow){

if (document.getElementById(div) && document.getElementById(div).style.display=="none"){
   document.getElementById(div).style.display="block";
   document.getElementById(changearrow).style.background="url(/images/arrow-icons-grey-down.gif) no-repeat 0 2px";
}
else if(document.getElementById(div) && document.getElementById(div).style.display=="block"){
   document.getElementById(div).style.display="none";
   document.getElementById(changearrow).style.background="url(/images/arrow-icons-grey.gif) no-repeat 0 2px";
}
}

 function clear_default(defaultext, id) {//SRA__PKU and alter if necessary... say that Was? in searchword is not entertained
    if (document.getElementById(id).value == defaultext){
      document.getElementById(id).value="";
      document.getElementById(id).style.color="#000000";
    }
  }
 function check_input_strings(searchword, geostring) {//SRA__PKU to check before submittion for search
    if(document.getElementById(searchword).value == searchword_string) {
      document.getElementById(searchword).value = "";
    }
    if(document.getElementById(geostring).value == geostring_string) {
      document.getElementById(geostring).value = "";
    }
  }
function filldefaultvals(defaultext, id){
  if (document.getElementById(id).value == defaultext || document.getElementById(id).value == ""){
 document.getElementById(id).style.color="#999999";
  }
}
function changecolor(id){
      document.getElementById(id).style.color="#000000";
}
function changeColorandVal(id, text){
      document.getElementById(id).value=text;
      document.getElementById(id).style.color="#000000";
}

function gothere(link_checker, innermessage, box_to_uncheck){
if(typeof(box_to_uncheck) != "undefined") {
 box_to_uncheck = box_to_uncheck.split("|");
 for(var ele in box_to_uncheck){
   var che_ele =  box_to_uncheck[ele];
   if(document.getElementById(che_ele) != null) {
     document.getElementById(che_ele).checked=false;
   }
 }
}
document.getElementById('loader').style.display='block';
document.getElementById('loader').style.top=eval(document.documentElement.scrollTop+160)+'px';
var search_link="location.href='"+link_checker+"'";
document.getElementById('message').innerHTML=innermessage;
window.setTimeout(search_link, 1500);
setopac();
showgrey();
}

function closeWindow() {
  self.close();
}
function setDate(datum, form, element) {
  opener.document.getElementsByName(element)[0].value = datum;
}
function addField(form, fieldType, fieldName, fieldValue) {
 if (document.getElementById) {
    var input = document.createElement('INPUT');
      if (document.all) { // what follows should work
                          // with NN6 but doesn't in M14
        input.type = fieldType;
        input.name = fieldName;
        input.value = fieldValue;
      }
      else if (document.getElementById) { // so here is the
                                          // NN6 workaround
        input.setAttribute('type', fieldType);
        input.setAttribute('name', fieldName);
        input.setAttribute('value', fieldValue);
      }
    form.appendChild(input);
 }
}

/* code copied from the email validation pop ups */
  var timerID = 0;

  function enterKeyDisable(evt) {
    if(window.event) {
      if(window.event.type == "keydown" & window.event.keyCode == 13) {
	  return false;
      }
    }
    if(evt) {
      if(evt.type == "keypress" & evt.keyCode == 13) {
	  return false;
      }
    }
  }


  function ev_debug(message) {
    alert(message);
  }

  function dummy_return(param) {
  }

  function display_passwd_sent_too_much(user_email) {
    var el = document.getElementById('too_much_emails_');
    if(el) {
      el.style.display='block';
    }
  }

  function display_passwd_sent_recently(user_email) {
    var el = document.getElementById('password_recently_send_info_');
    if(el) {
      el.style.display='block';
    }
  }

  function redisplay_validated_message(result) {
    var el = document.getElementById('eml_check');
    if(el && result.length > 0) {
      if(el.style.display=='none') {
        display_validated_message(result);
      }
    }
  }

  function display_newuser_welcomemessage(email) {
    var el = document.getElementById('welcome_text_layer');
    if(el) {
      el.style.display='block';
    }

    var el = document.getElementById('show_nag_screen');
    if(el) {
      el.style.display='block';
    }
  }

  function submit_email_forvalidate(email, send_email) {
    var send_email_whilevalidate = false;
    if(send_email &&
       send_email!='undefined') {
      send_email_whilevalidate = true;
    }
    if(timerID) {
      clearTimeout(timerID);
    }
    x_ajax_validate_email_result(email, send_email_whilevalidate);
  }

  function login_email_validate(login_eml) {
   var send_email = false;
   submit_email_forvalidate(login_eml, send_email);
  }

  function submit_email_forvalidate_dly(email, send_email) {
    timerID = setTimeout("submit_email_forvalidate('" + email + "','" + send_email + "')", 5000);
  }

  function correct_mail_fill(){
var leftside=document.getElementById('send_pass1');
var rightside=document.getElementById('send_pass2');
var sucess =document.getElementById('sucess_email_contain');
if (leftside){
leftside.style.display='none';
leftside.innerHTML="";
}
if (rightside){
rightside.style.display='none';
rightside.innerHTML="";
}
if(sucess){
sucess.style.display='block';
sucess.style.marginTop='20px';
sucess.style.fontSize='12px';
sucess.style.fontWeight='normal';
sucess.style.color='#0e780e';
var newemail=document.email_check.login_email.value;
sucess.innerHTML='Soeben haben wir eine E-Mail an '+ newemail+' geschickt.';
}
}
  /* email validation ends */
function partner_url(cnt){
var your_url=document.getElementById('partner_'+cnt).href;
var your_url2=document.getElementById('view_'+cnt).href;
var is_protocol_ok=your_url.indexOf('?');
var is_protocol_ok2=your_url2.indexOf('?');
if ((is_protocol_ok==-1)||(is_protocol_ok2==-1)){
var checkit="?pcount=10"
 }
else{
var checkit="&pcount=10"
}
document.getElementById('partner_'+cnt).href=document.getElementById('partner_'+cnt).href+checkit;
document.getElementById('view_'+cnt).href=document.getElementById('view_'+cnt).href+checkit;
}
$(document).ready(function () {

	//Append a div with hover class to all the LI
	 $('ul.countries li').hover( //Mouseover, fadeIn the hidden hover class
	 function() { $(this).fadeTo('fast', .5); }, //Mouseout, fadeOut the hover class
	 function() { $(this).fadeTo('fast', 1); })
	 });

function fill_midllayer(mid_layer,expiry_message, closeit){
  document.getElementById(mid_layer).innerHTML = "<div style='padding:5px'><div class=\"float-lft\"><img src=\"/images/blank.gif\" width=\"25\" height=\"26\"  class=\"tooltip_img iconpos\" alt=\"\"></div><div class=\"float-rt\"><img src=\"/images/bb_close1.png\" class=\"bb_close\"  alt=\"\"  width=\"12\"  height=\"12\" onClick=\"$('#mail_link_expired').hide();$('#dim').hide();\"> <b onclick=\"$('#mail_link_expired').hide();$('#dim').hide();\"  class=\"bb_close\">"+closeit+"</b></div><p id='notes_meaage'><b>"+expiry_message+"</b></p></div>";
 $('#mail_link_expired').show();$('#dim').show();$("#dim").fadeTo('fast',0.5);
}
function hide_tip(){
$('.mytip').css('visibility','hidden')
}
function show_tip(){
$('.mytip').css('visibility','visible')
}
var ie = document.all?true:false;
//if (!ie) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseXY;

function getMouseXY(e) {
if (ie) { // grab the x-y pos.s if browser is IE
mouse_X = event.clientX + document.documentElement.scrollLeft;
//alert(document.body.offsetWidth);
if (navigator.userAgent.match('AppleWebKit')){
mouse_Y = event.clientY + document.body.scrollTop;
}else{
mouse_Y = event.clientY + document.documentElement.scrollTop;
}
}
else { // grab the x-y pos.s if browser is NS
mouse_X = e.pageX;
mouse_Y = e.pageY;
}
if (mouse_X < 0){mouse_X = 0;}
if (mouse_Y < 0){mouse_Y = 0;}
}
$(document).ready(function(){
$('#dim').css({'-khtml-opacity' : '40', 'opacity' : '.4', 'filter' : 'alpha(opacity=40)'});
});
 msie = (document.all && document.getElementById);
 ns = (!document.all && document.getElementById);
 saf = (navigator.userAgent.indexOf( 'Safari' ) != -1 );
function makeVars(){
if (navigator.userAgent.match('AppleWebKit')){
    y="document.body.scrollTop";
}else{
    y="document.documentElement.scrollTop";
}
	doHeight="document.body.clientHeight"
    xyz=500;
    object="login";
    placeIt();
}

movey=0,ydiff=0,ystart=0;
function makeXY() {
  innerY=eval(doHeight)*.08
  yy=eval(y);
  ydiff=ystart-yy;
  if ((ydiff<(-1))||(ydiff>(1))) movey=Math.round(ydiff/10),ystart-=movey;
	  var totaltop=eval(ystart+innerY);
	  document.getElementById("login").style.top=eval(totaltop)+'px';
      setTimeout("makeXY()",25);
}

function placeIt(){
  ystart=eval(y);
}
function showTeaser(url){
    	y= document.getElementById("login_link");
		y.innerHTML = '';
		y.innerHTML = "<a href=" + url + ">"+getNewTeaserText('login_layer_link1')+"</a>";
		document.getElementById("login_title").innerHTML = getNewTeaserText('new_user_login_title');
		document.getElementById("login_text").innerHTML = getNewTeaserText('register_link');
		fadeIn();
        makeVars();
        makeXY();
}

function showNewTeaser(url){
    	y= document.getElementById("login_link");
		y.innerHTML = '';
		y.innerHTML = "<a href=" + url + ">"+getNewTeaserText('login_layer_link2')+"</a>";
		document.getElementById("login_title").innerHTML = getNewTeaserText('user_login_title');
		document.getElementById("login_text").innerHTML =  getNewTeaserText('login_link');
		fadeIn();
        makeVars();
        makeXY();
}

//fades layer in
		msie  = (document.all && document.getElementById);
		ns = (!document.all && document.getElementById);
		saf = (navigator.userAgent.indexOf( 'Safari' ) != -1 );
		 function displaylogin(){
		    document.getElementById('login').style.display = 'block';
		 }
function fadeIn() {
		  $('#dim').show();
          $('#login').show();
		  $("#dim").fadeTo('fast',0.5);
           setTimeout('displaylogin()', 100);
}
//fades layer out

     function fadeOut() {
		   $('#dim').hide();
          $('#login').hide();
         }

function showgrey(){
	var bodyheight = document.documentElement.clientHeight;
		$('#dim').show();
		$('#dim').zIndex;
		$('#dim').css('z-index','2');
}
function gettdheight(){
	chkheight=document.getElementById('kontakting').offsetHeight;
	document.getElementById('getheight').style.height=chkheight+75+'px';

}
function show_newlogin_box(){
	 $('a.intra').click(function(event){
	  showNewTeaser(this.href);
	  event.preventDefault();
  })
	 $('a.intrasticky').click(function(event){
	  showNewTeaser(this.href);
	  event.preventDefault();
  })
}
function show_oldlogin_box(){
	 $('a.intra').click(function(event){
	  showTeaser(this.href);
	  event.preventDefault();
  })
	 $('a.intrasticky').click(function(event){
	  showTeaser(this.href);
	  event.preventDefault();
  })
  }
function show_sticky_box(){
  	 $('a.intrasticky').click(function(event){
     var vars = [], hash;
    var hashes = this.href.slice(this.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars= hash[1];
    }
      save_sticky(vars);

	  event.preventDefault();
  })
}

$(document).ready(function() {
$('.countrylist').click(function() {
var myNewString = $(this).children('img').attr('alt')
window.location.href = myNewString;
});
});


// Code for sgd testimonial

$(document).ready(function(){
//calls fnResize on document load
fnResize();
$('.showbox').css("left", ( $(window).width() - $('.showbox').width() ) / 2+$(window).scrollLeft()+ 150 + "px");
$(window).resize(function(){
//calls fnResize every time the browser is resized.
fnResize();
});
});
function fnResize(){
// gets current window width and assigns to winWidth variable to be used throughout function
var winWidth = $(window).width();

//added this just to update the div so i know how wide the browser is, this isnt neccessary and can be removed
//$("#size").text(winWidth);
$('.showbox').css("left", ( $(window).width() - $('.showbox').width() ) / 2 + $(window).scrollLeft()+ 150 + "px");
//assigns the banner variable to the dom object #banner, this case is our DIV with an id of banner
var sgdtestimonail = $("#sgdtestimonail");

// if window is less than 900 do below
if (winWidth < 900){

//checks which css class the banner div has right now, if it is showing (has showbox class) then we need to hide it
if(sgdtestimonail.hasClass("showbox")){
//remove the class showbox
sgdtestimonail.removeClass("showbox");
//add the class hidebox to hide the box
sgdtestimonail.addClass("hidebox");
}
}
// if window is gt than 900 do below
if (winWidth >= 900){

//checks which css class the banner div has right now, if it is hiding (has hidebox class) then we need to showbox it
if(sgdtestimonail.hasClass("hidebox")){

//remove the hidebox class
sgdtestimonail.removeClass("hidebox");
//add the show box class
sgdtestimonail.addClass("showbox");
}
}
}
function addslashes (str) {
    return (str+'').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
}

function randomsgd_texts(){
var rndId = Math.floor(Math.random()*6);
var testimonial=new Array()
testimonial[0]="<div style='padding:20px 55px 30px 25px'><b>Flexible Zeiteinteilung beim Abitur-Lehrgang der SGD</b><br><br><img  alt='' src='/images/sgd/Bettina-Keller.jpg' align='left' width='96' height='126' style='margin-right:10px;margin-bottom:10px'>&#132;Ich habe mich daf&uuml;r entschieden, mein Abitur bei der Studien- gemeinschaft Darmstadt nachzuholen. Schon seit 1973 f&uuml;hrt die SGD tausende von Menschen erfolgreich zum Abitur. Beim Lernen bin ich total flexibel und kann mir frei einteilen, wann, wo und wie viel ich lerne. Das ist f&uuml;r mich, da ich berufst&auml;tig bin, &auml;u&szlig;erst wichtig.'<br><br><b>Bettina Keller</b>,<i> Teilnehmerin des SGD-Lehrgangs &#132;Abitur&#147;</i></div>";

testimonial[1]="<div style='padding:10px 44px 30px 20px'><b>Die richtige Basis f&uuml;r die Selbst&auml;ndigkeit</b><br><img  alt='' src='/images/sgd/Andrea-Cordes.jpg' align='left' width='96' height='126' style='margin-right:10px;margin-bottom:10px'>Der SGD-Lehrgang hat mir viel Selbstbewusstsein gegeben; auf die Zusatzqualifikation bin ich richtig stolz. Sie ist f&uuml;r mich als gelernte Arzthelferin nicht nur bei der Jobsuche, sondern auch beim Start in die Selbstst&auml;ndigkeit ein gro&szlig;er Vorteil. Ich gebe Kurse in Schulen und Kinderg&auml;rten und Kurse zur S&auml;uglingsern&auml;hrung. Demn&auml;chst beginnt die Zusammenarbeit mit einer Physiotherapeutin, und dann sollen noch Kurse zur Gewichtsabnahme folgen, besonders f&uuml;r &uuml;bergewichtige Kinder. F&uuml;r all das ist mein SGD-Lehrgang die richtige Basis.&#147;<br><br><b>Andrea Cordes</b>,<i>Teilnehmerin des SGD-Lehrgangs &#132;Ern&auml;hrungsberater/in&#147;</i></div>";

testimonial[2]="<div style='padding:20px 55px 30px 25px'><b>H&auml;tte ich doch gleich die SGD gew&auml;hlt!</b><br><br><img alt='' src='/images/sgd/Juliana-Andrade.jpg' align='left' width='96' height='126' style='margin-right:10px;margin-bottom:10px'>Dank des Lehrgangs &#132;Spanisch f&uuml;r Fortge- schrittene&#147; bei der SGD konnte ich meine Sprachkenntnisse noch einmal vertiefen und schlie&szlig;lich beim Erwerb der Sprachdiplome &#130;Salamanca Nivel intermedio&#145; und &#130;Nivel Superior&#145; unter Beweis stellen. Daraufhin haben sich meine M&ouml;glichkeiten, Spanisch zu unterrichten, betr&auml;chtlich erweitert. Mein Motto: Bildung und SGD schaffen Integration!&#147;<br><br><b>Juliana Andrade Berto-Gr&uuml;nzinger</b>,<br><i>Teilnehmerin des SGD-Lehrgangs,<br>&#132;Spanisch f&uuml;r Fortgeschrittene&#147;</i></div>";

testimonial[3]="<div style='padding:10px 44px 30px 20px'><b>Hochleistungssport und Fernlernen erg&auml;nzen einander optimal</b><br><img alt='' src='/images/sgd/Matthias-Kuhn.jpg' align='left' width='96' height='126' style='margin-right:10px;margin-bottom:10px'>&#132;Ich betreibe Skilanglauf als Hochlei- stungssport und nehme an internationalen Wettk&auml;mpfen teil. Da f&uuml;r mich Bildung ein wichtiges Thema ist, bin ich fest entschlossen, neben meiner sportlichen Laufbahn die Weiterbildung nicht zu kurz kommen zu lassen. Das Thema Internet interessiert mich sehr, vor allem Web-Design. Nachdem ich auf die SGD gesto&szlig;en war, habe ich mich gleich f&uuml;r den Kurs &#132;Gepr&uuml;fter Web-Designer&#147; entschieden. Ein herk&ouml;mmliches Studium l&auml;sst sich nur sehr schwer mit Hochleistungsport verbinden; die fixen Pr&uuml;fungstermine und regelm&auml;&szlig;igen Seminare engen das Training doch sehr ein.<br><br><b>Matthias Kuhn</b>,<i>Teilnehmer des SGD-Lehrgangs &#132;Gepr&uuml;fter Web-Designer (SGD)&#147;</i></div>";

testimonial[4]="<div style='padding:10px 44px 30px 20px'><b>Inzwischen vertraue ich der SGD blind</b><br><img alt='' src='/images/sgd/Mirko-Link.jpg' align='left' width='96' height='126' style='margin-right:10px;margin-bottom:10px'>&quot;Ich wollte mich beruflich unbedingt ver&auml;ndern. Das habe ich mit Flei&szlig;, Einsat- zbereitschaft und der SGD auch zu meiner vollsten Zufriedenheit geschafft. Bereits nach f&uuml;nf Praktikumsmonaten bekam ich ein Angebot von meinem jetzigen Arbeitgeber, und dabei haben sowohl das Wissen aus meinen Lehrg&auml;ngen wie auch die dahinterstehende Leistungsbereitschaft eine entscheidende Rolle gespielt. Nach meinem Lehrgang &#130;Ausbildung der Ausbilder' bekam ich ein weiteres Angebot, diesmal von der IHK. Ich wurde zun&auml;chst Mitglied zweier Pr&uuml;fungskommissionen und schlie&szlig;lich deren Vorsitzender.<br><br><b>Mirko Link</b>,<i>Teilnehmer der SGD-Lehrg&auml;nge &quot;Gepr&uuml;fter Personalreferent bsb&quot;, &quot;Ausbildung der Ausbilder IHK&quot;, &quot;Mitarbeiter f&uuml;hren und motivieren&quot; und &quot;Rhetorik&quot;</i></div>";

testimonial[5]="<div style='padding:20px 55px 30px 25px'><b>Lernen, neben dem Beruf und von zuhause aus!</b><br><br><img alt='' src='/images/sgd/Manfred-Haas.jpg' width='96' height='126' align='left' style='margin-right:10px;margin-bottom:10px'>&quot;Mein Fernstudium bei der Studien- gemeinschaft Darmstadt hat mir einen Karriereschub verpasst. In bin mittlerweile in einer Position t&auml;tig, die ich ohne mein Weiter- bildungsengagement so nie erreicht h&auml;tte. Besonders gut gefallen hat mir an der SGD, dass ich die M&ouml;glichkeit hatte, mir die Lernzeiten flexibel einzuteilen.<br><br><b>Manfred Haas</b>,<i>Absolvent des SGD-Lehrgangs &quot;Gepr&uuml;fte/r Technische/r Betriebswirt/in</i></div>";

return testimonial[rndId];
}

String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
}

function display_ads_for_referring(is_first_page, is_last_page, pageNum, last_page, start_page, end_page, resultstr, sorting, sorting_order, is_dummy_zip_country, current_user_id, first_time, waiting_message) {
    var objec = eval('(' + resultstr + ')');
    var sid_exists=window.location.href.indexOf('sid=');

    document.getElementById('sorting').value = sorting;
    document.getElementById('sorting_order').value = sorting_order;
    if(!is_first_page) {
        $("#post_new_ad").hide();
    }
    else {
        $("#post_new_ad").show();
    }

    document.getElementById('display_active_ads').scrollTop = 0;
	if(document.getElementById('number_of_ads_perpage').value>=3 && first_time=="first_load"){
	    document.getElementById('getheight').style.height=380+'px';
	}
    for(var j=0;j < Number(document.getElementById('number_of_ads_perpage').value);j++) {
        document.getElementById('main_div_'+j).style.display = 'none';
        document.getElementById('check_box_'+j).checked = false;
    }
    var i=0;
    for(unique_id in objec) {
        document.getElementById('main_div_'+i).style.display = 'block';
        document.getElementById('check_box_'+i).value = objec[unique_id].ad_id;
        if(objec[unique_id].ad_id.trim() == '') {
            document.getElementById('check_box_'+i).value = objec[unique_id].contact_unique_id.trim();
	    document.getElementById('display_adid_'+i).style.display="none";
        }
        if((document.getElementById('selected_ad').value.trim() == objec[unique_id].ad_id.trim()) && objec[unique_id].ad_id.trim()!='') {
            document.getElementById('check_box_'+i).checked = true;
        }

        document.getElementById('anch_id_'+i).innerHTML  = objec[unique_id].title;
        if(sid_exists == -1) {
            document.getElementById('display_adid_'+i).href  = objec[unique_id].detailview_link+'?print=1&gj_preview=1';
        }
        else {
            document.getElementById('display_adid_'+i).href  = objec[unique_id].detailview_link+'?print=1&gj_preview=1&sid='+asid;
        }

        var location = "";
        if(objec[unique_id].location_array.zip) {
            if(!is_dummy_zip_country) {
                location += objec[unique_id].location_array.country_code+'-'+objec[unique_id].location_array.zip;

                if(objec[unique_id].location_array.town) {
                    location += ' '+objec[unique_id].location_array.town;
                }
            }
            else {
                location = objec[unique_id].location_array.town+'('+objec[unique_id].location_array.country_code+')';
            }
        }
        else {
            if(objec[unique_id].location_array.country_prefix) {
                location += objec[unique_id].location_array.country_prefix+'&nbsp';
            }
            location += objec[unique_id].location_array.country_name;
        }
        var truncated_location = location.substring(0,20);
        if(location.length>20) {
            truncated_location+= '....';
        }
        document.getElementById('location_text_'+i).innerHTML  = truncated_location;

        if(objec[unique_id].id!='') {
             document.getElementById('display_adid_'+i).innerHTML = objec[unique_id].id;
        }
        i++;
    }
    $("#ad_refer_loader").hide();
    $("#display_active_ads").stop().fadeTo('fast',1);
    process_navigation(pageNum, last_page, start_page, end_page, current_user_id, waiting_message);
}

function process_referring_ads(current_user_id, current_case, pageNum, waiting_text) {
    //var sorting_order;
    document.getElementById('selected_ad').value='';
    var number_of_ads_perpage = document.getElementById('number_of_ads_perpage').value;
    var ad_type = document.getElementById('ad_type').value;
    var sorting = document.getElementById('sorting').value;
	//if(){
	//}
    var sorting_order = document.getElementById('sorting_order').value;
    var total_active_ads_count = document.getElementById('total_active_ads_count').value;
    var change_sort_order = '';
    if(sorting_order == 'ASC') {
        var change_sort_order = 'DESC';
     $('.'+current_case).css('background', 'url(/images/sort_south.gif) no-repeat right 5px');
   }
    else if(sorting_order == 'DESC') {
    $('.'+current_case).css('background', 'url(/images/sort_north.gif) no-repeat right 5px');
        var change_sort_order = 'ASC';
    }
    document.getElementById('current_pageNum').value = pageNum;
    switch(current_case) {
    case 'navigation':
        show_waiting_layer(waiting_text);
        x_ajax_load_active_ads(pageNum,number_of_ads_perpage,current_user_id,ad_type, sorting,total_active_ads_count, sorting_order, current_case);
        break;
    case 'sort-gjnr':
        show_waiting_layer(waiting_text);
        x_ajax_load_active_ads(1, number_of_ads_perpage, current_user_id, ad_type, 'id',  total_active_ads_count, change_sort_order, current_case);
        break;
    case 'sort_title':
        show_waiting_layer(waiting_text);
        x_ajax_load_active_ads(1, number_of_ads_perpage, current_user_id, ad_type,'title',  total_active_ads_count, change_sort_order, current_case);
        break;
    }
}

function show_waiting_layer(waiting_text) {
    document.getElementById('ad_refer_loader').style.display='block';
    document.getElementById('ad_refer_message').innerHTML= waiting_text;
    setopac_ad_refer();
    showgrey_ad_refer();
}

function setopac_ad_refer(){
    $("#display_active_ads").fadeTo('fast',0.1);
}
function showgrey_ad_refer(){
    var bodyheight = document.documentElement.clientHeight;
    $('#display_active_ads').show();
    $('#display_active_ads').zIndex;
    $('#display_active_ads').css('z-index','2');
}

function print_all_active_referring_ads(number_of_ads_perpage) {
    for(i=0; i < number_of_ads_perpage; i++) {
        document.write('<div style="padding:8px 10px 4px 10px;display:none" class="user_postings clearfix" id="main_div_'+i+'" >');
        document.write('<input type="checkbox"  class="chkRdoList" name="contact_referring_ad"  value="" style="float:left;width:15px;display:block" onclick="chkRdoList(this.value,'+i+');" id="check_box_'+i+'">');
        document.write('<label for="check_box_'+i+'" style="display:block;margin-left:24px;margin-top:2px">');
        document.write('<div class="anch_id"><label for="check_box_'+i+'" id="anch_id_'+i+'"></label></div>');
        document.write('<div class="location_text" id="location_text_'+i+'"></div>');
        document.write('<div class="display_adid"><a target="_blank" id="display_adid_'+i+'" class="external_icon pointer"></a></div>');
        document.write('</label>');
        document.write('</div>');
    }
}

function print_navigation(total_active_ads_count, number_of_ads_perpage) {
    var max_page_num = Math.ceil(total_active_ads_count/number_of_ads_perpage);
    document.write('<span id="previous_limit"></span>');
    for(i=1; i <= max_page_num; i++) {
        document.write('<span id="nav_page_num_'+i+'" style="display:none"></span>');
    }
    document.write('<span id="next_limit"></span>');
}

function process_navigation(pageNum, last_page, start_page, end_page, current_user_id, waiting_text) {
    if(Number(pageNum) <= 1) {
        if(document.getElementById('previous_limit')) {
            document.getElementById('previous_limit').style.display = 'none';
        }
    }
    else {
        document.getElementById('previous_limit').style.display = 'inline';
        document.getElementById('previous_limit').innerHTML = '<a style="margin-right:6px" onclick="process_referring_ads(\''+current_user_id+'\', \'navigation\', \''+(Number(pageNum)-1)+'\''+',\''+waiting_text+'\')"><img src="/images/left-arrow.gif" width="6" height="9" alt="" border="0"></a>';
    }

    if(Number(pageNum) >= Number(last_page)) {
        if(document.getElementById('next_limit')) {
        document.getElementById('next_limit').style.display = 'none';
        }
    }
    else {
        document.getElementById('next_limit').style.display = 'inline';
        document.getElementById('next_limit').innerHTML = '<a style="margin-right:6px" onclick="process_referring_ads(\''+current_user_id+'\', \'navigation\', \''+(Number(pageNum)+1)+'\''+',\''+waiting_text+'\')"><img src="/images/right-arrow.gif" width="6" height="9" alt="" border="0"></a>';
   }

    for(i=1; i<=Number(last_page); i++) {
        document.getElementById('nav_page_num_'+i).style.display='none';
    }

    if(Number(last_page) >1) {
        for(i=Number(start_page); i<=Number(end_page); i++) {
            if(document.getElementById('nav_page_num_'+i)) {
                document.getElementById('nav_page_num_'+i).style.display = 'inline';
                if(i ==  pageNum) {
                    document.getElementById('nav_page_num_'+i).innerHTML = '<b style="font-size:12px;color:#000000;margin-right:6px">'+i+'</b>';
                }
                else {
                    document.getElementById('nav_page_num_'+i).innerHTML = '<a style="font-size:11px;margin-right:6px" onclick="process_referring_ads(\''+current_user_id+'\', \'navigation\', \''+i+'\''+',\''+waiting_text+'\')">'+i+'</a>';
                }
            }
        }
    }
}

function check_scroll_bar() {
    var name = document.getElementById('display_active_ads');
    if(name.clientHeight > name.scrollHeight) {
        $('#sorting_option').show();
    }
    else {
        $('#sorting_option').hide();
    }
}
function gj_work_tag_hide(){
    x_ajax_tag_set_session('hide');
    $("#collapse_img").hide();
    $("#collapse_img_d").show();
    $(".gj_work_content").hide();
}
function gj_work_tag_show(){
    x_ajax_tag_set_session('show');
    $("#collapse_img").show();
    $("#collapse_img_d").hide();
    $(".gj_work_content").show();
}
function gj_tag_hide(){
    $("#coll_img").hide();
    $("#coll_img_d").show();
    $(".gj_content").hide();
}
function gj_tag_show(){
    $("#coll_img").show();
    $("#coll_img_d").hide();
    $(".gj_content").show();
}
