

//here you place the ids of every element you want.
var ids=new Array('login','shop');


function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++) {
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

function getURLParameter(name)
	{
	  var pattern = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( pattern );
	  var res = regex.exec( window.location.href );
	  if (res == null)
		return "";
	  else
		return res[1];
	}

// set cookie to hide login form - required so that all other links on page will hide login form
function setCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}


 // get cookie - if user is logged in then hide login form
   function getCookie(c_name) {
    if (document.cookie.length>0)
    {
      c_start=document.cookie.indexOf(c_name + "=");
      if (c_start!=-1) {
         c_start=c_start + c_name.length+1;
         c_end=document.cookie.indexOf(";",c_start);
         if (c_end==-1) c_end=document.cookie.length;
           return unescape(document.cookie.substring(c_start,c_end));
      }
    }
    return "";
   }

   function deleteCookie(name) {
     document.cookie = name +'=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
   } 

   
function switchid(id){	
	hideallids();
	showdiv(id);
}


