function OpenWindow(URL, Name, Width, Height) {
	var PositionX = 0;
	var PositionY = 0;
	var DefaultWidth  = 600;
	var DefaultHeight = 400;
	var WinObject, Params = 'scrollbars=1, resizable=1, left=' + PositionX + ', top=' + PositionY;
	Params += ', width=' + ((isNaN(parseInt(Width))) ? DefaultWidth : Width);
	Params += ', height=' + ((isNaN(parseInt(Height))) ? DefaultHeight : Height);
	WinObject = window.open(URL, Name, Params)
	if (!WinObject) return true;
	if (WinObject.focus) WinObject.focus();
	return false;
}


function InsertFlash(Target, ID, Version, File, Width, Height, Parameters) {
	var ParametersObjectStr = ''
	var ParametersEmbedStr = ''
	var s, v
	for (s in Parameters) {
		v = Parameters[s]
		ParametersObjectStr += '<param name="'+s+'" value="'+v+'" />'
		ParametersEmbedStr += ' '+s+'="'+v+'" '
	}
	var FlashHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' +
			'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+Version+',0,0,0" ' +
			'width="'+Width+'" height="'+Height+'" id="'+ID+'">' +
			'<param name="movie" value="'+File+'" />' +
			ParametersObjectStr +
			'<embed src="'+File+'" menu="true" ' +
				'pluginspage="http://www.macromedia.com/go/getflashplayer"  ' +
				'type="application/x-shockwave-flash" width="'+Width+'" height="'+Height+'" name="'+ID+'" '+ParametersEmbedStr+' />' +
		'</object>'
	$(Target).innerHTML = FlashHTML;
}

function InsertFlashOrHTML(Target, ID, Version, File, Width, Height, Parameters, NoFlashHTML) {
    var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
    if (hasReqestedVersion) {
        InsertFlash(Target, ID, Version, File, Width, Height, Parameters);
    } else {
        $(Target).innerHTML = NoFlashHTML;
    }
}

function showFaq(faqId) {

    //hide all Answers
    var faqAnswers =  $$('div.faqAnswer').invoke('readAttribute', 'id');
    for (var index = 0; index < faqAnswers.length; ++index) {
      var answer = faqAnswers[index];
      //hide answers
      $(answer).hide();
    }
    //show only selected one
    $('faqAnswer_' + faqId).show();
    
    //apply normal style to Questions
    var faqQuestions = $$('a.faqQuestion').invoke('readAttribute', 'id');
    faqQuestions.each(function(question) {
      // Your code working on item here...
      $(question).removeClassName('faqQuestionSelected');
    });
    //apply only to selected one
    $('faqQuestion_' + faqId).addClassName('faqQuestionSelected');
}

