I have to use a javascript functions on multiple pages. Hence I have created a separate file with extension .js so that I can include it directly where I need it in my code.
function ClosePopup(ctrl, ctrlid, btype) {
var input = document.getElementsByTagName("a");
var n = '';
for (var i = 0; i < input.length; i++) {
if (btype == 1) {
n = input[i].id.indexOf("popClose");
currentpading = input[i].id.replace("popClose", "");
}
else {
n = input[i].id.indexOf("ppclosebk");
currentpading = input[i].id.replace("ppclosebk", "");
}
if (n > -1) {
if (input[i].id == ctrlid) {
document.getElementById(currentpading + 'MaskedDivback').style.display = 'none';
document.getElementById(currentpading + 'ModalPopupDivback').style.display = 'none';
$('#mycarousel').jcarousel({
scroll: 1
});
}
}
}
Any help will be much appreciated.