
$(document).ready(function(){


  var blocksearch=0;
  

	$('#suche').keyup(function(e) {
			if (this.value != this.lastValue) {
				  if (this.timer) clearTimeout(this.timer);
				 //hier code ajax 
					this.timer = setTimeout(function () {
					if (blocksearch==0) {
						$('#suche').css("background-image","url(http://www.service.grazersoft.com/poxleitner/UserFiles/Image/main/load.gif)");
						$('.borderbottom2_path').html("Suche");
						$.ajax({
						  type: "POST",
						  url: "http://www.service.grazersoft.com/poxleitner/modules/dynsearch/search.php?search=" + rawurlencode(($('#suche').val())),
				  	   error: function(msg){
						 alert( "error " + msg );blocksearch=0;
						 $('#suche').css("background-image","url(http://www.service.grazersoft.com/poxleitner/UserFiles/Image/main/linklogo.jpg)");
					   },
						success: function(msg){
							$('#content2').html(rawurldecode(msg));
							blocksearch=0;
							$('#suche').css("background-image","url(http://www.service.grazersoft.com/poxleitner/UserFiles/Image/main/linklogo.jpg)");
							//if (parseInt(msg) > 0) $("#edt_con_id_name").css("background-color","#ff7e96"); else $("#edt_con_id_name").css("background-color","#a8ff82");
						  }
						});
					}
					blocksearch=1;
					this.lastValue = this.value;
					},500);
			}					
	});



  
  
  
			$(".nav13")
			.superfish({
				animation : { opacity:"show",height:"show"}
			}) 
  
  
  
  
  
  
$('table.table-1 tbody tr:odd').addClass('table-1-odd');
$('table.table-1 tbody tr:even').addClass('table-1-even');


	$("#nav").css("display","block");
	
	$('.nav1').accordion({
	
		active: false, 
		header: '.head', 
		navigation: true, 
		event: 'mouseover', 
		fillSpace: true, 
		animated: 'easeslide' 
	
	
	});
	var openit=0;
	$(".nav1 ul").each(function(i){
		$(this).attr("id","nav1"+i);
		var cookie = $.cookie("nav1"+i);
			if(cookie === null || String(cookie).length < 1) {
		}
		else {
			openit++;
			$(this).css("display",cookie);
		}
	});
	if (openit==0){
		//$(".nav1").find("ul:first").css("display","block");
	
	}
	
//edenspec

$(".layout-header-content-top img").css("width",1030);
$(".layout-header-content-top img").css("height",161);
$(".layout-header-top-logo img").css("width",330);
$(".layout-header-top-logo img").css("height",110);

var nothighmenu=0;

$(".nav-bottom").each(function(i){
  var tmpimg=$(this).find('img').attr("src");
  if (tmpimg.search(/-g.jpg/) == -1) nothighmenu=i;
});



	$(".nav-bottom a").mouseover( function() { 
		var imgname=$(this).find('img').attr("src");
		if (imgname.search(/-g.jpg/) >0){ 
			var imgname2=imgname.split("-g.jpg");
			$(this).find('img').attr("src",imgname2[0]+".jpg");
		}
		//$(this).find('img').attr("src",imgname2[0]+".jpg");
		//$(this).fadeTo("fast", 0.6);
	});
	$(".nav-bottom a").mouseout( function() { 
		//$(this).fadeTo("fast", 0.0);
		$(".nav-bottom").each(function(i){
		  var tmpimg=$(this).find('img').attr("src");
		  if (tmpimg.search(/-g.jpg/) == -1 && nothighmenu != i){
			var tmpimg2=tmpimg.split(".jpg");
			//alert(tmpimg);
			$(this).find('img').attr("src",tmpimg2[0]+"-g.jpg");
		  };
		});
		
	});





//$(".content a").before("&raquo;");

if (document.cookie) {$("#colmenu").css("display","block");}


	$("#colmenu").click( function() { 
	if ($.cookie(COOKIE_NAME_1) == "1") {$.cookie(COOKIE_NAME_1, '0', { path: '/', expires: 10 }); $("#grtheader0").css("display","none");}
	else {$.cookie(COOKIE_NAME_1, '1', { path: '/', expires: 10 }); $("#grtheader0").css("display","block");}
	});


	$(".transp").mouseover( function() { 
		$(this).fadeTo("fast", 0.6);
	});
	$(".transp").mouseout( function() { 
		$(this).fadeTo("fast", 0.0);
	
	});



	$(".transp").click(function() {
		prjTbName= 	$(this).attr("name");
		window.parent.gr_showtiny(	$(this).attr("id"),	$(this).attr("name"), prjTbName, $(this.previousSibling).attr("name"));
	});

	$("#btnlogin").click( function() { 
		$("#btnlogin").submit();
	});
	$("#btnsuchen").click( function() { 
		var su1=$("#suchen").attr('action'); ;
		$('#suchen').attr({ action:  su1+'search_'+escape(gr_melit($('.suchtext').val()))+'.html' }); 
		$("#suchen").submit();
		//document.suchen.submit();
	});

	$("#suchen").submit( function() {
		var su1=$("#suchen").attr('action'); ;
		$("#suchen").attr({ action: su1+"search_"+escape(gr_melit($(".suchtext").val()))+".html" });  
	} );
	
	


	$(".grnavtr").css("opacity",0.5);
	stopTimer();startTimer();
	$(".grnavtr").mouseout( function() { stopTimer();startTimer();} );
	$(".grnavtr").mousemove( function() { stopTimer(); $(".grnavtr").css("opacity",0.5); } );
	$(".grnavtr").click( function() { stopTimer(); $(".grnavtr").css("opacity",0.5); } );

});




