/*
 * Write the flash include code in the page.
 *
 */
function displaySWF(file,width,height,id,flashVar1,flashVar2){
    document.writeln('    <object id="flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" id="' + id + '" name="' + id + '">');
    document.writeln('        <param name="movie" value="' + file + '?' + flashVar1 + '&' + flashVar2 + '" />');
    document.writeln('        <param name="allowScriptAccess" value="sameDomain" />');
    document.writeln('        <param name="quality" value="high" />');
    document.writeln('        <param name="wmode" value="transparent" />');
    document.writeln('        <embed src="' + file + '"');
    document.writeln('        src="' + file + '"');    
    document.writeln('        quality="high"');
    document.writeln('        wmode="transparent" ');    
    document.writeln('        width="' + width + '"');    
    document.writeln('        height="' + height + '"');    
    document.writeln('        id="' + id + '"');    
    document.writeln('        align="middle" ');    
    document.writeln('        allowScriptAccess="sameDomain" ');    
    document.writeln('        type="application/x-shockwave-flash" ');    
    document.writeln('        pluginspage="http://www.macromedia.com/go/getflashplayer" ');    
    document.writeln('        FlashVars="' + flashVar1 + '&' + flashVar2 + '"></embed>');
    document.writeln('    </object>');
}

/*
 * Function used for the display of the popups for the 
 * external Links. 
 *
 */
function displayPopup(textHTML, url, path){
	var tempTextHTML = document.getElementById('popupText').innerHTML;
	var tempUrl = document.getElementById('externalUrl').value
	document.getElementById('popupText').innerHTML = textHTML;
	document.getElementById('externalUrl').value = url;
	document.getElementById('genericPopUp').style.visibility='visible';
}

function submitEnter(myfield,e,path){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13)
	   {
	  	document.location.href = path + "/others/search-results?query=" + escape(myfield.value);
	   return false;
	   }
	else
	   return true;
}

function postSearchQuery(path){
	document.location.href = path + "/others/search-results?query=" + escape(document.getElementById("searchInput").value);
}