﻿
var win = null;
function _NewWindow(mypage, myname, w, h, scroll) {
    
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

function print_page() {
    self.focus();
    self.print()
}

function showStatus(sMsg) {
    window.status = sMsg;
    return true;
}

function hideDwLegend(page) {    
    if (page == 1) {
        document.getElementById("Legend").style.display = 'none';
    }    
}

function getUrlParam(name) {
    if (name == 'base') {
        var pathArray = String(window.location.href).split('/');
        var host = 'http://' + pathArray[2] + '/';
        return host;
    } else {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regexS = "[\\?&]" + name + "=([^&#]*)";
        var regex = new RegExp(regexS);
        var results = regex.exec(window.location.href);
        if (results == null) {
            return "";
        } else {
            return results[1];
        }
    }
}

/* GA tracking van o.a. vergroot foto,etc */
function TrackPageViewAction(trackPageview) {
    if (_gaq != undefined) {
        //alert('_trackPageview: ' + trackPageview);
        _gaq.push(['_trackPageview', trackPageview]);
    }
}

function GetAuthorImage(sAuthorName) {
    var img = sAuthorName.toString();
    img = img.toLowerCase();
    img = img.replace(/([^a-z])/gim, "");
    img = '/files/billeder/bloggers/' + img + '.jpg';
    return img;
}

function ShortenText(sText, iMaxLength) {
    var text = sText.toString();
    var maxlength = parseInt(iMaxLength)
    if (text.length > maxlength) { //afkappen en ... toevoegen
        var ss = text.substring(0, maxlength);
        var ar = ss.split(" ");
        text = "";
        for (i = 0; i < ar.length - 1; i++) {
            text += ar[i] + " ";
        }
        text += " ..."
    }
    return text;
}

var MouseOverIKT = 'false'

$(document).ready(function () {
    $('#iktelwrapper').clone().appendTo('#iktelcontentwrapper');
 

});
