function manage_tag(objId){
	if(document.getElementById(objId).style.visibility == 'visible'){
		document.getElementById(objId).style.visibility = 'hidden';
	} else {
		document.getElementById(objId).style.visibility = 'visible';
	} 
}
function submit_digg(url,title,description,topic){
	url_link = "http://digg.com/submit?phase=2&url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title) + "&bodytext=" + encodeURIComponent(description) + "&topic=" + encodeURIComponent(topic);
	window.open(url_link);
}
function submit_reddit(url,title){
	url_link='http://reddit.com/submit?url='+encodeURIComponent(url)+'&title='+encodeURIComponent(title)	
	window.open(url_link);
}
function swap_img(imgName,imgurl) {
    document[imgName].src = imgurl;
}
function swap_caption1(objectID,caption){
	caption = escape(caption);
	document.getElementbyId(objectID).innerText=caption;
}
function swap_caption2(objectID,caption){
	document.getElementbyId(objectID).innerHTML=caption;
}
function swap_pics(imgNames,imgurl,cap_id,caption){
	document.getElementById(cap_id).innerHTML=caption;
	document[imgNames].src = imgurl;	
}
function pop_window(iWidth,iHeight,iUrl){
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(iUrl, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + iWidth + ",height=" + iHeight + ",left = 428.5,top = 300.5');");	
}
function pop_window2(iWidth,iHeight,iUrl){
	day = new Date();
	id = day.getTime();
	iUrl = change_src(iUrl);
	eval("page" + id + " = window.open(iUrl, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=" + iWidth + ",height=" + iHeight + ",left = 428.5,top = 300.5');");	
}
function imgswap(imgName,imgurl) {
	document[imgName].src = imgurl;
}
function show_option(id){
	var objID = document.getElementById(id);
	objID.style.display='block';
	objID.style.visibility='visible';                                                                                       
}
function hide_option(id){
	var objID = document.getElementById(id);
	objID.style.display='none';       
	objID.style.visibility='hidden'    
 }           
function handle_event2(imgName,imgURL,obj_hide,obj_show,buy_id,buy_url){
	var lid = document.getElementById(buy_id);
	buy_url = encodeURI(buy_url);
	lid.href = buy_url;
	imgswap(imgName,imgURL);
	hide_option(obj_hide);
	show_option(obj_show);
}
function change_src(imgSrc){
	var str = imgSrc;
	var tmp = str.substring(0,str.length - 4);
	tmp = tmp + "-lg.gif";
	return tmp;
}
function show_content(id){
	var objid = id;
	hide_option('w_cubes');
	hide_option('w_cubes_a');		
	hide_option('w_cubes_p');	
	<!--hide_option('w_cubes_custom');-->	
	show_option(id);
}
function show_option(id){
	document.getElementById(id).style.display='block';
	document.getElementById(id).style.visibility='visible';						
}
function hide_option(id){
	var objId=id;
	document.getElementById(objId).style.display='none';	
	document.getElementById(objId).style.visibility='hidden'				
}
function toggle_image(id,img1,img2){
	var tmp
	tmp = document[id].src;
	//get image source
	tmp2 = tmp.substring(33);
	//strip address to the image folder
	if(tmp2 == img1){
		document[id].src = img2
	} else {
		document[id].src = img1
	}
}
function gallery(imgName,imgURL,hid,htext,cid,cap){
	var headline_id = document.getElementById(hid);
	var caption_id = document.getElementById(cid);
	document[imgName].src = imgURL;
	headline_id.innerHTML = htext;
	caption_id.innerHTML = cap;	
}
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
