
function removeCommentForm()
{
    var cf = document.getElementById('commentForm');
    cf.innerHTML = '<a href="javascript:addCommentForm()" class="toggleComment">Add Comment</a>';

}

function addCommentForm()
{
	var cf = document.getElementById('commentForm');
	
	cf.innerHTML = '<a href="javascript:removeCommentForm()" class="toggleComment">Remove Comment</a><p /><input type="input" id="vname" value="" maxlength="30" size="30" class="nickname"> Name </input><br /><input type="input" id="vwebsite" value="" size="45" class="website"> Website </input><br /><textarea rows="8" cols="50" id="vcomment"></textarea><br /><input type="hidden" name="_fuckBots_" value="yes"></input>[img] url [/img], [link] url [/link], [utube] url [/utube], [b] bold [/b], [i] italic [/i]<p /><button type="submit" name="postComment" value="Post Comment" onclick="submitCommentForm()">Post Comment</button>';
	
}

function submitCommentForm()
{

	document.getElementById('hname').value = document.getElementById('vname').value;
	document.getElementById('hwebsite').value = document.getElementById('vwebsite').value;
	document.getElementById('hcomment').value = document.getElementById('vcomment').value;
	document.getElementById('hfuckBots').value = 'safe';
	
	document.hCommentForm.submit();
}

function chksel(name, val)
{
	var chkboxes = document.getElementsByName(name);
	for(i=0; i<chkboxes.length; i++)
	{
		var chkbox = chkboxes[i];
		
		chkval = chkbox.checked;
		if(val == "invert")
			chkbox.checked = !chkval;
		else
			chkbox.checked = val;
	}
	
}


function dynHeaderRefresh(srcId, destId) 
{
	var srcElement = document.getElementById(srcId);
//	alert(srcElement.value);
//	srcElement = document.getElementById(srcId);
	destElement = document.getElementById(destId);
	destElement.innerHTML = srcElement.value;
}

function popupImgsel(imgpath)
{
	imgselwin=window.open("imagesel.php?imgpath="+imgpath,'name','height=500,width=480');
	if (window.focus)
		imgselwin.focus()
}

function popupImg(imgPath, width, height)
{
	imgwin=window.open(imgPath,'name', 'height='+(height+30)+',width='+(width+30));
	if (window.focus)
		imgwin.focus()
	
}

function loadMap(longitude, lat, zoom)
{

	mapdiv = document.getElementById('map');
	
	mapdiv.style.height = '200px';
	mapdiv.style.width = '300px';			
		
	if (GBrowserIsCompatible())
	{
		var map = new GMap2(document.getElementById("map"));
		
		map.addControl(new GMapTypeControl());
		map.addControl(new GSmallZoomControl());
		
		map.showControls();
		map.setCenter(new GLatLng(longitude, lat), zoom);
		
	}
}


