/*** Create some global variables ***/ var FadingObject = new Array(); var FadeRunning=false; var FadeInterval=30; var hexDigit=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"); function dec2hex(dec) { return(hexDigit[dec>>4]+hexDigit[dec&15]); } function hex2dec(hex) { return(parseInt(hex,16)) } function createFaderObject(theDiv, numSteps, startColor) { if(!startColor) startColor = "FFFFFF"; this.name = theDiv; this.text = null; this.color = "FFFFFF"; this.next_text = null; this.next_color = null; this.state = "OFF"; this.index = 0; this.steps = numSteps; this.r = hex2dec(startColor.slice(0,2)); this.g = hex2dec(startColor.slice(2,4)); this.b = hex2dec(startColor.slice(4,6)); } function FadingText(theDiv, numSteps, startColor) { FadingObject[theDiv] = new createFaderObject(theDiv, numSteps, startColor); } function start_fading() { if(!FadeRunning) FadeAnimation(); } function set_text(f) { if(navigator.appName.indexOf("Netscape") != -1 && document.getElementById) { var theElement = document.getElementById(f.name); var newRange = document.createRange(); newRange.setStartBefore(theElement); var strFrag = newRange.createContextualFragment(f.text); while (theElement.hasChildNodes()) theElement.removeChild(theElement.lastChild); theElement.appendChild(strFrag); theElement.style.color="#"+f.startColor; } } function getColor(f) { var r=hex2dec(f.color.slice(0,2)); var g=hex2dec(f.color.slice(2,4)); var b=hex2dec(f.color.slice(4,6)); r2= Math.floor(f.r+(f.index*(r-f.r))/(f.steps) + .5); g2= Math.floor(f.g+(f.index*(g-f.g))/(f.steps) + .5); b2= Math.floor(f.b+(f.index*(b-f.b))/(f.steps) + .5); return("#" + dec2hex(r2) + dec2hex(g2) + dec2hex(b2)); } function setColor(fadeObj) { var theColor=getColor(fadeObj); var str="" + fadeObj.text + ""; var theDiv=fadeObj.name; //if IE 4+ if(document.all) { document.all[theDiv].innerHTML=str; } //else if NS 4 else if(document.layers) { document.nscontainer.document.layers[theDiv].document.write(str); document.nscontainer.document.layers[theDiv].document.close(); } //else if NS 6 (supports new DOM, may work in IE5) - see Website Abstraction for more info. //http://www.wsabstract.com/javatutors/dynamiccontent4.shtml else if (document.getElementById) { theElement = document.getElementById(theDiv); theElement.style.color=theColor; } } function fade_up(theDiv, newText, newColor) { var f=FadingObject[theDiv]; if(newColor == null) newColor="FFFFFF"; if(f.state == "OFF") { f.text = newText; f.color = newColor; f.state = "FADE_UP"; set_text(f); start_fading(); } else if( f.state == "FADE_UP_DOWN" || f.state == "FADE_DOWN" || f.state == "FADE_DOWN_UP") { if(newText == f.text) f.state = "FADE_UP"; else { f.next_text = newText; f.next_color = newColor; f.state = "FADE_DOWN_UP"; } } } function fade_down(theDiv) { var f=FadingObject[theDiv]; if(f.state=="ON") { f.state="FADE_DOWN"; start_fading(); } else if(f.state=="FADE_DOWN_UP") { f.state="FADE_DOWN"; f.next_text = null; } else if(f.state == "FADE_UP") { f.state="FADE_UP_DOWN"; } } function FadeAnimation() { FadeRunning = false; for (var d in FadingObject) { var f=FadingObject[d]; if(f.state == "FADE_UP") { if(f.index < f.steps) f.index++; else f.index = f.steps; setColor(f); if(f.index == f.steps) f.state="ON"; else FadeRunning = true; } else if(f.state == "FADE_UP_DOWN") { if(f.index < f.steps) f.index++; else f.index = f.steps; setColor(f); if(f.index == f.steps) f.state="FADE_DOWN"; FadeRunning = true; } else if(f.state == "FADE_DOWN") { if(f.index > 0) f.index--; else f.index = 0; setColor(f); if(f.index == 0) f.state="OFF"; else FadeRunning = true; } else if(f.state == "FADE_DOWN_UP") { if(f.index > 0) f.index--; else f.index = 0; setColor(f); if(f.index == 0) { f.text = f.next_text; f.color = f.next_color; f.next_text = null; f.state ="FADE_UP"; set_text(f); } FadeRunning = true; } } /*** Check to see if we need to animate any more frames. ***/ if(FadeRunning) setTimeout("FadeAnimation()", FadeInterval); } var xmlhttp /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") } catch (E) { xmlhttp=false } } @else xmlhttp=false @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false } } function myXMLHttpRequest() { var xmlhttplocal; try { xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP") } catch (E) { xmlhttplocal=false; } } if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') { try { var xmlhttplocal = new XMLHttpRequest(); } catch (e) { var xmlhttplocal=false; alert('couldn\'t create xmlhttp object'); } } return(xmlhttplocal); } function sndReq(vote,id_num,ip_num,units) { var theUL = document.getElementById('unit_ul'+id_num); // the UL // switch UL with a loading div theUL.innerHTML = '
'; xmlhttp.open('get', 'rpc.php?j='+vote+'&q='+id_num+'&t='+ip_num+'&c='+units); xmlhttp.onreadystatechange = handleResponse; xmlhttp.send(null); } function handleResponse() { if(xmlhttp.readyState == 4){ if (xmlhttp.status == 200){ var response = xmlhttp.responseText; var update = new Array(); if(response.indexOf('|') != -1) { update = response.split('|'); changeText(update[0], update[1]); } } } } function changeText( div2show, text ) { // Detect Browser var IE = (document.all) ? 1 : 0; var DOM = 0; if (parseInt(navigator.appVersion) >=5) {DOM=1}; // Grab the content from the requested "div" and show it in the "container" if (DOM) { var viewer = document.getElementById(div2show); viewer.innerHTML = text; } else if(IE) { document.all[div2show].innerHTML = text; } } function toggleLayer( whichLayer ) { var elem, vis; if( document.getElementById ) // this is the way the standards work elem = document.getElementById( whichLayer ); else if( document.all ) // this is the way old msie versions work elem = document.all[whichLayer]; else if( document.layers ) // this is the way nn4 works elem = document.layers[whichLayer]; vis = elem.style; // if the style.display value is blank we try to figure it out here if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; vis.display = (vis.display==''||vis.display=='block')?'none':'block'; } /*********************************************** * AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ //Contents for menu 1 var menu1=new Array() menu1[0]='TR Turkish (TR)' menu1[1]='UK English (UK)' var menuwidth='110px' //default menu width var menubgcolor='#242424' //menu bgcolor var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) var hidemenu_onclick="yes" //hide menu when user clicks within menu? /////No further editting needed var ie4=document.all var ns6=document.getElementById&&!document.all if (ie4||ns6) document.write('') function getposOffset(what, offsettype){ var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null){ totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } function showhide(obj, e, visible, hidden, menuwidth){ if (ie4||ns6) dropmenuobj.style.left=dropmenuobj.style.top="-500px" if (menuwidth!=""){ dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=menuwidth } if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") obj.visibility=visible else if (e.type=="click") obj.visibility=hidden } function iecompattest(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function clearbrowseredge(obj, whichedge){ var edgeoffset=0 if (whichedge=="rightedge"){ var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth } else{ var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up? edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight if ((dropmenuobj.y-topedge)