function setcitycookies(calid,cname) {

   var today = new Date();
   var expire = new Date();
   expire.setTime(today.getTime() + 3600000*24*180);

   SetCookie("pixcity", cname, 180, "/", "127.0.0.1", 0); 
   SetCookie("pixcal", calid, 180, "/", "127.0.0.1", 0); 
   citylink = "http://127.0.0.1/pix3/joomla/index.php?option=com_content&task=blogcategory&id=28&Itemid=66";
   window.location=citylink;
}


function doSel(obj)
 {
     for (i = 1; i < obj.length; i++)
        if (obj[i].selected == true) {
           eval(obj[i].value);
           window.location = obj[i].value; 
           }
}



function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function SetCookie(name, value, expdays, path, domain, secure)
{
	
	var expires = new Date();
	var today = new Date();
   	expires.setTime(today.getTime() + 3600000*24*expdays);
				
    document.cookie= name + "=" + escape(value) +
        ((expdays) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function SetCookieForward(name, value, expdays, path, domain, secure,forwardURL)
{
	
	SetCookie(name,value, expdays, path, domain,secure);        
     	window.location=forwardURL;
}



function pixcalendarnav() {

  if (ReadCookie("pixcal") != "") {
    citylink = "http://www.prideindex.com/forums/calendar.php?c="+ ReadCookie("pixcal");
  } else {
    citylink = "http://www.prideindex.com/citylistevents.php";
  }
  window.location=citylink;
}

function pixcitynav() {

  if (ReadCookie("pixcity") != "") {
    citylink = "http://www.prideindex.com/city.php?city="+ ReadCookie("pixcity");
  } else {
    citylink = "http://www.prideindex.com/citylist.php";
  }
  window.location=citylink;
}

function switchDiv(div_id){

  var pixlayers = new Array("pixevents","pixreviews","pixmarketplace","pixforums","pixpersonals");


      if(document.layers){
            thisbrowser="NN4";
        }
        if(document.all){
               for (counter = 0; counter < pixlayers.length; counter++) {
                        document.all[pixlayers[counter]].style.visibility="hidden";
                }


                document.all[div_id].style.visibility = "visible";
        }
        if(!document.all && document.getElementById){
                for (counter = 0; counter < pixlayers.length; counter++) {
                        document.getElementById(pixlayers[counter]).style.visibility="hidden";
                }
                document.getElementById(div_id).style.visibility = "visible";
        }

}

function pixcaljump() {

  var targeturl = '';


  if (document.calform.day.value==0) {
        targeturl = 'http://www.prideindex.com/forums/calendar.php?s=&do=' +
        '&year=' + document.calform.year.value +
        '&month=' + document.calform.month.value +
        '&c=' + document.calform.eventcity.value;
  } else {
        targeturl = 'http://www.prideindex.com/forums/calendar.php?do=getinfo&' +
  'day=' + document.calform.year.value + '-' + document.calform.month.value + '-' + document.calform.day.value +
  '&c=' + document.calform.eventcity.value;
  }


  window.location=targeturl;

  return (false);
}

