/* PopUp */

function Popup(page,width,height,scroll) {
	if (!scroll) { scroll = 0 }
	//var name = page.substring(0,(page.length - 4));
	random_num = (Math.round((Math.random()*9)+1))
	var name = random_num;
	window.open(page,name,'toolbar=0,scrollbars='+ scroll +',location=0,statusbar=0,menubar=0,resizable=0,width='+ width +',height='+ height);
}

/* Expand/Collapase */

var vTempPostid = "";

function ExpandCollapse(vPostid) { 
   var vWhichpost = document.getElementById(vPostid);  
   if (vWhichpost.className=="postshown") { 
      vWhichpost.className="posthidden"; 
   } 
   else { 
      vWhichpost.className="postshown"; 
   } 
}

function ExpandCopy(sPostid,sPostButton) {
   var vWhichbutton = document.getElementById(sPostButton);
   var vWhichpost = document.getElementById(sPostid);  
   if (vWhichpost.className=="inline") { 
      vWhichpost.className="none";
	  if (sPostButton) vWhichbutton.innerHTML="Read More";
   } 
   else { 
      vWhichpost.className="inline";
	  if (sPostButton) vWhichbutton.innerHTML="Close";
   } 
}

function toggleDiv(divid){
	var div = document.getElementById(divid);
	div.style.display = div.style.display == 'block' ? 'none' : 'block';
}