var COOKIE_NAME_1 = 'gr_coo_colmenu';



var ktrfade=0;
var timeOut;
function startTimer()
{
	ktrfade++;
    timeOut = setTimeout("startTimer();",100);
	if (ktrfade>30){clearTimeout(timeOut);$(".grnavtr").fadeTo("slow", 0.0,function(){});ktrfade=0;}
}

function stopTimer()
{
	ktrfade=1;
    clearTimeout(timeOut);
} 








function gr_melit(text){
	text = text.replace(/[,$./\<\>\\\']/g , '');
	return text;
}




function gr_left(str){
	var n=25;
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    {
		var tmpstr=String(str).substring(0,n);
		var tmpstr1=tmpstr.split(" ");
		var nexstr="";
		for (var i = 0; i < tmpstr1.length-1; i++)
		nexstr+=tmpstr1[i]+" ";

		return nexstr+"...";
		}
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}




function convert2Password( obj )
{
obj = obj.parentNode;
obj.innerHTML = "<input type='password' id='myPassword' size='35'>";
window.setTimeout( "document.getElementById('myPassword').focus()" , 10 );
}

function rawurldecode( str ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Brett Zamir (http://brett-zamir.me)
    // +      input by: travc
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: rawurldecode('Kevin+van+Zonneveld%21');
    // *     returns 1: 'Kevin+van+Zonneveld!'
    // *     example 2: rawurldecode('http%3A%2F%2Fkevin.vanzonneveld.net%2F');
    // *     returns 2: 'http://kevin.vanzonneveld.net/'
    // *     example 3: rawurldecode('http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a');
    // *     returns 3: 'http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a'
    // *     example 4: rawurldecode('-22%97bc%2Fbc');
    // *     returns 4: '-22—bc/bc'
 
    var histogram = {}, ret = str.toString(), unicodeStr='', hexEscStr='';
 
    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };
 
    // The histogram is identical to the one in urlencode.
    histogram["'"]   = '%27';
    histogram['(']   = '%28';
    histogram[')']   = '%29';
    histogram['*']   = '%2A';
    histogram['~']   = '%7E';
    histogram['!']   = '%21';
 
 
    for (unicodeStr in histogram) {
        hexEscStr = histogram[unicodeStr]; // Switch order when decoding
        ret = replacer(hexEscStr, unicodeStr, ret); // Custom replace. No regexing
    }
 
    // End with decodeURIComponent, which most resembles PHP's encoding functions
    ret = ret.replace(/%([a-fA-F][0-9a-fA-F])/g, function (all, hex) {return String.fromCharCode('0x'+hex);}); // These Latin-B have the same values in Unicode, so we can convert them like this
    ret = decodeURIComponent(ret);
 
    return ret;
}

function rawurlencode( str ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Brett Zamir (http://brett-zamir.me)
    // +      input by: travc
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: Michael Grier
    // +   bugfixed by: Brett Zamir (http://brett-zamir.me)
    // *     example 1: rawurlencode('Kevin van Zonneveld!');
    // *     returns 1: 'Kevin%20van%20Zonneveld%21'
    // *     example 2: rawurlencode('http://kevin.vanzonneveld.net/');
    // *     returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F'
    // *     example 3: rawurlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a');
    // *     returns 3: 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a'
 
    var histogram = {}, unicodeStr='', hexEscStr='';
    var ret = str.toString();
 
    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };
 
    // The histogram is identical to the one in urldecode.
    histogram["'"]   = '%27';
    histogram['(']   = '%28';
    histogram[')']   = '%29';
    histogram['*']   = '%2A'; 
    histogram['~']   = '%7E';
    histogram['!']   = '%21';
    histogram['\u20AC'] = '%80';
    histogram['\u0081'] = '%81';
    histogram['\u201A'] = '%82';
    histogram['\u0192'] = '%83';
    histogram['\u201E'] = '%84';
    histogram['\u2026'] = '%85';
    histogram['\u2020'] = '%86';
    histogram['\u2021'] = '%87';
    histogram['\u02C6'] = '%88';
    histogram['\u2030'] = '%89';
    histogram['\u0160'] = '%8A';
    histogram['\u2039'] = '%8B';
    histogram['\u0152'] = '%8C';
    histogram['\u008D'] = '%8D';
    histogram['\u017D'] = '%8E';
    histogram['\u008F'] = '%8F';
    histogram['\u0090'] = '%90';
    histogram['\u2018'] = '%91';
    histogram['\u2019'] = '%92';
    histogram['\u201C'] = '%93';
    histogram['\u201D'] = '%94';
    histogram['\u2022'] = '%95';
    histogram['\u2013'] = '%96';
    histogram['\u2014'] = '%97';
    histogram['\u02DC'] = '%98';
    histogram['\u2122'] = '%99';
    histogram['\u0161'] = '%9A';
    histogram['\u203A'] = '%9B';
    histogram['\u0153'] = '%9C';
    histogram['\u009D'] = '%9D';
    histogram['\u017E'] = '%9E';
    histogram['\u0178'] = '%9F';
 
 
    // Begin with encodeURIComponent, which most resembles PHP's encoding functions
    ret = encodeURIComponent(ret);
 
    for (unicodeStr in histogram) {
        hexEscStr = histogram[unicodeStr];
        ret = replacer(unicodeStr, hexEscStr, ret); // Custom replace. No regexing
    }
 
    // Uppercase for full PHP compatibility
    return ret.replace(/(\%([a-z0-9]{2}))/g, function(full, m1, m2) {
        return "%"+m2.toUpperCase();
    });
}


function htmlentities (string, quote_style) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: nobbler
    // +    tweaked by: Jack
    // +   bugfixed by: Onno Marsman
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    bugfixed by: Brett Zamir (http://brett-zamir.me)
    // -    depends on: get_html_translation_table
    // *     example 1: htmlentities('Kevin & van Zonneveld');
    // *     returns 1: 'Kevin &amp; van Zonneveld'
    // *     example 2: htmlentities("foo'bar","ENT_QUOTES");
    // *     returns 2: 'foo&#039;bar'
 
    var histogram = {}, symbol = '', tmp_str = '', entity = '';
    tmp_str = string.toString();
    
    if (false === (histogram = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
        return false;
    }
    histogram["'"] = '&#039;';
    for (symbol in histogram) {
        entity = histogram[symbol];
        tmp_str = tmp_str.split(symbol).join(entity);
    }
    
    return tmp_str;
}
function html_entity_decode( string, quote_style ) {
    // http://kevin.vanzonneveld.net
    // +   original by: john (http://www.jd-tech.net)
    // +      input by: ger
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Onno Marsman
    // +   improved by: marc andreu
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    bugfixed by: Brett Zamir (http://brett-zamir.me)
    // -    depends on: get_html_translation_table
    // *     example 1: html_entity_decode('Kevin &amp; van Zonneveld');
    // *     returns 1: 'Kevin & van Zonneveld'
    // *     example 2: html_entity_decode('&amp;lt;');
    // *     returns 2: '&lt;'
 
    var histogram = {}, symbol = '', tmp_str = '', entity = '';
    tmp_str = string.toString();
    
    if (false === (histogram = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
        return false;
    }
 
    for (symbol in histogram) {
        entity = histogram[symbol];
        tmp_str = tmp_str.split(entity).join(symbol);
    }
    tmp_str = tmp_str.split('&#039;').join("'");
    
    return tmp_str;
}