// // Common Javascript Functions // (c) Copyright, 2008 // Batelco Jordan // mnuaimat@batelco.jo // June 2008 // // Updates -<>- mnuaimat function in_array(arr,p_val) { for(var i = 0; i < arr.length; i++) { if(arr[i] == p_val) { return true; } } return false; } function search_array(arr,p_val) { for(var i = 0; i < arr.length; i++) { if(arr[i] == p_val) { return i; } } return false; } function remove_element (arr,s){ for(var i = 0; i < arr.length; i++) if(s==arr[i]) arr.splice(i, 1); } var Base64 = { // private property _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", // public method for encoding encode : function (input) { var output = ""; var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; input = Base64._utf8_encode(input); while (i < input.length) { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } return output; }, // public method for decoding decode : function (input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } output = Base64._utf8_decode(output); return output; }, // private method for UTF-8 encoding _utf8_encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // private method for UTF-8 decoding _utf8_decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } /************************************************************************************************************ (C) www.dhtmlgoodies.com, January 2006 This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website. Terms of use: You are free to use this script as long as the copyright message is kept intact. However, you may not redistribute, sell or repost it without our permission. Thank you! www.dhtmlgoodies.com Alf Magne Kalleland ************************************************************************************************************/ var rectangleBorderWidth = 2; // Used to set correct size of the rectangle with red dashed border var useRectangle = true; var autoScrollSpeed = 0; // Autoscroll speed - Higher = faster /* Don't change anything below here */ var dragableElementsParentBox; var opera = navigator.appVersion.indexOf('Opera')>=0?true:false; var rectangleDiv = true; var insertionMarkerDiv = false; var mouse_x; var mouse_y; var el_x; var el_y; var dragDropTimer = -1; // -1 = no drag, 0-9 = initialization in progress, 10 = dragging var dragObject = false; var dragObjectNextObj = false; var dragableObjectArray = new Array(); var destinationObj = false; var currentDest = false; var allowRectangleMove = true; var insertionMarkerLine; var dragDropMoveLayer; var autoScrollActive = false; var documentHeight = false; var documentScrollHeight = false; var dragableAreaWidth = false; function getTopPos(inputObj) { var returnValue = inputObj.offsetTop; while((inputObj = inputObj.offsetParent) != null){ if(inputObj.tagName!='HTML')returnValue += inputObj.offsetTop; } return returnValue; } function getLeftPos(inputObj) { var returnValue = inputObj.offsetLeft; while((inputObj = inputObj.offsetParent) != null){ if(inputObj.tagName!='HTML')returnValue += inputObj.offsetLeft; } return returnValue; } function cancelSelectionEvent() { if(dragDropTimer>=0)return false; return true; } function getObjectFromPosition(x,y) { var height = dragObject.offsetHeight; var width = dragObject.offsetWidth; var indexCurrentDragObject=-5; for(var no=0;no ref['left'] && y>ref['top'] && x<(ref['left'] + (ref['width']/2)) && y<(ref['top'] + ref['height'])){ if(!useRectangle && dragableObjectArray[no]['obj']==dragObject)return 'self'; if(indexCurrentDragObject==(no-1))return 'self'; return Array(dragableObjectArray[no],no); } if(x > (ref['left'] + (ref['width']/2)) && y>ref['top'] && x<(ref['left'] + ref['width']) && y<(ref['top'] + ref['height'])){ if(no (ref['left'] + ref['width']) && y>ref['top'] && y<(ref['top'] + ref['height']) && yref['left'] && y>(ref['top'] + ref['height']))return 'append'; return false; } function initDrag(e) { if(document.all)e = event; mouse_x = e.clientX; mouse_y = e.clientY; if(!documentScrollHeight)documentScrollHeight = document.documentElement.scrollHeight + 100; el_x = getLeftPos(this)/1; el_y = getTopPos(this)/1; dragObject = this; if(useRectangle){ rectangleDiv.style.width = this.clientWidth - (rectangleBorderWidth*2) +'px'; rectangleDiv.style.height = this.clientHeight - (rectangleBorderWidth*2) +'px'; rectangleDiv.className = this.className; }else{ insertionMarkerLine.style.width = '6px'; } dragDropTimer = 0; dragObjectNextObj = false; if(this.nextSibling){ dragObjectNextObj = this.nextSibling; if(!dragObjectNextObj.tagName)dragObjectNextObj = dragObjectNextObj.nextSibling; } initDragTimer(); return false; } function initDragTimer() { if(dragDropTimer>=0 && dragDropTimer<10){ dragDropTimer++; setTimeout('initDragTimer()',5); return; } if(dragDropTimer==10){ if(useRectangle){ dragObject.style.opacity = 0.5; dragObject.style.filter = 'alpha(opacity=50)'; dragObject.style.cursor = 'default'; }else{ var newObject = dragObject.cloneNode(true); dragDropMoveLayer.appendChild(newObject); } } } function autoScroll(direction,yPos) { if(document.documentElement.scrollHeight>documentScrollHeight && direction>0)return; window.scrollBy(0,direction); if(direction<0){ if(document.documentElement.scrollTop>0){ mouse_y = mouse_y - direction; if(useRectangle){ dragObject.style.top = (el_y - mouse_y + yPos) + 'px'; }else{ dragDropMoveLayer.style.top = (el_y - mouse_y + yPos) + 'px'; } }else{ autoScrollActive = false; } }else{ if(yPos>(documentHeight-50)){ mouse_y = mouse_y - direction; if(useRectangle){ if(dragObject && dragObject.style) dragObject.style.top = (el_y - mouse_y + yPos) + 'px'; }else{ dragDropMoveLayer.style.top = (el_y - mouse_y + yPos) + 'px'; } }else{ autoScrollActive = false; } } if(autoScrollActive)setTimeout('autoScroll('+direction+',' + yPos + ')',5); } function moveDragableElement(e) { if(document.all)e = event; if(dragDropTimer<10)return; if(!allowRectangleMove)return false; if(e.clientY<50 || e.clientY>(documentHeight-50)){ if(e.clientY<50 && !autoScrollActive){ autoScrollActive = true; autoScroll((autoScrollSpeed*-1),e.clientY); } if(e.clientY>(documentHeight-50) && document.documentElement.scrollHeight<=documentScrollHeight && !autoScrollActive){ autoScrollActive = true; autoScroll(autoScrollSpeed,e.clientY); } }else{ autoScrollActive = false; } if(useRectangle){ if(dragObject.style.position!='absolute'){ dragObject.style.position = 'absolute'; setTimeout('repositionDragObjectArray()',50); } } if(useRectangle){ rectangleDiv.style.display='block'; }else{ insertionMarkerDiv.style.display='block'; dragDropMoveLayer.style.display='block'; } if(useRectangle){ dragObject.style.left = (el_x - mouse_x + e.clientX + Math.max(document.body.scrollLeft,document.documentElement.scrollLeft)) + 'px'; dragObject.style.top = (el_y - mouse_y + e.clientY) + 'px'; }else{ dragDropMoveLayer.style.left = (el_x - mouse_x + e.clientX + Math.max(document.body.scrollLeft,document.documentElement.scrollLeft)) + 'px'; dragDropMoveLayer.style.top = (el_y - mouse_y + e.clientY) + 'px'; } dest = getObjectFromPosition(e.clientX+Math.max(document.body.scrollLeft,document.documentElement.scrollLeft),e.clientY+Math.max(document.body.scrollTop,document.documentElement.scrollTop)); if(dest!==false && dest!='append' && dest!='self'){ destinationObj = dest[0]; if(currentDest!==destinationObj){ currentDest = destinationObj; if(useRectangle){ destinationObj['obj'].parentNode.insertBefore(rectangleDiv,destinationObj['obj']); repositionDragObjectArray(); }else{ if(dest[1]>0 && (dragableObjectArray[dest[1]-1]['obj'].offsetLeft + dragableObjectArray[dest[1]-1]['width'] + dragObject.offsetWidth) < dragableAreaWidth){ insertionMarkerDiv.style.left = (getLeftPos(dragableObjectArray[dest[1]-1]['obj']) + dragableObjectArray[dest[1]-1]['width'] + 2) + 'px'; insertionMarkerDiv.style.top = (getTopPos(dragableObjectArray[dest[1]-1]['obj']) - 2) + 'px'; insertionMarkerLine.style.height = dragableObjectArray[dest[1]-1]['height'] + 'px'; }else{ insertionMarkerDiv.style.left = (getLeftPos(destinationObj['obj']) - 8) + 'px'; insertionMarkerDiv.style.top = (getTopPos(destinationObj['obj']) - 2) + 'px'; insertionMarkerLine.style.height = destinationObj['height'] + 'px'; } } } } if(dest=='self' || !dest){ insertionMarkerDiv.style.display='none'; destinationObj = dest; } if(dest=='append'){ if(useRectangle){ dragableElementsParentBox.appendChild(rectangleDiv); dragableElementsParentBox.appendChild(document.getElementById('clear')); }else{ var tmpRef = dragableObjectArray[dragableObjectArray.length-1]; insertionMarkerDiv.style.left = (getLeftPos(tmpRef['obj']) + 2) + tmpRef['width'] + 'px'; insertionMarkerDiv.style.top = (getTopPos(tmpRef['obj']) - 2) + 'px'; insertionMarkerLine.style.height = tmpRef['height'] + 'px'; } destinationObj = dest; repositionDragObjectArray(); } if(useRectangle && !dest){ destinationObj = currentDest; } allowRectangleMove = false; setTimeout('allowRectangleMove=true',50); } function stop_dragDropElement() { dragDropTimer = -1; if(destinationObj && destinationObj!='append' && destinationObj!='self'){ destinationObj['obj'].parentNode.insertBefore(dragObject,destinationObj['obj']); } if(destinationObj=='append'){ dragableElementsParentBox.appendChild(dragObject); dragableElementsParentBox.appendChild(document.getElementById('clear')); } if(dragObject && useRectangle){ dragObject.style.opacity = 1; dragObject.style.filter = 'alpha(opacity=100)'; dragObject.style.cursor = 'move'; dragObject.style.position='static'; } rectangleDiv.style.display='none'; insertionMarkerDiv.style.display='none'; dragObject = false; currentDest = false; resetObjectArray(); destinationObj = false; if(dragDropMoveLayer){ dragDropMoveLayer.style.display='none'; dragDropMoveLayer.innerHTML=''; } autoScrollActive = false; documentScrollHeight = document.documentElement.scrollHeight + 100; saveData(); } function cancelEvent() { return false; } function repositionDragObjectArray() { for(var no=0;no0)saveString = saveString + '|'; ref = dragableObjectArray[no]; saveString = saveString + ref['obj'].id; } //console.log(saveString); //alert(saveString); // For demo only createCookie_exact_name("alarabalyawm_hp_box_sort",saveString,15); /* Put this item into a hidden form field and then submit the form example: document.forms[0].itemOrder.value = saveString; document.forms[0].submit; On the server explode the values by use of server side script. Then update your database with the new item order */ } function resetArrangement(){ createCookie_exact_name("alarabalyawm_hp_box_sort","",-3); } function initdragableElements() { dragableElementsParentBox = document.getElementById('dragableElementsParentBox'); insertionMarkerDiv = document.getElementById('insertionMarker'); insertionMarkerLine = document.getElementById('insertionMarkerLine'); dragableAreaWidth = dragableElementsParentBox.offsetWidth; if(!useRectangle){ dragDropMoveLayer = document.createElement('DIV'); dragDropMoveLayer.id = 'dragDropMoveLayer'; document.body.appendChild(dragDropMoveLayer); } var subDivs = dragableElementsParentBox.getElementsByTagName('*'); var countEl = 0; for(var no=0;no0;i--){ if(!cook) continue; rval = Base64.decode(cook); if(!rval) continue; rval = rval.split("-=-=-=-"); href2 = rval[0]; title2 = rval[1]; if(href2 == href && title2.length > 0){ setTimeout("probeFavouritesArea()",500); return;} } var linkstr = href+"-=-=-=-"+title; linkstr = Base64.encode(linkstr); createCookie("fav",linkstr,30); setTimeout("probeFavouritesArea()",500); } function js_trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function createCookie(name,value,days) { if(!days || days && days > 0){ // otherwise it would be deleting name += ++cookieCounter; name += "_"+current_issue_date; } name = js_trim(name); if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function createCookie_exact_name(name,value,days) { name = js_trim(name); if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { cookieCounter = document.cookie.split(';').length; createCookie(name,"",-1); } function probeFavouritesArea(){ if(!IE6){ if(fade != null && fade.state != 1){ setTimeout("probeFavouritesArea()",50); return; } } somethingIsMoving = false; if(flyingElement != null) flyingElement.style.visibility = "hidden"; mystr = ""; cookiesArr = document.cookie.split(';'); innerStr = ""; cookiesArr.reverse(); var validCookiesCounter = 0; for(var i in cookiesArr){ cname = cookiesArr[i]; cookie2 = cookiesArr[i].split("="); cookiename = js_trim(cookie2[0]); if(!cookiename.match("fav[0-9]*")) continue; cook = readCookie(cookiename); if(!cook) continue; rval = Base64.decode(cook); if(!rval) continue; rval = rval.split("-=-=-=-"); href = rval[0]; title = rval[1]; validCookiesCounter++; innerStr += ""; } if(innerStr.length == 0){ // no cookies yet innerStr += ""; //$element("fav_title_area").innerHTML="بامكانك اضافة اخبارك المفضلة هنا"; $("#fav_title_area").find(".box_clickable").html("بامكانك اضافة اخبارك المفضلة هنا"); } else { innerStr += ""; //$element("fav_title_area").innerHTML="اخباري المفضلة  "+validCookiesCounter+""; $("#fav_title_area").find(".box_clickable").html("اخباري المفضلة  "+validCookiesCounter+""); } mystr += innerStr; mystr += "
"+title+" حذف
بامكانك اضافة اخبار وموضوعات الى هنا ، استخدم الرمز
حذف الكل
"; $element("fav_area").innerHTML = mystr; } function $element(n){ return document.getElementById(n); } function rem_click_fav(id){ xcoll(id+"_tr"); eraseCookie(id); probeFavouritesArea(); } function xcoll(eid){ $("#"+eid).hide('slow'); } function getY( oElement ) { var iReturnValue = 0; while( oElement != null ) { iReturnValue += oElement.offsetTop; oElement = oElement.offsetParent; } return iReturnValue; } function getX( oElement ) { var iReturnValue = 0; while( oElement != null ) { iReturnValue += oElement.offsetLeft; oElement = oElement.offsetParent; } return iReturnValue; } function eraseAll(){ cookiesArr = document.cookie.split(';'); for(i in cookiesArr){ cookie2 = cookiesArr[i].split("="); cookiename = cookie2[0]; if(cookiename.match("fav[0-9]*")){ eraseCookie(cookiename); } } } //on each load of the page function initalize(){ if($element("fav_area") != null) probeFavouritesArea(); else setTimeout("initalize()",100); } /*******************************************************************************************/ // Animation styles used in Magic ///////////////////////////////////////////// function styleLinear(x) { return x; } function styleSin(x) { return Math.sin(x*Math.PI/2); } function stylePulse(x) { return (Math.sin(x*2*Math.PI) + 1) / 2; } function styleBounce(x) { return (x == 0) ? 0 : (((-Math.sin(x*25)/(x*25))+1)*(1-x))+x; } function styleBounceLess(x) { return (x == 0) ? 0 : (((-Math.sin(x*15)/(x*15))+1)*(1-x))+x; } function styleBounceMore(x) { return (x == 0) ? 0 : (((-Math.sin(x*35)/(x*35))+1)*(1-x))+x; } // Magic Animation Core /////////////////////////////////////////////////////// magic = new function () { this.effects = []; this.interval; this.frequency = 30; this.remove = function(effect) { var i = 0; while (i < this.effects.length) if (this.effects[i] == effect) this.effects.splice(i, 1); else i++; if (this.effects.length == 0) window.clearInterval(this.interval); } this.tick = function() { for (var i=0; i 0) { this.ticksToStart--; return; } if (this.now > 100) { if (this.loop) this.now = 0; else { magic.remove(this); if (this.endAction != undefined) this.endAction(); } } else { if (typeof elementId == 'string' && document.getElementById(elementId) == null) { magic.remove(this); return; } this.action(); if (this.coAction != undefined) this.coAction(); this.now += this.speed; if (this.now > 100) this.now = 101; } } magic.add(this); } // Magic Effects ///// function changeNumber(element, what, suffix, value1, value2, speed, ticksToStart, style, loop, coAction, endAction) { action = function() { this.element.style[this.what] = Math.round(this.value1 + this.style(this.now/100)*(value2-value1)) + suffix; } effect = new effectObject(element, ticksToStart, speed, action, style, loop, coAction, endAction); effect.element = (typeof element == 'string') ? document.getElementById(element) : element; effect.what = what; effect.value1 = value1; effect.value2 = value2; } function fade(element, opacity1, opacity2, speed, ticksToStart, style, loop, coAction, endAction) { action = function() { this.element.style.opacity = this.opacity1 + this.style(this.now/100) * (this.opacity2-this.opacity1); this.element.style.filter = "alpha(opacity=" + this.element.style.opacity*100 + ")"; } effect = new effectObject(element, ticksToStart, speed, action, style, loop, coAction, endAction); effect.element = (typeof element == 'string') ? document.getElementById(element) : element; effect.opacity1 = opacity1; effect.opacity2 = opacity2; } function move(element, top1, left1, top2, left2, speed, ticksToStart, style, loop, coAction, endAction) { changeNumber(element, "top", "px", top1, top2, speed, ticksToStart, style, loop, coAction, endAction); changeNumber(element, "left", "px", left1, left2, speed, ticksToStart, style, loop); } function scale(element, width1, height1, width2, height2, speed, ticksToStart, style, loop, coAction, endAction) { changeNumber(element, "width", "px", width1, width2, speed, ticksToStart, style, loop, coAction, endAction); changeNumber(element, "height", "px", height1, height2, speed, ticksToStart, style, loop); } function morph(element1, element2, width1, height1, width2, height2, speed, ticksToStart, style, loop, coAction, endAction) { scale(element1, width1, height1, width2, height2, speed, ticksToStart, style, loop, coAction, endAction); scale(element2, width1, height1, width2, height2, speed, ticksToStart, style, loop); fade(element1, 1, 0, speed, ticksToStart, style, loop); fade(element2, 0, 1, speed, ticksToStart, style, loop); } function image_text(idindex) { var imagename = image[idindex]; //document.masterimage.src = "image/" + imagename; var srcc = imagename; blendimage('blenddiv','blendimage', srcc, 800); } function changecolor(idindex) { if(mytime != null) clearTimeout(mytime); var ids = "f" + (idindex); $("#top_news_rasterize").html('
 

