// // google.js // Google Highlighter // // Copyright(C)2001 - 2003 // Cal Henderson // // Thanks to Ian Beveridge for bugfixes // // This code may be freely redistributed, // providing this message remains intact. // var google_text_color = '#000000'; var google_link_colors = new Array('#ffff66','#a0ffff','#99ff99','#ff9999','#ff66ff'); function init_google() { var pattern = /google\./i; if (pattern.exec(document.referrer) != null){ var url_parts = document.referrer.split('?'); if (url_parts[1]){ var url_args = url_parts[1].split('&'); for(var i=0; i */ // Also known as IE fix var TridentFix = new Class( { tridentFix: function(item) { item.addEvents( { 'mouseover':function() { this.addClass('iehover'); }, 'mouseout':function() { this.removeClass('iehover'); } }); } }); var DropMenu = new Class( { Implements: [Options,TridentFix], /* don't know about options yet but set it up anyways just in case */ options: { mode: 'horizontal' }, menu: null, initialize: function(menu,options) { if(options) this.setOptions(options); this.menu = $(menu); // grab all of the menus children - LI's in this case var children = this.menu.getChildren(); // loop through children children.each(function(item,index){ // declare some variables var fChild, list; /* fChild = first child - which should be an A tag list = submenu UL */ fChild = item.getFirst(); list = fChild.getNext('ul'); // check if IE, if so apply fix if(Browser.Engine.trident) this.tridentFix(item); // if there is a sub menu UL if(list){ item.mel = list; // pel = parent element list.pel = item; // mel = menu element new SubMenu(list); // hook up the subMenu } },this); // binding loop to this object for trident fix } }); var SubMenu = new Class({ Implements: [Options,TridentFix], /* don't know about options yet but set it up anyways just in case */ options: { mode: 'vertical' }, menu: null, // storage for menu object depth: 0, // storage for current menu depth initialize: function(el,depth,options){ if(options) this.setOptions(options); // set options if(depth) this.depth = depth;// set depth this.menu = el; //attach menu to object if(this.depth == 0) this.menu.addClass('submenu'); // class for first level if(this.depth >= 1) this.menu.addClass('sub_submenu'); // class for deeper levels - in case :P this.menu.fade('hide'); // set menu to hid /* hook up menu's parent with event to trigger menu */ this.menu.pel.addEvents(this.parentEvents); // get menu's child elements var children = this.menu.getChildren(); // loop through children children.each(function(item,index){ // declare some variables var fChild, list; /* fChild = first child - which should be an A tag list = submenu UL */ fChild = item.getFirst(); list = fChild.getNext('ul'); // check if IE, if so apply fix if(Browser.Engine.trident) this.tridentFix(item); // if the menu item has a sub_submenu if(list) { var count = new Element('span').addClass('counter'); item.adopt(count); // stuff it inside li count.fade('hide'); // hide it item.mel = list; // mel = menu element item.count = count; // attach count accessor to menu item list.pel = item; // pel = parent element // create new subMenu with depth incremented new SubMenu(list,this.depth+1); } },this); //bound to this for trident fix }, // menu parent mouse events parentEvents: { 'mouseover': function() { if(this.count) this.count.fade('in'); // fade in menu this.mel.fade('in'); this.addClass('active'); }, 'mouseout': function() { if(this.count) this.count.fade('out'); // fade out menu this.mel.fade('out'); this.removeClass('active'); } } }); /************************* normal functions *************************/ function selectall() { for (var i=0;i < document.gallery.length;i++) { fldObj = document.gallery.elements[i]; if (fldObj.type == 'checkbox') fldObj.checked = true; } } function deselectall() { for (var i=0;i < document.gallery.length;i++) { fldObj = document.gallery.elements[i]; if (fldObj.type == 'checkbox') fldObj.checked = false; } } function remove_confirm (id) { if ( confirm ( 'Delete This Item?') ) { var myFx = new Fx.Tween("ID_"+id); myFx.set('opacity', '0'); myFx.set('height', '0'); //$('ID_'+id).dispose; // delete item from DB xajax_remove(id); //delete item from page } } function ConfirmDelete(varURL) { if (confirm("Are you sure you want to delete this?")) { //window.open(varURL, "_top"); location.href = varURL; return true; } return false; } function ConfirmRemove(varURL) { if (confirm("Are you sure you want to remove this from your favourite pictures?")) { //window.open(varURL, "_top"); location.href = varURL; return true; } return false; } function pagejump() { var temp=document.page.pages.value; window.location=temp; } function pagejump2() { var temp=document.page2.pages2.value; window.location=temp; } function toggleLayer(whichLayer) { if (document.getElementById) { // this is the way the standards work var style2 = document.getElementById(whichLayer).style; style2.display = style2.display? "":"block"; } else if (document.all) { // this is the way old msie versions work var style2 = document.all[whichLayer].style; style2.display = style2.display? "":"block"; } else if (document.layers) { // this is the way nn4 works var style2 = document.layers[whichLayer].style; style2.display = style2.display? "":"block"; } } function swapImage(ImName) { if (document.images) { if(document.form.elements) { if(document.images[ImName].src=="/layout_img/adv-top.gif") { document.images[ImName].src="/layout_img/adv-top-on.gif" } else { document.images[ImName].src="/layout_img/adv-top.gif"; } } } } function cap_submit ( ) { if ( document . searchform . string . value == '' ) { alert ( "Please Enter a Word / Phrase to search for." ) ; return false ; } return true ; } function pop_open (url, height, width ) { newwindow=window.open(url,'Poll', 'height='+height+', width='+width+'location=0, status=1, scrollbars=0, toolbar=0' ); s_width = screen.width ; s_height = screen.height - 50; y = (s_height - height )/2; x = (s_width - width)/2 ; newwindow.moveTo(x,y); if ( window.focus ) { newwindow.focus() } } function showDiv(objectID) { var theElementStyle = document.getElementById(objectID); if(theElementStyle.style.display == 'block') { theElementStyle.style.display = 'none'; } else { theElementStyle.style.display = 'block'; } } //google maps api create marker function.. function createMarker ( lat, long, icon_num, popuphtml ) { if ( typeof (GMarkers[icon_num] ) == "undefined" ) GMarkers[icon_num] = Array(); //get position of marker, as we are zero based this ads one.. :) var Mlength = GMarkers[icon_num].length; // create the point and icon point = new GLatLng( lat, long ) ; markerOptions = { icon:new_icon[ icon_num ] }; popuphtml = "
" + popuphtml + "<\/div>"; GMarkers[icon_num][Mlength] = new google.maps.Marker(point, new_icon[ icon_num ]); GEvent.addListener( GMarkers[icon_num][Mlength], "click", function() { GMarkers[icon_num][Mlength].openInfoWindowHtml(popuphtml); }); location_map.addOverlay( GMarkers[icon_num][Mlength] ); } //remove the map overlay of set markers function remove_overlay ( type ) { length = GMarkers[type].length ; for (var i=0; i