	function hold(domId){
		var id = domId.getAttribute('thingId');
		var code = domId.getAttribute('thingCode');
		var title = domId.getAttribute('thingTitle');
		console.log(id + " " + code + " " + title);
	}

// this is used when connecting lyrics to albums or albums to artists or whatever to whatever :D
	function selected(L1,domId){
		var L2 = document.getElementById(domId);
		L2.appendChild(L1.options[L1.selectedIndex]);
	}
// this is used when connecting lyrics to albums or albums to artists or whatever to whatever :D	
	function deSelected(L2,domId){
		var L1 = document.getElementById(domId);
		L1.appendChild(L2.options[L2.selectedIndex]);
	}
// this is used when connecting lyrics to albums or albums to artists or whatever to whatever :D	
	function selectAll(domId){
		var empty = true;
		for(i in domId){
			var L2 = document.getElementById(domId[i]);
			for(i=0; i < L2.options.length ; i++){
				L2.options[i].selected = true;
			}
		}
	}

// this function to be used in the add or edit lyrics where I manage to reshape the links posted by users 	
	function trimLink(theForm){
		var preview = document.getElementById('preview');
		
		var str = theForm.value;
		if(str.search(/embed|youtube|metacafe|google|la7oonFlash/i) != -1){
			str = fixURL(str);
			if(str.search(/&la7oonFlash/i) != -1){
				str = str.replace(/&la7oonFlash/i,"");
			}
			str = str+"&la7oonFlash";
			theForm.value = str;
			temp = '<div><?__("if the video worked here that means it will work on all over machines. :D")?></div>';
			preview.innerHTML ="<embed src=\""+str+"\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"400\" height=\"320\"></embed>";
		}else if(str.search(/http:/i) != -1){
			preview.innerHTML =temp +"<EMBED SRC=\""+str+"\" WIDTH=\"400\" HEIGHT=\"60\" type=\"audio/x-pn-realaudio-plugin\" controls=\"default\" pluginspage=\"www.real.com\" autostart=\"True\" loop=\"0\">";
		}else{
			if(str.length > 1){
				preview.innerHTML ='<?__("This is not a link to anything. Please Try again Later")?>';
			}else{
				preview.innerHTML = "";
			}
		}
	}
	
	/**
	* this function will return str which is the URL to be embed
	*/
	// this function to be used in the add or edit lyrics where I manage to reshape the links posted by users 
	function fixURL(str){
		// all embed videos. will extract the URL only and shape it
		if(str.search(/embed/i) != -1){
			str = str.replace(/src=/i,"src=");
			str = str.split("src=");
			str = str[1].split(" ");
			str = str[0];
			str = str.replace(/"/g,"");
			str = str.replace(/'/g,"");
			return str;
		}
		//if Youtube URL
		if(str.search(/youtube/i) != -1){
			if(str.search(/watch/) != -1){
				str = str.split("v=");
				str = str[1].split("&");
				str = str[0];
				str = "http://www.youtube.com/v/"+str+"&hl=en&fs=1&";
			}
			return str;
		}
		//if Google URL
		if(str.search(/google/i) != -1){
			if(str.search(/videoplay/) != -1){
				str = str.split("docid=");
				str = str[1].split("&");
				str = str[0];
				str = "http://video.google.com/googleplayer.swf?docid="+str+"&hl=en&fs=true";
			}
			return str;
		}
		// if metacafe URL
		if(str.search(/metacafe/i) != -1){
			if(str.search(/watch/) != -1){
				str = str.split("watch");
				str = str[1].split("/");
				str = "http://www.metacafe.com/fplayer/"+str[1]+"/"+str[2]+".swf";
			}
			return str;
		}
		return str;
	}
