/**
  * Pneuhage Reifendienste
  *
  * @copyright       punkt.de GmbH
  * @author          Martin Alker
  * @version         1.0
  *
  * @revision        $Revision: 1.1 $
  * @lastmodified    $Date: 2009/01/12 10:13:24 $
  */

/**
 * @section TYPO3-JS
 *
 * default Javascript from TYPO3 (minified)
 */

var browserName=navigator.appName;var browserVer=parseInt(navigator.appVersion);var version="";var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){version="n3"}else{version="n2"}function blurLink(theObject){if(msie4){theObject.blur()}}function decryptCharcode(n,start,end,offset){n=n+offset;if(offset>0&&n>end){n=start+(n-end-1)}else{if(offset<0&&n<start){n=end-(start-n-1)}}return String.fromCharCode(n)}function decryptString(enc,offset){var dec="";var len=enc.length;for(var i=0;i<len;i++){var n=enc.charCodeAt(i);if(n>=43&&n<=58){dec+=decryptCharcode(n,43,58,offset)}else{if(n>=64&&n<=90){dec+=decryptCharcode(n,64,90,offset)}else{if(n>=97&&n<=122){dec+=decryptCharcode(n,97,122,offset)}else{dec+=enc.charAt(i)}}}}return dec}function linkTo_UnCryptMailto(s){location.href=decryptString(s,2)};

// http://docs.jquery.com/Using_jQuery_with_Other_Libraries
var $j = jQuery.noConflict();

$j(document).ready(function() {

    // add box class for higher boxes
    $j("#pid-4 #col1_content > div:nth-child(1)").addClass("box-higher");
    $j("#pid-4 #col1_content > div:nth-child(2)").addClass("box-higher");

    // info-panel
    $j(".dialog-close").click(function() {
        $j("#info-panel").hide();
        return false;
    });
	
	oTable = $j("#pid-22 table.table-01").dataTable({
		"aaSorting": [[ 1, "asc" ], [ 2, "asc" ]],
		// "bAutoWidth": false,
		// "bPaginate": false,
		"sPaginationType": "full_numbers",
		// "bFilter": false,
		// "bSearchable": false,
		// "bInfo": false,
		"aoColumns": [
			{ "sWidth": "180px" },	// company
			{ "sWidth": "120px" },	// distance
			null,
			{ "sWidth": "180px" },	// city
			{ "sWidth": "180px" },	// street
			{ "sWidth": "120px" }	// phone
		],
		"oLanguage": {
			"sLengthMenu": "Anzeige von _MENU_ Treffer pro Seite",
			"sZeroRecords": "Keine Datensätze gefunden!",
			"sInfo": "Anzeige der Ergebnisse _START_ bis _END_ von insgesamt _TOTAL_",
			"sInfoEmtpy": "Anzeige der Ergebnisse 0 bis 0 von insgesamt 0",
			"sInfoFiltered": "(selektiert aus insgesamt _MAX_ Datensätzen)",
			"sSearch": "Suche in Ergebnissen",
			"oPaginate": {
				"sFirst": "Erste",
				"sLast": "Letzte",
				"sPrevious": "Zurück",
				"sNext": "Nächste"
			}
		}
	});
		
	oTable = $j("#pid-39 table.table-01").dataTable({
		"aaSorting": [[ 1, "asc" ], [ 2, "asc" ]],
		// "bAutoWidth": false,
		// "bPaginate": false,
		"sPaginationType": "full_numbers",
		// "bFilter": false,
		// "bSearchable": false,
		// "bInfo": false,
		"aoColumns": [
			{ "sWidth": "180px" },	// company
			{ "sWidth": "120px" },	// distance
			null,
			{ "sWidth": "180px" },	// city
			{ "sWidth": "180px" },	// street
			{ "sWidth": "120px" },	// phone
			null
		],
		"oLanguage": {
			"sLengthMenu": "Anzeige von _MENU_ Treffer pro Seite",
			"sZeroRecords": "Keine Datensätze gefunden!",
			"sInfo": "Anzeige der Ergebnisse _START_ bis _END_ von insgesamt _TOTAL_",
			"sInfoEmtpy": "Anzeige der Ergebnisse 0 bis 0 von insgesamt 0",
			"sInfoFiltered": "(selektiert aus insgesamt _MAX_ Datensätzen)",
			"sSearch": "Suche in Ergebnissen",
			"oPaginate": {
				"sFirst": "Erste",
				"sLast": "Letzte",
				"sPrevious": "Zurück",
				"sNext": "Nächste"
			}
		}
	});
    
	/* Bug #1194: Ergebnisliste Niederlassungen */
	/*
    $j("table.table-01").dataTable({
        "bAutoWidth": false,
        "bPaginate": true,
        "sPaginationType": "full_numbers",
        "aaSorting": [[1,'asc']],
        "oLanguage": {
            "sLengthMenu": "Anzeige von _MENU_ Treffer pro Seite",
            "sZeroRecords": "Keine Datensätze gefunden!",
            "sInfo": "Anzeige der Ergebnisse _START_ bis _END_ von insgesamt _TOTAL_",
            "sInfoEmtpy": "Anzeige der Ergebnisse 0 bis 0 von insgesamt 0",
            "sInfoFiltered": "(selektiert aus insgesamt _MAX_ Datensätzen)",
            "sSearch": "Suche in Ergebnissen",
            "oPaginate": {
                "sFirst": "Erste",
                "sLast": "Letzte",
                "sPrevious": "Zurück",
                "sNext": "Nächste"
            }
        }
    });
    
    $j("#pid-22 table.table-01").dataTable({
        "bPaginate": false,
        "aaSorting": [[1,'asc'], [2,'asc']],
        "bFilter": false,
        "bSearchable": false,
        "bInfo": false,
        "aoColumns": [
            { "sWidth": "180px" },
            { "sWidth": "111px" },
            { "sWidth": "40px" },
            { "sWidth": "120px" },
            { "sWidth": "120px" },
            { "sWidth": "120px" }
        ]
    });
    
    $j("#pid-39 table.table-01").dataTable({
        "bPaginate": false,
        "bFilter": false,
        "bSearchable": false,
        "bInfo": false,
        "aoColumns": [
            { "sWidth": "100px" },
            { "sWidth": "111px" },
            { "sWidth": "40px" },
            { "sWidth": "120px" },
            { "sWidth": "180px" },
            { "sWidth": "120px" },
            { "sWidth": "80px" }
        ]
    });
	*/

    $j("table.table-02 tbody tr:even").addClass("even");
    $j("table.table-02 tbody tr:odd").addClass("odd");
    $j("table.table-02 tbody tr:first").addClass("first");
    
    $j("a.form-info").cluetip({
        splitTitle: '|',
        width: "225",
        dropShadow: false, 
        waitImage: false,
        cluetipClass: "jtip"
    });
    
    // jquery ui tabs
    // convert ajax-tabs to in-page tabs
    // $j("#box-tab-01 .tabs-menu a").attr("href", function(arr){return "#tabs-" + arr}).removeAttr("rel");
    // include ui tabs
    // $j("#box-tab-01").tabs();
    // remove style attribute from div-tag
    $j("div.tabs-menu").removeAttr("style");


});