'); $("#main_news_icons_table").find(".dc").removeClass("dc").addClass("dd"); $("#mainnewsid").html(sumtext[idindex-1]); $("#slidetitle").html(""+slidtitel[idindex-1]+""); var newxtid = ((idindex + 1) % (document.getElementById("main_news_icons_table").rows.length+1)); var this_image = idindex - 1; //image_text(this_image); var imagename = image[this_image]; var srcc = imagename; var ids = "f" + (idindex); document.getElementById(ids).className = "dc"; if(idindex == 1 ){ document.getElementById(ids).style.borderTop = "none"; } if( idindex == links.length ){ document.getElementById(ids).style.borderBottom = "none"; } /* for(i=0;i
' ); if(mnews_captions[idindex-1] != null && mnews_captions[idindex-1].length > 0) $("#mbox_caption").html(mnews_captions[idindex-1]); else $("#mbox_caption").html(slidtitel[idindex-1]); //$("#mbox_caption").css("display","none"); $("#photo_link").attr("href",links[idindex-1]); $("#blendimage").attr("alt",slidtitel[idindex-1]); $("#blendimage").attr("title",slidtitel[idindex-1]); } function set_thum_image(imindex) { imindex = imindex - 1; var imagethum = "image" + (imindex+1); document.getElementById(imagethum).src = image_thum[imindex+1]; } function blendimage(divid, imageid, imagefile, millisec) { var speed = Math.round(millisec / 100); var timer = 0; //set the current image as background document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; //make image transparent // changeOpac(0, imageid); //make new image document.getElementById(imageid).src = imagefile; //fade in image for(i = 0; i <= 100; i++) { setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); timer++; } } function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers /*function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; }*/ function shiftOpacity(id, millisec) { //if an element is invisible, make it visible, else make it ivisible if(document.getElementById(id).style.opacity == 0) { opacity(id, 0, 100, millisec); } else { opacity(id, 100, 0, millisec); } } function currentOpac(id, opacEnd, millisec) { //standard opacity is 100 var currentOpac = 100; //if the element has an opacity set, get it if(document.getElementById(id).style.opacity < 100) { currentOpac = document.getElementById(id).style.opacity * 100; } //call for the function that changes the opacity opacity(id, currentOpac, opacEnd, millisec) } var clockID = 0; function UpdateClock() { if(clockID) { clearTimeout(clockID); clockID = 0; } var tDate = new Date(); if($("#theClock")) $("#theClock").html( "" + tDate.getHours() + ":" + tDate.getMinutes() + ":" + tDate.getSeconds() ); clockID = setTimeout("UpdateClock()", 1000); } function checkMySection(formObj, chkValue) { var len = Number(formObj.length); for (var i=0;i0;i--){ cook = readCookie("fav"+i); if(!cook) continue; rval = Base64.decode(cook); if(!rval) continue; rval = rval.split("-=-=-=-"); href2 = rval[0]; title2 = rval[1]; existingFavs[cookiecccCounter++] = href2; } $("a.fav_link").each(function(){ for(j in existingFavs){ cLink = existingFavs[j]; aLink = $(this).attr('href'); exactLink = aLink.substr('javascript:js_add_to_fav("'.length); exactLink = exactLink.substr(0,exactLink.indexOf('"')); if(exactLink == cLink ) $(this).css("display","none"); } }); $("a.lightbox0").lightBox(); $("a.lightbox1").lightBox(); $("a.top_drop_handler").toggle( function(){ $(".alarabalyawm_slide_down_checkboxes").each(function(){$(this).attr("checked",true)}); for(j in deletedBoxesArray){ dn = deletedBoxesArray[j]; if($("#"+dn+"_checkbox").length > 0 ){ $("#"+dn+"_checkbox").attr("checked",false); } } if($.browser.msie) $(".top_banner_holder").css({display: "none"}); $(".top_drop_container").animate({ top: '0px', opacity: 0.8 }, 800 ); }, function(){ $(".top_drop_container").animate({ top: '-248px', opacity: 0.4 }, 800 ,function(){ if($.browser.msie) $(".top_banner_holder").css({display: ""}) }); } ); if(IE6) $(".horiz_div").css("padding-top","3px"); UpdateClock(); getMaxDragListLength(); initalize(); $(".box_container").hover(function(){ $(this).find(".box_delete_handler").animate({ opacity: 1.0 }); }, function(){ $(this).find(".box_delete_handler").animate({ opacity: 0 }); }); //$("li.most_2").click(); //$("li.most_1").click(); if($("#TabbedPanels1").length > 0) setTimeout("for(j=0;j<=2;j++){TabbedPanels1.showPanel(j);}TabbedPanels1.showPanel(0);",1000); $("#sections_save_options").click(function(){ deletedBoxesArray.length = 0; $('.sections_checkbox_selector :checkbox').each(function(){ if($(this).attr("checked") == false) deletedBoxesArray.push($(this).val()); }); //console.log(deletedBoxesArray); createCookie_exact_name("deleted_boxes",deletedBoxesArray.join("|"),365); window.location.reload(); }); $("#sections_cancel_options").click(function(){ $("a.top_drop_handler").click(); }); $("#sections_reset_options").click(function(){ cookies_arr = document.cookie.split(";"); for(co in cookies_arr){ co2 = cookies_arr[co].split("=")[0]; if(co2 != "PHPSESSID") createCookie(co2,"",-1); } window.location.reload(); }); } ); function delete_box(title2){ title = title2.substring(title2.indexOf("_")+1); $(".box_clickable").each(function(){ if($(this).html() == title){ var thisnode = $(this); $(this).parents("div.box_container").fadeOut("slow",function(){ did=thisnode.parents("div.box_container").attr("id"); if(!in_array(deletedBoxesArray,did)){ deletedBoxesArray[deletedBoxesArray.length]=did; prepare_serialize_del(deletedBoxesArray); } thisnode.parents("li").remove(); getMaxDragListLength(); }); } }); } function getMaxDragListLength(){ vmax = 0; maxelements = 0; minelements = 2000; telem = null; // tallest element selem = null; // shortest elements $("ul.draglist").each(function(){ $(this).css("padding-bottom","30px"); if($(this) .children().size() < minelements){ // get ul with leasst il's minelements = $(this) .children().size(); selem = $(this); } if($(this) .children().size() > maxelements){ // get ul with most il's maxelements = $(this).children().size(); telem = $(this); } }); if(telem != null && selem != null){ // set the max height to the shortest ul , so that they all the same selem.css("padding-bottom",(((telem.attr("scrollHeight")-selem.attr("scrollHeight")))+30)+"px"); } } $(window).error(function(){ return true; }); var current_issue_date = '2008-09-29';