/* show hide a div .. */

function ToggleDiv(divname) 
{
	if (document.getElementById(divname).style.display == "none") 
	{
		document.getElementById(divname).style.display = "block"; 
	} else
		{
			document.getElementById(divname).style.display = "none"; 
		}	
}

/* for atributes navigation on list pages */
function ToggleDiv1(divname,pname) 
{
	if (document.getElementById(divname).style.display == "none") 
	{
		document.getElementById(divname).style.display = "block";
		document.getElementById(pname).innerHTML = "<a href=\"javascript:ToggleDiv1('" + divname + "','"+ pname +"')\" class=\"l8\"\">... show first 3 options</a>";
		// alert (pname);
		
	} else
		{
			document.getElementById(divname).style.display = "none";
			document.getElementById(pname).innerHTML = "<a href=\"javascript:ToggleDiv1('" + divname + "','"+ pname +"')\" class=\"l8\"\">... view all options</a>";			
		}	
}
// pop up window

function openWindow(URL, h, w, s) 
{
	var gg = typeof (popupWin);
	if (gg =='object')
		{ 
		if (popupWin.closed ) {}
		else { popupWin.close();  }
	};
	popupWin = window.open(URL, '', 'dependent=0,height='+h+',width='+w+',screenX=20,left=10,screenY=150,top=10,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars='+s+',status=0,toolbar=0', 'launcher');

	if (window.focus)
	{
 	popupWin.focus();
	}
}

// email cloaking function
function	cloak( c_user , c_domain_sld , c_domain_tld , c_caption , c_class )
{
	c_mail = c_user + '@' + c_domain_sld + '.' + c_domain_tld;

	if( c_caption == '' )
	{
		c_caption = c_mail; 
	}

	if( c_class != '' )
	{
		c_cls = ' class="' + c_class + '"';
	}
	else
	{
		c_cls = ''; 
	}
	document.write( '<a href="mailto:' + c_mail + '"'+ c_cls +'>'+ c_caption + '</a>'  );
}
