jQuery.preloadImages = function() { for(var i = 0; i").attr("src", arguments[i]); } } function Colapse(div){ v = $('#' + div +' .box_content'); v.slideToggle("slow"); return false; } function newwindow(w,h,webaddress) { var viewimageWin = window.open(webaddress,'New_Window','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,resizable=no,copyhistory=no,width='+w+',height='+h); viewimageWin.moveTo(screen.availWidth/2-(w/2),screen.availHeight/2-(h/2)); } path_files = ''; function fadeToggle(id){ div = $('#'+id); //alert(div.css('display')); if (div.css('display') == 'none'){ div.fadeIn('slow'); }else{ div.fadeOut('slow'); } return false; } function SaveOrder(cat_id, ids ){ data = 'category_id=' + cat_id + '&ids='+ids; $.ajax({type: "POST",url: path_files + "/includes/order.php",data: data ,dataType: "script"}); return false; } function SaveOrder2(ids){ data = 'ids='+ids; $.ajax({type: "POST",url: path_files + "/includes/order2.php",data: data ,dataType: "script"}); return false; } function Loadvideo(id, number){ //alert(id + ' '+ number); on = '-on.'; off = '-off.'; /*turn off tabs */ $("#swf_menu img").each(function(){ s1 = $(this).attr('src'); $(this).attr('src', s1.replace(on,off) ); }); //turn on selected s1 = $('#link_'+id+' img').attr('src'); //alert(s1); $('#link_'+id+' img').attr('src', s1.replace(off,on) ); var so = new FlashObject(path_files + "/images/flash_demos/00"+number+".swf", "steps", "500", "353", "8", "#000000"); so.setAttribute('redirectUrl', 'http://www.hyperoffice.com/noflash.html'); so.addParam("quality", "high"); so.addParam("wmode", "transparent"); so.write("player"); return false; } function ToggleTab2(li,class1, id){ $('.'+class1).hide(); on = '-on.gif'; off = '-off.gif'; on2 = '-on.png'; off2 = '-off.png'; /*turn off tabs */ $("#"+li+" img").each(function(){ s1 = $(this).attr('src'); //alert(s1); $(this).attr('src', s1.replace(on,off) ); s1 = $(this).attr('src'); $(this).attr('src', s1.replace(on2,off2) ); }); $('#'+id).show(); //turn on selected s1 = $('#link_'+id+' img').attr('src'); $('#link_'+id+' img').attr('src', s1.replace(off,on) ); s1 = $('#link_'+id+' img').attr('src'); $('#link_'+id+' img').attr('src', s1.replace(off2,on2) ); return false; } function ToggleTab(class1, id){ $('.'+class1).hide(); on = '-on.gif'; off = '-off.gif'; on2 = '-on.png'; off2 = '-off.png'; on3 = '-on.jpg'; off3 = '-off.jpg'; /*turn off tabs */ $("#"+class1+" img").each(function(){ s1 = $(this).attr('src'); $(this).attr('src', s1.replace(on,off) ); s1 = $(this).attr('src'); $(this).attr('src', s1.replace(on2,off2) ); s1 = $(this).attr('src'); $(this).attr('src', s1.replace(on3,off3) ); }); $('#'+id).show(); //turn on selected s1 = $('#link_'+id+' img').attr('src'); $('#link_'+id+' img').attr('src', s1.replace(off,on) ); s1 = $('#link_'+id+' img').attr('src'); $('#link_'+id+' img').attr('src', s1.replace(off2,on2) ); s1 = $('#link_'+id+' img').attr('src'); $('#link_'+id+' img').attr('src', s1.replace(off3,on3) ); return false; } function SendToClipBoard(s) { $('#'+ s).select(); s = $('#'+ s).val(); if( window.clipboardData && clipboardData.setData ){clipboardData.setData("text", s);}else{alert("Internet Explorer required");} return false; } function ToggelValue(value){ //value = parseInt(value); data = "value=" + value; if (value != '' ){ $.ajax({type: "POST",url: path_files + "/includes/change.php",data: data ,dataType: "script"}); } } function ValidateExt(field_name,allowed_extensions){ val = $('#'+ field_name).val().toLowerCase(); array = allowed_extensions.split(','); cont = 0 ; for ( i = 0 ; i < array.length; i++){ if (val.indexOf('.' + array[i]) > 0) cont ++ ; } if (cont == 0){ alert('The File must be ' + array.join(' or ') ); $('#'+ field_name).val(''); } } function getHash(){return window.location.hash.replace("#", "");} function InitializeSE(){var bookHash=getHash();if(bookHash.length>0&&bookHash.indexOf(':')>0){page=bookHash.substr(bookHash.indexOf(':')+1);container=bookHash.substr(0,bookHash.indexOf(':'));url=$('#'+container+'_li_0 a').attr('href').replace('p=0','p='+page);pp=parseInt($('#'+container+'_list_0 li').size())-1;$('#'+container+' .pages_nav ul').hide();$('#'+container+'_list_'+Math.floor(page/pp)).show();LoadNavPage(url,page,container)}} function ff(){title=document.title ;url="http://www.ustrendy.com";if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(window.external){window.external.AddFavorite(url,title);}else if(window.opera&&window.print){alert("Sorry, your web browser does not support automatically adding Bookmarks/Favorites. Press 'Ctrl-D' in Firefox or 'Ctrl-T' in Opera to manually bookmark UsTrendy.com.");return false;}} $(document).ready(function(){ var init = function(){ var id = window.location.hash; $('#tb_addit div').hide(); if (id == "") id = "#tb_tab_1"; $(id).show(); $('#tb_tabs a[href="' + id + '"]').addClass('active'); }; init(); $('#tb_tabs a').click(function(){ var id = $(this).attr('href'); $('#tb_addit div').hide(); $(id).fadeIn(0); $('#tb_tabs a').removeClass('active'); $(this).addClass('active'); return false; }); });