//create the activate shortcuts function
function ActivateShortcuts() {
	//check for empty domain
	if(document.$("domain_name").value == "") {
		alert("Please supply a domain name.");
		return;
	}
	
	//animate
		//find the div
		var ResultsDiv = document.$("results");
		
		//create the opening animation
		var ResultsDivHeight = 625;
		
		//create the animation object
		var OpenAnimation = new Parallel();
		OpenAnimation.addChild(new Tween(ResultsDiv.style,'height',Tween.strongEaseOut,0,ResultsDivHeight,1,'px'));
		OpenAnimation.addChild(new OpacityTween(ResultsDiv,Tween.strongEaseOut,0,100,1));
		
		//play opening animation
		OpenAnimation.onMotionStarted = function() {
			ResultsDiv.style.display = "";
		}
		
		OpenAnimation.start();
	//end animate
	
	//set the domain
	document.$("domain_label").innerHTML = "http://"+document.$("domain_name").value;
	document.$("shortcut_label").innerHTML = "*choose shortcut above*";
	
	//clear the frame
	document.$("main_frame").src = "http://"+ document.$("domain_name").value;
	
	//reset drop downs
	var DropDowns = document.getElementsByTagName("select");
	for(var i = 0 ; i < DropDowns.length ; i++) {
		DropDowns[i].selectedIndex = 0;
	}
}


//create the run shorcut function
function RunShortcut(ddElement) {
	var DomainName = document.$("domain_name").value.replace("http://","");

	if(ddElement.selectedIndex != 0) {
		switch(ddElement.options[ddElement.selectedIndex].text){
			/****************************************/
			case "IP/DNS/Registrar Lookup":
				DomainName = DomainName.replace("http://","");
				window.open(ddElement.value.replace("%URL%", DomainName));
				return;				
				break;
			/****************************************/
			case "DMOZ Listings":
				document.$("main_frame").src = ddElement.value.replace("%URL%", DomainName.replace("www.",""));
				document.$("shortcut_label").innerHTML = ddElement.options[ddElement.selectedIndex].text;
				return;			
				break;
			/****************************************/
			case "Yahoo! Pages Indexed":
				document.$("main_frame").src = ddElement.value.replace("%URL%", DomainName);
				document.$("shortcut_label").innerHTML = ddElement.options[ddElement.selectedIndex].text;
				return;			
				break;
			/****************************************/
			case "Yahoo! Directory Indexed":
				document.$("main_frame").src = ddElement.value.replace("%URL%", DomainName);
				document.$("shortcut_label").innerHTML = ddElement.options[ddElement.selectedIndex].text;
				return;
				break;
			/****************************************/
			case "Yahoo! Backlinks":
				DomainName = DomainName.replace("http://","");
				document.$("main_frame").src = ddElement.value.replace("%URL%", DomainName);
				document.$("shortcut_label").innerHTML = ddElement.options[ddElement.selectedIndex].text;
				return;
				break;
			/****************************************/
			case "IP/DNS/Registrar Lookup":
				DomainName = DomainName.replace("http://","");
				document.$("main_frame").src = ddElement.value.replace("%URL%", DomainName);
				document.$("shortcut_label").innerHTML = ddElement.options[ddElement.selectedIndex].text;
				return;
				break;
			/****************************************/
			default:
				document.$("main_frame").src = ddElement.value.replace("%URL%", DomainName);
				document.$("shortcut_label").innerHTML = ddElement.options[ddElement.selectedIndex].text;				
				break;
			
		}
	}
}


