﻿

	        /** function FillDozen uses AJAX to  call the content for Featured Dozen area of the site
 * aid (int) - Artist ID, this parameter is available when the user select option from the artists drop-down
 * at (int)  - Artist Type - got this parameter from the promotion code that has taken the user to the site
 * divID (string) - id of the element where the result content will be fetch out
 * mode (int) - has values 1-for showing the Artists list drop-down, 2-changing one of the fields for artist details with the 
 *             details of the new one selected
 * sInd(int) - the index of the artist being chosen in the  Artists list drop-down. use to define in which container
 *              for artist detail  should be drop the content
 * bLoad2nd (boolean) - true-says that the current result content is the one that loads in the second content box under the Artists drop-down,  
 **/

function FillDozen(aid, at, divID, mode, sInd, bLoad2nd) {
    var ds, par, link;
    
  //  ds = "getCntProxy.asp"
ds="Top12Artists.asp"
    if (mode == 1){
        par = 'aid='+ aid + '&at=' + at;
       // if (sInd%2 == 0) divID+="_1"; else divID+="_2";
       // if (sInd%2 == 0)
	   divID+="_"+sInd; 
	   //else divID+="_1";
        /*
        if (bLoad2nd) {
            if (bLoad2nd%3 == 2){
                if (par.length>0) par+='&';
                par += 'ld2=1';
            }
        }
        */
	
        if (bLoad2nd) {
            if (!at){
                if (bLoad2nd%3 == 2){
                    if (par.length>0) par+='&';
                    par += 'ld2=1';
                }
            }
            else {
                if (bLoad2nd%3 == 1){
                    if (par.length>0) par+='&';
                    par += 'ld2=1';
                }
            }
        }
    }
    else 
        par = 'mode=2&at=' + at;

   // par = "l=" + escape("http://webfarm.foliolink.com/featsites.asp?"+ par);
    if((parseInt(aid)>0 || aid=="")&& mode == 1 || mode !=1)    postGetData(ds, par, divID);
}

function postGetData(dataSource, data, divID)
{
    var XMLHttpRequestObject;
    if (window.XMLHttpRequest) {
        XMLHttpRequestObject = new XMLHttpRequest()
    }else if (window.ActiveXObject){
        XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP")
        }

    if(XMLHttpRequestObject) {
        var obj = document.getElementById(divID);
	try{
	//netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
        XMLHttpRequestObject.open("POST", dataSource);
       
XMLHttpRequestObject.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
        XMLHttpRequestObject.onreadystatechange = function()
            {
                if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
                    obj.innerHTML = XMLHttpRequestObject.responseText;
					
                } 
            }
        XMLHttpRequestObject.send(data);
	}
	catch (e) {
		//alert('Error ' + e.message + ' occurred.');
	}
    }
}

  var oldImgToShow,oldLiID,content; 
    oldLiID = 'FP';
     
    
    function imgChange(imgSRC,txtcontent,liID) {
        
        
        oldImgToShow = document.getElementById('showIMG');
        content = document.getElementById('putContent');
        oToShow = document.getElementById(liID);
        oToHide = document.getElementById(oldLiID); 
        
        if (imgSRC && oldImgToShow) {
        
                //if (oldImgToShow.src!=imgSRC){
                    
                    if (typeof(oldImgToShow.blur)=='function'){
                    oldImgToShow.blur();
                    } 
                    oldImgToShow.src = imgSRC;
                    if (content) content.innerHTML=txtcontent;
                                      
                    if (oToShow.className!="") oToShow.className=oToShow.className+" on";
                    else oToShow.className="on";
                    
                    if (oToHide.className=="on") oToHide.className="";
                    else {
                        if (oToHide.className=="end on") oToHide.className="end";
                    
                    }
                    oldLiID=liID;
                //}
        }
        
        return false;
    }

//-->

