function popupform(myform, windowname, dwidth, dheight) {
	if (! window.focus)return true;
	window.open(myform, windowname, 'height='+dheight+',width='+dwidth+',scrollbars=yes');
	myform.target=windowname;
	return true;
}

function copyCode(theField) {
	//var tempval=eval("document."+theField)
	therange=document.getElementById(theField).createTextRange()
	therange.execCommand("Copy")
}

/***********************************************
* Bookmark site script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

/* add to myspace */
function GetThis(T, C, U, L)
{
    var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(T)
    + '&c=' + encodeURIComponent(C) + '&u=' + encodeURIComponent(U) + '&l=' + L;
    window.open(targetUrl);
}

function updateSearch() {
	var which = document.getElementById("searchwhat").value;
	if(which == "http://www.videosta.com/search.php") {
		document.getElementById("searchform").action = which;
		document.getElementById("searchform").method = "post";
		document.getElementById("search-box").name = "q";
	} else {
		document.getElementById("searchform").action = which;
		document.getElementById("searchform").method = "get";
	}
}
