document.op = !!(window.opera);
document.nt = !!(navigator.appName == "Netscape");
function gel(a){
if (b = document.getElementById(a)){
return b;
} else {
return new Object;
}
}
function showdialog(title,url,width){
width = width || '500px';
$('#dialog').jqm({
ajax: url,
target: $('#dialog .jqmcontent'),
modal:true
});
$('#dialog').css({'width':width, 'margin-left':"-" + (parseInt(width) / 2) + "px"});
$('#dialog .title').html(title);
$('#dialog').jqmShow();
window.scrollTo(0,0);
return false;
}
function doShowPriorities(id){}
function changeLanguageTo(lng){
window.location.href="?id=" + document.lastPageIdx3 + "&lng=" + lng;
}
var stillLoading = 0;
function getPage(pageId,newLng){
document.lastPageIdx3 = pageId
window.location.hash = "id=" + pageId;
document.newLng = newLng;
}
function getPageFinal(a){
if (a){
document.a = a;
}
if (document.newLng != document.lastLng){
changeLanguage(document.newLng);
}
updatePath(a);
if (isInternetExplorer){
document.getElementById("blankFrame").src = "blank.php?id=" + a + "&lng=" + document.newLng + "#id=" + document.a;
}
makeRequest("http://www.jetanekosove.com/advCms/content.php?id=" + document.a + "&lng=" + document.newLng, "drawTemplate", "");
//makeRequest("http://www.jetanekosove.com/advCms/contentComplete.php?id=" + document.a + "&lng=" + document.newLng, "drawTemplateCompleted", "");
document.lastLng = document.newLng;
return;
}
function updatePath(a){
makeRequest("http://www.jetanekosove.com/advCms/inc/headerPath.php?id=" + a, "headerPath", "textid");
}
function changeLanguage(a){
document.lastLng = a;
document.b = a;
//gel("banner_desc").src = "http://www.jetanekosove.com/advCms/img/sys/banner_desc_" + a + ".jpg";
makeRequest("inc/menutop.php?id=" + document.a + "&lng=" + a, "topmenu", "textid");
makeRequest("inc/header.php?id=" + document.a + "&lng=" + a, "headerHolderx", "textid");
}
function drawTemplate(xml){
if (xml.childNodes.length > 0){
for (i = 3; i < 6; i++){
col = xml.firstChild.childNodes[i];
if (col){
colId = col.attributes[0].value;
for (j = 0; j < 8; j++){
if (row = col.childNodes[j]){
row = col.childNodes[j];
rowId = row.attributes[0].value;
channelId = row.attributes[1].value;
channelPath = row.attributes[2].value;
channelLang = document.b;
channelCategoryId = row.attributes[4].value;
channelPageSubName = row.attributes[5].value;
isStatic = row.attributes[3].value;
d = gel("d_" + (i+1) + "_" + (j+1));
if (d.style){
d.style.display = 'inline';
}
if (isStatic == 0 || d.channelId != channelId || d.channelLang != channelLang){
makeRequest("getChannel.php?channelPath=" + channelPath + "&id=" + document.a + "&categoryId=" + channelCategoryId + "&channelName=" + encodeURIComponent(channelPageSubName), "d_" + (i+1) + "_" + (j+1), "textid");
d.channelId = channelId;
d.channelLang = channelLang;
}
} else {
d = gel("d_" + (i+1) + "_" + (j+1));
d.innerHTML = "";
if (d.style){
d.style.display = 'none';
}
d.channelId = "";
d.channelLang = "";
}
}
} else {
for (j = 0; j < 8; j++){
d = gel("d_" + (i+1) + "_" + (j+1));
d.innerHTML = "";
d.channelId = "";
d.channelLang = "";
}
}
}
for (i = 0; i < 3; i++){
col = xml.firstChild.childNodes[i];
if (col){
colId = col.attributes[0].value;
for (j = 0; j < 8; j++){
if (row = col.childNodes[j]){
row = col.childNodes[j];
rowId = row.attributes[0].value;
channelId = row.attributes[1].value;
channelPath = row.attributes[2].value;
channelLang = document.b;
channelCategoryId = row.attributes[4].value;
channelPageSubName = row.attributes[5].value;
isStatic = row.attributes[3].value;
d = gel("d_" + (i+1) + "_" + (j+1));
if (d.style){
d.style.display = 'block';
}
if (isStatic == 0 || d.channelId != channelId || d.channelLang != channelLang){
makeRequest("getChannel.php?channelPath=" + channelPath + "&id=" + document.a + "&categoryId=" + channelCategoryId + "&channelName=" + channelPageSubName, "d_" + (i+1) + "_" + (j+1), "textid");
d.channelId = channelId;
d.channelLang = channelLang;
}
} else {
d = gel("d_" + (i+1) + "_" + (j+1));
d.innerHTML = "";
if (d.style){
d.style.display = 'none';
}
d.channelId = "";
d.channelLang = "";
}
}
} else {
for (j = 0; j < 8; j++){
d = gel("d_" + (i+1) + "_" + (j+1));
d.innerHTML = "";
d.channelId = "";
d.channelLang = "";
}
}
}
} else {
alert("NOTHING TO DISPLAY");
}
}
// getPage(1);
function showLoader(){
l = gel("loaderx");
lx = gel("loaderxx");
if (l.style){
l.style.position = "absolute";
l.style.top = "0px";
l.style.left = "0px";
l.style.width = document.body.offsetWidth + "px";
l.style.height = document.body.offsetHeight + "px";
l.style.backgroundColor = "#ffffff";
lx.style.position = "absolute";
lx.style.top = "0px";
lx.style.left = "0px";
lx.style.width = document.body.offsetWidth + "px";
if(l.filters){
l.style.filter = 'alpha(opacity=0)';
} else {
l.style.MozOpacity = 0.0;
l.style.opacity = 0.0;
}
l.style.display = "block"
lx.style.display = "block"
l.style.cursor = "wait";
}
}
function hideLoader(){
l = gel("loaderx");
lx = gel("loaderxx");
if (l.style){
l.style.display = "none";
lx.style.display = "none";
}
}
function makeRequest(url, returnFunction, type, postParams) {
stillLoading += 1;
if (stillLoading == 1){
showLoader();
}
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
// See note below about this line
}
}
if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = function() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
if (returnFunction){
//alert(http_request.responseText);
if (type == "textfunc"){
eval(returnFunction + '(http_request.responseText)');
} else if (type == "xmlfunc"){
eval(returnFunction + '(http_request.responseXML)');
} else if (type == "textid"){
gel(returnFunction).innerHTML = http_request.responseText;
} else {
eval(returnFunction + '(http_request.responseXML)');
}
} else {
//alert(http_request.Responsexml);
}
} else {
//alert(http_request.status + " => " + url);
}
stillLoading -= 1;
if (stillLoading == 0){
setTimeout("hideLoader()", 300);
}
}
};
if (postParams){
alert("IS POST:" + postParams.length);
http_request.open('POST', url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", postParams.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(postParams);
} else {
http_request.open('GET', url, true);
http_request.send(null);
}
}
// custom functions
function nwsSendMail(xml){
var mailMessage = "
" +
xml +
"
";
document.getElementById('mailForm').innerHTML = mailMessage;
}
function doShowHide(id){
if(gel(id).style.display == "none"){
document.getElementById(id).style.display = "block";
} else {
document.getElementById(id).style.display = "none";
}
}
var mmenu = [1,1274,1279,1276,1277,1278,22,1280,1275,1356,1282,1325,1361];
var lastsubmenu;
loc = window.location.href;
loc = loc.split("#");
var iddd;
loc = loc[1];
if (loc){
if (loc.substr(0,3) == "id="){
iddd = loc.substr(3);
}
}
if (iddd){
lastsubmenu = iddd;
} else {
lastsubmenu = parseInt();
}
function subMenuClicked(id){
subAll = document.getElementsByTagName("a");
for (i=0; i < subAll.length; i++){
if (subAll[i].id.substr(0,8) == "submenu_"){
subAll[i].className = "topmenusubinactive";
}
}
//gel("submenu_" + lastsubmenu).className = "topmenusubinactive";
gel("submenu_" + id).className = "topmenusubactive";
lastsubmenu = id
}
function topMenuClicked(pageId){
for (i = 0; i < mmenu.length; i++){
if (pageId == mmenu[i]){
gel("mainmenu_td_Eng_" + mmenu[i]).className = "topMenuMainBgActive";
gel("mainmenu_td_Alb_" + mmenu[i]).className = "topMenuMainBgActive";
gel("mainmenu_a_" + mmenu[i]).className = "topmenumainactive";
if (gel("menutopsub_" + mmenu[i])){
if (gel("menutopsub_" + mmenu[i]).style){
gel("menutopsub_" + mmenu[i]).style.display = 'block';
}
}
} else {
gel("mainmenu_td_Eng_" + mmenu[i]).className = "topMenuMainBg";
gel("mainmenu_td_Alb_" + mmenu[i]).className = "topMenuMainBg";
gel("mainmenu_a_" + mmenu[i]).className = "topmenumain";
if (gel("menutopsub_" + mmenu[i])){
if (gel("menutopsub_" + mmenu[i]).style){
gel("menutopsub_" + mmenu[i]).style.display = 'none';
}
}
}
}
}
function doActivateTab(tabIds, tabId){
//var tabIdr = split(',',tabIds);
tabIdr = tabIds.split(',');
for (i=0; i < tabIdr.length; i++){
if (tabIdr[i] != 0){
var tab = "tab_" + tabIdr[i];
document.getElementById(tab).style.borderBottom = '1px #ffffff solid';
}
}
var tabMain = "tab_" + tabId;
document.getElementById(tabMain).style.borderBottom = '0px';
document.getElementById('allTabs').innerHTML = "";
}
// newsletter func
function doChangeFontSize(idsArr, size){
idsArray = idsArr.split(',');
for (i=0; i < idsArray.length; i++){
document.getElementById(idsArray[i]).style.fontSize = size + "px";
}
}
function doSubscribe(emailError){
var email = document.getElementById('subscriberEmail').value;
if (email == ""){
alert(emailError);
return false;
}else{
var subscriptionUrl = "channels/newsletter/newsletterSubscribe.php?id=1," + category + "," + email;
makeRequest(subscriptionUrl, 'newsLetterIncluded', 'textid');
}
}
function doShowHideNewsletter(id){
document.getElementById('newsletterSubscribe').style.display = "none";
document.getElementById('newsletterDetails').style.display = "none";
document.getElementById('newsletterForm').style.display = "none";
document.getElementById(id).style.display = "block";
}
function doSetCategory(){
category = document.getElementById('categoryId').value;
doShowHideNewsletter('newsletterForm');
}
// end of newsletter func
// mail funkcione
function doSetEmailAsGlobal(email){
// e set up emailin si variabel globale
formEmail = email;
}
function doCreateMailRequest(newsId){
// e krijon requestin per me dergu mail
if (formEmail != ""){
var mailUrl = "channels/news/newsEmail.php?id=1," + newsId + "," + formEmail;
makeRequest(mailUrl, 'nwsSendMail', 'textfunc');
} else {
alert('Ju lutemi plotesoni email adresen!')
return false;
}
}
function doShowMailForm(newsId){
// paraqet formen per te pltesuar email adresen
var mailForm = "" +
"" +
"Email: " +
"" +
"" +
"
";
document.getElementById('mailForm').style.display = "block";
document.getElementById('mailForm').innerHTML = mailForm;
document.getElementById('sendToEmailAddress').focus();
}
function processStateChange(){
if (request.readyState == 4){
contentDiv = document.getElementById(dest);
if (request.status == 200){
response = request.responseText;
contentDiv.innerHTML = response;
} else {
contentDiv.innerHTML = "Error: Status "+request.status;
}
}
}
function loadHTML(URLPlus, destination, action){
cookieExpDate = new Date();
currentTime = new Date();
dest = destination;
newValue = document.getElementById('valueToAdd').value;
dateNow = currentTime.getDate() + "" + currentTime.getHours() + "" + currentTime.getMinutes() + "" + currentTime.getSeconds();
currDateCookie = cookieExpDate.getTime();
expdateCookie = currDateCookie + 3600*1000*24;
cookieExpDate.setTime(expdateCookie);
cookiecomp = "FBKCookie=poolfbk; expires ="+ cookieExpDate.toGMTString();
if (action == "vote"){
if (newValue == ""){
alert("Ju lutemi zgjidhni një opsion!");
return false;
} else if (document.cookie.indexOf('FBKCookie')!=-1){
alert("Keni të drejt të votoni vetëm njëherë!");
return false;
} else {
document.cookie = cookiecomp;
//alert(cookiecomp);
//document.cookie = "FBKCookie=poolfbk; expires=Tuesday, 30-Oct-2007 21:00:00 GMT";
}
URLPlus = URLPlus + "&optionValue=" + newValue + "&data=" + dateNow;
//alert(URLPlus);
} else if (action == "results") {
URLPlus = URLPlus + "&data=" + dateNow;
}
if (window.XMLHttpRequest){
request = new XMLHttpRequest();
request.onreadystatechange = processStateChange;
request.open("GET", URLPlus, true);
request.send(null);
} else if (window.ActiveXObject) {
request = new ActiveXObject("Microsoft.XMLHTTP");
if (request) {
request.onreadystatechange = processStateChange;
request.open("GET", URLPlus, true);
request.send();
}
}
}
function doGetValue(radioValue){
selectedValue = radioValue;
document.getElementById('valueToAdd').value = selectedValue;
}
function doClose(id){
document.getElementById(id).style.display = "none";
}
function doRedirect(){
document.window.location = "?id=4,0,0,1,a";
}
function doShowHidePlanprogrami(id){
var obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "block";
} else {
obj.style.display = "none";
}
}
function doCheckPlanprogrami(oppenedId,subOppenedId,myId){
if (oppenedId != ""){
document.getElementById(oppenedId).style.display = "block";
}
if (subOppenedId != ""){
document.getElementById(subOppenedId).style.display = "block";
}
if (myId != ""){
document.getElementById(myId).style.fontWeight = "bold";
}
}
var userAgent = navigator.userAgent.toLowerCase();
var isInternetExplorer = false;
if (document.all && userAgent.indexOf('msie')!=-1) {
isInternetExplorer = true;
}
if (isInternetExplorer) {
document.write("");
}
function loadComments(attribs, doPost){
makeRequest("http://www.jetanekosove.com/advCms/channels/video/videoDescription.php" + attribs + "&id=" + lastUrlId, 'videoDescription', 'textid', doPost);
}
function loadBookmarks(attribs, doPost){
makeRequest("http://www.jetanekosove.com/advCms/channels/video/videoBookmarks.php" + attribs + "&id=" + lastUrlId, 'videoBookmarks', 'textid', doPost);
}
function loadRatings(attribs, doPost){
makeRequest("http://www.jetanekosove.com/advCms/channels/rate.php" + attribs + "&id=" + lastUrlId, 'setNewRate', 'xmlfunc', doPost);
}
lastVideoActive = 0;
function playVideoIfNone(obj,id, moduleName, vTitle, vPageId){
document.lastVideoId = 0;
document.currentVideoId = 0;
if (a = window.location.hash.match(/id=([0-9]*),([0-9]*)/)){
if (a[2]){
if (obj2 = gel("video_" + a[2])){
playVideo(obj2, a[2], moduleName, '', vPageId);
return;
}
}
}
playVideo(obj, id, moduleName, vTitle, vPageId);
}
function playVideo(obj, id, moduleName, vTitle, vPageId, skipComments){
obj = gel("video_" + id);
//inc/newsComments.php?videoId=
gel("smallVideoOptions").innerHTML = "";
if (moduleName != 'search'){
if (document.lastVideoId){
gel("video_" + document.lastVideoId).className = "videoBoxInactive";
gel("video_arrow_" + document.lastVideoId).src = "http://www.jetanekosove.com/advCms/img/sys/spacer.gif";
}
if (obj){
obj.className = "videoBoxActive";
}
imgObj = gel("video_arrow_" + id);
if (moduleName == 'categories'){
imgObj.src = "http://www.jetanekosove.com/advCms/img/sys/videoBoxBgAArrowInverse.gif";
} else {
imgObj.src = "http://www.jetanekosove.com/advCms/img/sys/videoBoxBgAArrow.gif";
}
} else {
gel("smallVideoTitle").innerHTML = "" + vTitle + "";;
gel("videoMore").innerHTML = "Më shumë";
if (vPageId){
gel("smallVideoOptions").innerHTML = "more";
}
}
if (document.currentVideoId != id){
if (moduleName == "main"){
makeRequest("http://www.jetanekosove.com/advCms/channels/video/videoCommentsSmall.php?id=" + lastUrlId + "&videoPath=" + id + "&skipComments=" + skipComments, 'videoCommentsSmall', 'textid');
if (vPageId){
gel("smallVideoTitle").innerHTML = "" + vTitle + "";;
gel("videoMore").innerHTML = "Më shumë";;
} else {
gel("smallVideoTitle").innerHTML = vTitle;
gel("videoMore").innerHTML = " ";
}
}
if (a = window.location.hash.match(/id\=([0-9]*)/)){
newHash = a[1] + "," + id;
//window.location.hash = "testy";
lastUrlId = newHash;
window.location.hash = "#id=" + newHash;
}
if (fObj = document.getElementById("postVideoComments")){
u = '';
fObj.innerHTML = u;
}
if (document.getElementById("videoDescription")){
loadComments("?videoPath=" + id);
}
if (document.getElementById("videoKeywords")){
loadBookmarks("?videoPath=" + id);
}
if (document.getElementById("ratings")){
loadRatings("?objectId=" + id + "&channelId=40");
}
}
document.lastVideoId = id;
document.currentVideoId = id;
tryToLoad();
}
function tryToLoad(){
loadVideo();
return;
}
function getVideoId(){
vid = document.vfObj[document.callBack](toXml("videoPlayer", "getCurrentVideo", ""));
if (vid){
if (vid.id){
return vid.id;
}
}
return;
}
function loadVideo(){
vObj = gel("videoObject");
w = vObj.attributes.videoObjectWidth.value;
h = vObj.attributes.videoObjectHeight.value;
vObj.innerHTML = '';
if (false){
if (document.lastPlayVideo == document.currentVideoId){
isPlaying = document.vfObj[document.callBack](toXml("videoPlayer", "isPlaying", ""));
if (isPlaying == true){
document.vfObj[document.callBack](toXml("videoPlayer", "pause", ""));
//alert("pause");
} else {
document.vfObj[document.callBack](toXml("videoPlayer", "play", ""));
//alert("play");
}
document.lastPlayVideo = document.currentVideoId;
document.lastCueVideo = 0;
} else if (document.lastCueVideo == document.currentVideoId){
document.vfObj[document.callBack](toXml("videoPlayer", "loadVideo", document.currentVideoId));
document.vfObj[document.callBack](toXml("videoPlayer", "play", ""));
document.lastPlayVideo = document.currentVideoId;
document.lastCueVideo = 0;
//alert("load/play");
} else {
if (document.lastPlayVideo){
document.vfObj[document.callBack](toXml("videoPlayer", "stop", ""));
//alert("stop");
}
document.vfObj[document.callBack](toXml("videoPlayer", "cueVideo", document.currentVideoId));
document.lastCueVideo = document.currentVideoId;
document.lastPlayVideo;
//alert("cue");
}
}
}
document.callBack;
document.vfObj;
function getFlashMovie(movieName) {
//alert("getFlashMovie(" + movieName + ")");
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[movieName] : document[movieName];
}
function onTemplateLoaded(experienceID) {
//alert("templateloaded");
}
function videoLoaded(vid){
//alert("smth is loaded");
}
function setAPICallback(pID,pCallback){
p = pCallback.split("|");
document.callBack=p[3];
document.vfObj = getFlashMovie(pID);
}
function toXml(module, method, param){
arrparams = "";
if (param){
arrparams = "" + param + "";
}
str = "" + module + "" + method + "" + arrparams + "";
return str;
}
function doShowHideRss(id, cntt){
var titleName = cntt + "_title_" + id;
var contentName = cntt + "_content_" + id;
if (document.getElementById(contentName).style.display == "none"){
document.getElementById(contentName).style.display = "block";
//document.getElementById(titleName).style.fontWeight = "bold";
} else {
document.getElementById(contentName).style.display = "none";
document.getElementById(titleName).style.fontWeight = "normal";
}
}
function urlencode( str ) {
// http://kevin.vanzonneveld.net
// + original by: Philip Peterson
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + input by: AJ
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Brett Zamir (http://brett-zamir.me)
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + input by: travc
// + input by: Brett Zamir (http://brett-zamir.me)
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Lars Fischer
// % note 1: info on what encoding functions to use from: http://xkr.us/articles/javascript/encode-compare/
// * example 1: urlencode('Kevin van Zonneveld!');
// * returns 1: 'Kevin+van+Zonneveld%21'
// * example 2: urlencode('http://kevin.vanzonneveld.net/');
// * returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F'
// * example 3: urlencode('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['%20'] = '+';
histogram['\u00DC'] = '%DC';
histogram['\u00FC'] = '%FC';
histogram['\u00C4'] = '%D4';
histogram['\u00E4'] = '%E4';
histogram['\u00D6'] = '%D6';
histogram['\u00F6'] = '%F6';
histogram['\u00DF'] = '%DF';
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 tryToRate(rate){
for (i=0; i <= 10; i++){
s = gel("star_" + i);
if (i % 2){
side = "L";
} else {
side = "R";
}
if (i <= rate){
active = "1";
} else {
active = "0";
}
thisClass = "star " + side + active;
s.className = thisClass;
}
}
var currentVideoRate = 5;
function doRate(rate){
loadRatings("?objectId=" + document.currentVideoId + "&channelId=40&rate=" + rate);
}
function setNewRate(xml){
currentVideoRate = xml.childNodes[0].childNodes[0].childNodes[0].nodeValue;
users = xml.childNodes[0].childNodes[1].childNodes[0].nodeValue;
restoreRate();
}
function restoreRate(){
rate = currentVideoRate;
for (i=0; i <= 10; i++){
s = gel("star_" + i);
if (i % 2){
side = "L";
} else {
side = "R";
}
if (i <= rate){
active = "1";
} else {
active = "0";
}
thisClass = "star " + side + active;
s.className = thisClass;
}
}
var ts1;
var lastObj;
function scrollDivTo(scrollToId){
ts1 = document.getElementById('tableS1')
if (!ts1.sc){
ts1.sc = 0;
}
obj = document.getElementById('divScrollButton_' + scrollToId)
obj.className = 'numberButtonActive';
if (lastObj){
if (lastObj != obj){
lastObj.className = 'numberButton';
}
}
lastObj = obj;
document.scrollToId = parseInt(scrollToId) * 293;
doDivScrolling();
}
function doDivScrolling(){
ts1.sc += (document.scrollToId - ts1.sc) * 0.05;
if (Math.abs(ts1.scrollLeft - document.scrollToId) < 1){
ts1.scrollLeft = document.scrollToId;
} else {
setTimeout("doDivScrolling()", 10);
}
ts1.scrollLeft = ts1.sc;
}
var lastVideoMainTab;
var lastVideoMainTabButton;
function openVideoMainTab(tabName){
obj = document.getElementById("videoMainTab_" + tabName);
objB = document.getElementById("videoMainTabButton_" + tabName);
if (lastVideoMainTab){
lastVideoMainTab.style.display = 'none';
lastVideoMainTabButton.className = 'tabNotActive';
}
obj.style.display = 'block';
objB.className = 'tabActive';
lastVideoMainTab = obj;
lastVideoMainTabButton = objB;
}
var searchBy = "web";
function doSearch(){
keyword = gel('searchByKeyword').value;
if (document.lastSearchActiveId == 'all'){
searchBy = 'all'
} else if (document.lastSearchActiveId == 'video'){
searchBy = 'video'
} else if (document.lastSearchActiveId == 'web'){
searchBy = 'web'
}
searchUrl = "#id=1281,82," + searchBy + "," + encodeURIComponent(keyword);
window.location = searchUrl;
}
document.lastSearchAct;
function activateSearch(id){
obj = gel("search_" + id);
obj.className = "searchBtnAct";
if (document.lastSearchActiveId){
obj2 = gel("search_" + document.lastSearchActiveId);
obj2.className = "searchBtnInAct";
}
document.lastSearchActiveId = id;
}
function loadTwitterFlash(lang){
if (lang == "Eng"){
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '592',
'height', '30',
'src', 'twitt_en',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'wmode', 'transparent',
'scale', 'showall',
'devicefont', 'false',
'id', 'twitt_en',
'bgcolor', '#ffffff',
'name', 'twitt_en',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'twitt_en',
'salign', '',
'documentobject', 'twitterHolder'
); //end AC code
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '592',
'height', '30',
'src', 'twitt',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'wmode', 'transparent',
'scale', 'showall',
'devicefont', 'false',
'id', 'twitt',
'bgcolor', '#ffffff',
'name', 'twitt',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'twitt',
'salign', '',
'documentobject', 'twitterHolder'
); //end AC code
}
}
///USER LOGIN MODULE///
function doSubmitLogin(){
user = gel('userUsername');
pass = gel('userPassword');
if (user.value && pass.value){
//alert(user.value +'-'+ pass.value);
vars = "?userUsername=" + user.value + "&userPassword=" + pass.value;
pass.value = "";
makeRequest('http://www.jetanekosove.com/advCms//userLogin.php' + vars, 'doSubmitLoginResponse', 'textfunc');
}
}
function doSubmitLoginResponse(txt){
if (txt == "LOGGEDIN"){
//makeRequest('http://www.jetanekosove.com/advCms/channels/brainGain/userInfo.php', "userBody2", "textid");
makeRequest("inc/header.php", "headerHolder", "textid");
//location.href='?';
getPageFinal(1325);
} else {
alert("wrong username or password");
//alert(txt);
}
}
function logoutUser(){
vars = "?action=logout";
makeRequest('http://www.jetanekosove.com/advCms//userLogin.php' + vars, 'logoutUserDone', 'textfunc');
}
function logoutUserDone(){
alert("__");
makeRequest('http://www.jetanekosove.com/advCms//channels/brainGain/userInfo.php', "userBody2", "textid");
//makeRequest("inc/menutop.php", "topmenu", "textid");
}
function closeModalWindow(){
$('#dialog').jqmHide();
}