/*GLOCAL ELEMENTS*/ var lastMenuId = false /*IF USER IS CLICKING THE MENU MANY TIMES LIKE ONE TIME IS NOT ENUF*/ var userIsADick = true function leftMenu(id) { $('#'+id).show() /*HIDING THE LAST MENU*/ if(lastMenuId) $('#'+lastMenuId).hide() /*IF THE LAST MENUID IS THE SAME ID AS THE CURRENT ONE THEN CHEKING WHAT TO DO*/ if(lastMenuId == id) { /*IF USERISADICK == TRUE MEANS THAT IT'S THE SECOND TIME THE MENU BEEN CLICKED SO THE DICK USER ACUALLY WANT TO CLOSE IT*/ if(userIsADick) { $('#'+lastMenuId).hide() userIsADick = false }else { /*ELSE THE OPASITE*/ userIsADick = true $('#'+lastMenuId).show() } }else { userIsADick = true } lastMenuId = id } function contact() { /*GET ALL THE DATA FROM THE FROM AND TRASLATE IS TO POSTS*/ var posts = setPost('contact') /*REPLACE THE CONTACTFORM DIV WIDTH THE CONTACT.AJAX WIDTH THE POST DATA */ ajax('/contact.ajax', posts, '', 'contactForm', 'loading') } function setAcive(id, trace) { /*TAKES ALL THE ELEMENT AND RESET THEM TO THE DEFUALT CLASS*/ $(trace).attr('className', 'none') /*CHANGE THE CLICKED ANCORE CLASSNAME TO ACTIVE SO IT WILL ADD THE ARROW AND THE BOLD FONT */ $(id).attr('className', 'active') } function switchNews(num) { ajax3('/frontNews.ajax', 'num='+num, '', 'frontNews', '') if(num == 8)var newNum = 0 else var newNum = parseInt(num) + 1 setTimeout("switchNews('"+newNum+"')", 3000); } $(document).ready( function(){ $('.chineseprac a img').hover( function(){ $(this).attr('src','/static/zelpel/images/chinese-practice_line.jpg'); }, function(){ $(this).attr('src','/static/zelpel/images/chinese-practice.jpg'); }); });