/* Copyright (c) 2006-2007 Mathias Bank (http://www.mathias-bank.de) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version 2.1 * * Thanks to * Hinnerk Ruemenapf - http://hinnerk.ruemenapf.de/ for bug reporting and fixing. * Tom Leonard for some improvements * */ jQuery.fn.extend({ /** * Returns get parameters. * * If the desired param does not exist, null will be returned * * To get the document params: * @example value = $(document).getUrlParam("paramName"); * * To get the params of a html-attribut (uses src attribute) * @example value = $('#imgLink').getUrlParam("paramName"); */ getUrlParam: function(strParamName){ strParamName = escape(unescape(strParamName)); var returnVal = new Array(); var qString = null; if ($(this).attr("nodeName")=="#document") { //document-handler if (window.location.search.search(strParamName) > -1 ){ qString = window.location.search.substr(1,window.location.search.length).split("&"); } } else if ($(this).attr("src")!="undefined") { var strHref = $(this).attr("src") if ( strHref.indexOf("?") > -1 ){ var strQueryString = strHref.substr(strHref.indexOf("?")+1); qString = strQueryString.split("&"); } } else if ($(this).attr("href")!="undefined") { var strHref = $(this).attr("href") if ( strHref.indexOf("?") > -1 ){ var strQueryString = strHref.substr(strHref.indexOf("?")+1); qString = strQueryString.split("&"); } } else { return null; } if (qString==null) return null; for (var i=0;i= (artistSelected.length-5)) i = artistSelected.length - 1; artistSelected.selectedIndex = i; artistSelected.selectedIndex = selectedIndex; }); function changeArtist(artist_id){ var siteroot = 'http://www.asia-fineart.com/'; var query_frame = document.getElementById("query_frame"); var ArtistRight = document.getElementById("ArtistRight"); var ArtistPaintings = document.getElementById("ArtistPaintings"); var get_value = ""; ArtistRight.innerHTML = '
Loading ...
'; ArtistPaintings.innerHTML = '
Loading ...
'; get_value += "artist_id="+artist_id; // not doing this: query_frame.src = siteroot + "/inc/php/gen_artist_info.php?"+get_value; var navigateUrl = (siteroot + 'page.php?artist/' + artist_id); var country_selected = document.getElementById("country_selected"); if ((country_selected) && (country_selected.value)) { navigateUrl = navigateUrl + "?country=" + country_selected.value; } window.location.href = navigateUrl; } function genArtistList(country_label){ var query_frame = document.getElementById("query_frame"); var country_selected = document.getElementById("country_selected"); var get_value = ""; get_value += "country_label="+country_label; query_frame.src = siteroot + "/inc/php/gen_artist_list.php?"+get_value; } function genPaintings(status){ var siteroot = 'http://www.asia-fineart.com/'; var query_frame = document.getElementById("query_frame"); var ArtistPaintings = document.getElementById("ArtistPaintings"); var artist_id = document.getElementById("artist_selected").value; var get_value = ""; ArtistPaintings.innerHTML = '
Loading ...
'; get_value += "status="+status; get_value += "&artist_id="+artist_id; query_frame.src = siteroot + "/inc/php/gen_paintings.php?"+get_value; } //function previousPage(){ // var obj = document.getElementById("ImageContainer").style; // var num_paintings = document.getElementById("num_paintings").value; // var previous_button = document.getElementById("PreviousPage").value; // var next_button = document.getElementById("NexPage").value; // // var x = 400; // // if (obj.left.length == 0) // obj.left = 0 // // var pos = parseInt(obj.left) + x; // obj.left = pos+"px"; // //// SlideX("ImageContainer", x); // // //} // //function nextPage(){ // var obj = document.getElementById("ImageContainer").style; // var num_paintings = document.getElementById("num_paintings").value; // var previous_button = document.getElementById("PreviousPage").value; // var next_button = document.getElementById("NexPage").value; // // var x = -400; // // if (obj.left.length == 0) // obj.left = 0 // // var pos = parseInt(obj.left) + x; // obj.left = pos+"px"; // // if (parseInt(obj.left) > 0){ // previous_button.innerHTML = "previous"; // } // // num_pages = Math.ceil(num_paintings / 4); // // if (((num_pages - 1) * -400) > parseInt(obj.left)){ // next_button.innerHTML = "next"; // } // //// SlideX("ImageContainer", x); //} function movePage(x){ var obj = document.getElementById("ImageContainer").style; var num_paintings = document.getElementById("num_paintings").value; var previous_button = document.getElementById("PreviousPage"); var next_button = document.getElementById("NextPage"); if (obj.left.length == 0) obj.left = 0 var pos = parseInt(obj.left) + x; obj.left = pos+"px"; if (parseInt(obj.left) < 0){ previous_button.innerHTML = "previous"; } else { previous_button.innerHTML = ""; } num_pages = Math.ceil(num_paintings / 5); // alert(num_pages); // alert(parseInt(obj.left)); if (((num_pages - 1) * -500) < parseInt(obj.left)){ next_button.innerHTML = "next"; } else { next_button.innerHTML = ""; } // SlideX("ImageContainer", x); } //function SlideX(id, position){ // var obj = document.getElementById(id).style; // var speed = 10; // // if (obj.left.length <= 0) // obj.left = 0; // obj.xpos = parseInt(obj.left); // alert(obj.xpos); // //// alert(Math.abs(obj.xpos - position)); // // if (Math.abs(obj.xpos - position) > 0) { // if (position < 0) // speed = -speed; // // obj.xpos += speed; // obj.left = obj.xpos+"px"; // // setTimeout("SlideX('"+id+"', "+position+")", 2000) // } //}